Add TransactionInvalidContextError and remove NO_REENTRANCY errorCode

This commit is contained in:
Amir Bandeali 2019-08-22 15:46:28 -07:00
parent 7b96fa8d76
commit 44753bb168

View File

@ -53,7 +53,6 @@ library LibExchangeRichErrors {
}
enum TransactionErrorCodes {
NO_REENTRANCY,
ALREADY_EXECUTED,
EXPIRED
}
@ -136,6 +135,10 @@ library LibExchangeRichErrors {
bytes4 internal constant TRANSACTION_GAS_PRICE_ERROR_SELECTOR =
0xa26dac09;
// bytes4(keccak256("TransactionInvalidContextError(bytes32,address)"))
bytes4 internal constant TRANSACTION_INVALID_CONTEXT_ERROR_SELECTOR =
0xdec4aedf;
// bytes4(keccak256("IncompleteFillError(uint8,uint256,uint256)"))
bytes4 internal constant INCOMPLETE_FILL_ERROR_SELECTOR =
0x18e4b141;
@ -610,6 +613,21 @@ library LibExchangeRichErrors {
);
}
function TransactionInvalidContextError(
bytes32 transactionHash,
address currentContextAddress
)
internal
pure
returns (bytes memory)
{
return abi.encodeWithSelector(
TRANSACTION_INVALID_CONTEXT_ERROR_SELECTOR,
transactionHash,
currentContextAddress
);
}
function IncompleteFillError(
IncompleteFillErrorCode errorCode,
uint256 expectedAssetFillAmount,