Skip to content

Commit

Permalink
Merge pull request 0xProject#2657 from 0xProject/fix/ep/meta-transact…
Browse files Browse the repository at this point in the history
…ions

EP: MetaTransactions fixes
  • Loading branch information
dorothy-zbornak authored Sep 4, 2020
2 parents 7b0a1c3 + eb14107 commit 08ae43a
Show file tree
Hide file tree
Showing 117 changed files with 2,363 additions and 844 deletions.
4 changes: 2 additions & 2 deletions contracts/exchange/test/dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ describe('AssetProxyDispatcher', () => {
const expectedError = new ExchangeRevertErrors.AssetProxyTransferError(
orderHash,
encodedAssetData,
nestedError.toString(),
nestedError.encode(),
);
const tx = assetProxyDispatcher
.dispatchTransferFrom(orderHash, encodedAssetData, makerAddress, takerAddress, amount)
Expand All @@ -313,7 +313,7 @@ describe('AssetProxyDispatcher', () => {
const expectedError = new ExchangeRevertErrors.AssetProxyTransferError(
transferIndexAsBytes32,
assetDataB,
nestedError.toString(),
nestedError.encode(),
);
const tx = assetProxyDispatcher
.simulateDispatchTransferFromCalls(
Expand Down
10 changes: 5 additions & 5 deletions contracts/exchange/test/signature_validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ blockchainTests.resets('MixinSignatureValidator', env => {
hashHex,
validatorWallet.address,
signatureHex,
new StringRevertError(validatorWalletRevertReason).toString(),
new StringRevertError(validatorWalletRevertReason).encode(),
);
const tx = validateAsync(hashHex, validatorWallet.address, signatureHex, ValidatorWalletAction.Revert);
return expect(tx).to.revertWith(expectedError);
Expand Down Expand Up @@ -562,7 +562,7 @@ blockchainTests.resets('MixinSignatureValidator', env => {
validatorWallet.address,
data,
signatureHex,
new StringRevertError(validatorWalletRevertReason).toString(),
new StringRevertError(validatorWalletRevertReason).encode(),
);
const tx = validateAsync(signedOrder, signatureHex, ValidatorWalletAction.Revert);
return expect(tx).to.revertWith(expectedError);
Expand Down Expand Up @@ -693,7 +693,7 @@ blockchainTests.resets('MixinSignatureValidator', env => {
validatorWallet.address,
data,
signatureHex,
new StringRevertError(validatorWalletRevertReason).toString(),
new StringRevertError(validatorWalletRevertReason).encode(),
);
const tx = validateAsync(signedOrder, signatureHex, ValidatorWalletAction.Revert);
return expect(tx).to.revertWith(expectedError);
Expand Down Expand Up @@ -916,7 +916,7 @@ blockchainTests.resets('MixinSignatureValidator', env => {
validatorWallet.address,
data,
signatureHex,
new StringRevertError(validatorWalletRevertReason).toString(),
new StringRevertError(validatorWalletRevertReason).encode(),
);
const tx = validateAsync(signedTransaction, signatureHex, ValidatorWalletAction.Revert);
return expect(tx).to.revertWith(expectedError);
Expand Down Expand Up @@ -1041,7 +1041,7 @@ blockchainTests.resets('MixinSignatureValidator', env => {
validatorWallet.address,
data,
signatureHex,
new StringRevertError(validatorWalletRevertReason).toString(),
new StringRevertError(validatorWalletRevertReason).encode(),
);
const tx = validateAsync(signedTransaction, signatureHex, ValidatorWalletAction.Revert);
return expect(tx).to.revertWith(expectedError);
Expand Down
16 changes: 8 additions & 8 deletions contracts/exchange/test/transactions_unit_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ blockchainTests.resets('Transaction Unit Tests', ({ provider, web3Wrapper, txDef
const executableError = new StringRevertError('EXECUTABLE_FAILED');
const expectedError = new ExchangeRevertErrors.TransactionExecutionError(
transactionHash,
executableError.toString(),
executableError.encode(),
);

// Call the `batchExecuteTransactions()` function and ensure that it reverts with the expected revert error.
Expand All @@ -123,7 +123,7 @@ blockchainTests.resets('Transaction Unit Tests', ({ provider, web3Wrapper, txDef
const executableError = new StringRevertError('EXECUTABLE_FAILED');
const expectedError = new ExchangeRevertErrors.TransactionExecutionError(
transactionHash,
executableError.toString(),
executableError.encode(),
);

// Call the `batchExecuteTransactions()` function and ensure that it reverts with the expected revert error.
Expand All @@ -145,7 +145,7 @@ blockchainTests.resets('Transaction Unit Tests', ({ provider, web3Wrapper, txDef
const executableError = new StringRevertError('EXECUTABLE_FAILED');
const expectedError = new ExchangeRevertErrors.TransactionExecutionError(
transactionHash,
executableError.toString(),
executableError.encode(),
);

// Call the `batchExecuteTransactions()` function and ensure that it reverts with the expected revert error.
Expand Down Expand Up @@ -280,7 +280,7 @@ blockchainTests.resets('Transaction Unit Tests', ({ provider, web3Wrapper, txDef
const outerExecuteTransactionHash = transactionHashUtils.getTransactionHashHex(outerExecuteTransaction);
const outerExpectedError = new ExchangeRevertErrors.TransactionExecutionError(
outerExecuteTransactionHash,
innerExpectedError.toString(),
innerExpectedError.encode(),
);
const tx = transactionsContract
.batchExecuteTransactions([outerExecuteTransaction], [randomSignature()])
Expand Down Expand Up @@ -363,7 +363,7 @@ blockchainTests.resets('Transaction Unit Tests', ({ provider, web3Wrapper, txDef
const errorData = new ExchangeRevertErrors.TransactionInvalidContextError(
innerTransactionHash,
accounts[0],
).toString();
).encode();
const expectedError = new ExchangeRevertErrors.TransactionExecutionError(outerTransactionHash, errorData);
const tx = transactionsContract
.executeTransaction(outerTransaction, validSignature)
Expand All @@ -385,7 +385,7 @@ blockchainTests.resets('Transaction Unit Tests', ({ provider, web3Wrapper, txDef
const errorData = new ExchangeRevertErrors.TransactionInvalidContextError(
innerTransactionHash,
accounts[0],
).toString();
).encode();
const expectedError = new ExchangeRevertErrors.TransactionExecutionError(outerTransactionHash, errorData);
const tx = transactionsContract
.executeTransaction(outerTransaction, validSignature)
Expand Down Expand Up @@ -466,7 +466,7 @@ blockchainTests.resets('Transaction Unit Tests', ({ provider, web3Wrapper, txDef
const executableError = new StringRevertError('EXECUTABLE_FAILED');
const expectedError = new ExchangeRevertErrors.TransactionExecutionError(
transactionHash,
executableError.toString(),
executableError.encode(),
);
const tx = transactionsContract
.executeTransaction(transaction, randomSignature())
Expand All @@ -486,7 +486,7 @@ blockchainTests.resets('Transaction Unit Tests', ({ provider, web3Wrapper, txDef
const executableError = new StringRevertError('EXECUTABLE_FAILED');
const expectedError = new ExchangeRevertErrors.TransactionExecutionError(
transactionHash,
executableError.toString(),
executableError.encode(),
);
const tx = transactionsContract
.executeTransaction(transaction, validSignature)
Expand Down
4 changes: 4 additions & 0 deletions contracts/integrations/CHANGELOG.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
{
"note": "Update curveBridge tests",
"pr": 2633
},
{
"note": "Add EP RFQT + MTX tests",
"pr": 2692
}
]
},
Expand Down
1 change: 1 addition & 0 deletions contracts/integrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"@0x/contracts-multisig": "^4.1.7",
"@0x/contracts-staking": "^2.0.14",
"@0x/contracts-test-utils": "^5.3.4",
"@0x/contracts-zero-ex": "^0.2.0",
"@0x/subproviders": "^6.1.1",
"@0x/types": "^3.2.0",
"@0x/typescript-typings": "^5.1.1",
Expand Down
Loading

0 comments on commit 08ae43a

Please sign in to comment.