diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-27 00:53:44 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-27 00:53:44 +0800 |
commit | 43ae868c6945045e0c467977e1b3db143e99fc8c (patch) | |
tree | 048bd493a3ae76469fabcf7aa5ec1fffe6cdb3b3 /packages/contracts/test/asset_proxy | |
parent | 6dc852774e23aa38c66188100c31ba42667620e8 (diff) | |
parent | 1bc742aed1e7f10b79b5ef23ebb57b6c93d64e3c (diff) | |
download | dexon-sol-tools-43ae868c6945045e0c467977e1b3db143e99fc8c.tar dexon-sol-tools-43ae868c6945045e0c467977e1b3db143e99fc8c.tar.gz dexon-sol-tools-43ae868c6945045e0c467977e1b3db143e99fc8c.tar.bz2 dexon-sol-tools-43ae868c6945045e0c467977e1b3db143e99fc8c.tar.lz dexon-sol-tools-43ae868c6945045e0c467977e1b3db143e99fc8c.tar.xz dexon-sol-tools-43ae868c6945045e0c467977e1b3db143e99fc8c.tar.zst dexon-sol-tools-43ae868c6945045e0c467977e1b3db143e99fc8c.zip |
Merge branch 'refactor/check-revert-reasons' into feature/combinatorial-testing
* refactor/check-revert-reasons:
Temporarily switch revert reasons to `TransferFailed`. Should be `InvalidAmount` but because of an oversight in the assembly implementation of `dispatchTransferFrom`, it always throws `TransferFailed`
Expect RevertReason be passed in, not string
Rename RevertReasons to RevertReason since singular enum names are more common
# Conflicts:
# packages/contracts/test/asset_proxy/proxies.ts
# packages/contracts/test/exchange/core.ts
Diffstat (limited to 'packages/contracts/test/asset_proxy')
-rw-r--r-- | packages/contracts/test/asset_proxy/authorizable.ts | 10 | ||||
-rw-r--r-- | packages/contracts/test/asset_proxy/proxies.ts | 18 |
2 files changed, 14 insertions, 14 deletions
diff --git a/packages/contracts/test/asset_proxy/authorizable.ts b/packages/contracts/test/asset_proxy/authorizable.ts index badf50bfd..c2295dda6 100644 --- a/packages/contracts/test/asset_proxy/authorizable.ts +++ b/packages/contracts/test/asset_proxy/authorizable.ts @@ -1,5 +1,5 @@ import { BlockchainLifecycle } from '@0xproject/dev-utils'; -import { RevertReasons } from '@0xproject/types'; +import { RevertReason } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; @@ -49,7 +49,7 @@ describe('Authorizable', () => { it('should throw if not called by owner', async () => { return expectRevertReasonOrAlwaysFailingTransactionAsync( authorizable.addAuthorizedAddress.sendTransactionAsync(notOwner, { from: notOwner }), - RevertReasons.OnlyContractOwner, + RevertReason.OnlyContractOwner, ); }); it('should allow owner to add an authorized address', async () => { @@ -67,7 +67,7 @@ describe('Authorizable', () => { ); return expectRevertReasonOrAlwaysFailingTransactionAsync( authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }), - RevertReasons.TargetAlreadyAuthorized, + RevertReason.TargetAlreadyAuthorized, ); }); }); @@ -82,7 +82,7 @@ describe('Authorizable', () => { authorizable.removeAuthorizedAddress.sendTransactionAsync(address, { from: notOwner, }), - RevertReasons.OnlyContractOwner, + RevertReason.OnlyContractOwner, ); }); @@ -106,7 +106,7 @@ describe('Authorizable', () => { authorizable.removeAuthorizedAddress.sendTransactionAsync(address, { from: owner, }), - RevertReasons.TargetNotAuthorized, + RevertReason.TargetNotAuthorized, ); }); }); diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts index 7e8e69f4e..5f4c5b597 100644 --- a/packages/contracts/test/asset_proxy/proxies.ts +++ b/packages/contracts/test/asset_proxy/proxies.ts @@ -1,6 +1,6 @@ import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { assetProxyUtils, generatePseudoRandomSalt } from '@0xproject/order-utils'; -import { RevertReasons } from '@0xproject/types'; +import { RevertReason } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; import { LogWithDecodedArgs } from 'ethereum-types'; @@ -173,7 +173,7 @@ describe('Asset Transfer Proxies', () => { transferAmount, { from: exchangeAddress }, ), - RevertReasons.TransferFailed, + RevertReason.TransferFailed, ); }); @@ -187,7 +187,7 @@ describe('Asset Transfer Proxies', () => { erc20Proxy.transferFrom.sendTransactionAsync(encodedAssetData, makerAddress, takerAddress, amount, { from: notAuthorized, }), - RevertReasons.SenderNotAuthorized, + RevertReason.SenderNotAuthorized, ); }); }); @@ -239,7 +239,7 @@ describe('Asset Transfer Proxies', () => { erc20Proxy.batchTransferFrom.sendTransactionAsync(assetData, fromAddresses, toAddresses, amounts, { from: notAuthorized, }), - RevertReasons.SenderNotAuthorized, + RevertReason.SenderNotAuthorized, ); }); }); @@ -381,7 +381,7 @@ describe('Asset Transfer Proxies', () => { amount, { from: exchangeAddress }, ), - RevertReasons.InvalidAmount, + RevertReason.InvalidAmount, ); }); @@ -401,7 +401,7 @@ describe('Asset Transfer Proxies', () => { amount, { from: exchangeAddress }, ), - RevertReasons.InvalidAmount, + RevertReason.InvalidAmount, ); }); @@ -421,7 +421,7 @@ describe('Asset Transfer Proxies', () => { erc20Proxy.transferFrom.sendTransactionAsync(encodedAssetData, makerAddress, takerAddress, amount, { from: exchangeAddress, }), - RevertReasons.TransferFailed, + RevertReason.TransferFailed, ); }); @@ -438,7 +438,7 @@ describe('Asset Transfer Proxies', () => { amount, { from: notAuthorized }, ), - RevertReasons.SenderNotAuthorized, + RevertReason.SenderNotAuthorized, ); }); }); @@ -493,7 +493,7 @@ describe('Asset Transfer Proxies', () => { erc721Proxy.batchTransferFrom.sendTransactionAsync(assetData, fromAddresses, toAddresses, amounts, { from: notAuthorized, }), - RevertReasons.SenderNotAuthorized, + RevertReason.SenderNotAuthorized, ); }); }); |