diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-27 16:59:37 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-27 16:59:37 +0800 |
commit | c308359f59cc24510ff3d42ae777226a599db376 (patch) | |
tree | 1b5523e4fbc3434abd4f66f87a6bb5b59ca7c52b /packages/contracts/test/asset_proxy/authorizable.ts | |
parent | 375d667144e26253f8ff6b0ad1beb45d5b3ef228 (diff) | |
parent | 84bd54ba4025a33f4e311ec66d81d58b45e54d6b (diff) | |
download | dexon-sol-tools-c308359f59cc24510ff3d42ae777226a599db376.tar dexon-sol-tools-c308359f59cc24510ff3d42ae777226a599db376.tar.gz dexon-sol-tools-c308359f59cc24510ff3d42ae777226a599db376.tar.bz2 dexon-sol-tools-c308359f59cc24510ff3d42ae777226a599db376.tar.lz dexon-sol-tools-c308359f59cc24510ff3d42ae777226a599db376.tar.xz dexon-sol-tools-c308359f59cc24510ff3d42ae777226a599db376.tar.zst dexon-sol-tools-c308359f59cc24510ff3d42ae777226a599db376.zip |
Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype:
Improve 'web3-provider-engine' typings
Fix build
Update artifacts
Add more revert reasons to tests
Make dispatchTransferFrom revert with reason from AssetProxy on failure
Remove redundant files, hard code function selector in dispatchTransferFrom, and modify revert reason
Updated offset of receiverData length to reflect new assetData encoding.
ERC20 Custom storage layout
Golf the authorization check
ERC20 manual memory layout
ERC20 inline return
ERC721 inline return
Golf ERC721 transferFrom
Inline ERC20 tranferFrom selector constant
Optimize ERC20 transferFrom
Polish asset picker layout
Update relayer grid fallback icon
Change metamask install link based on browser
Use ethereumjs-tx@1.3.5 instead of our fork
# Conflicts:
# packages/contracts/test/asset_proxy/proxies.ts
# packages/contracts/test/exchange/core.ts
# packages/migrations/artifacts/2.0.0/DummyERC721Token.json
Diffstat (limited to 'packages/contracts/test/asset_proxy/authorizable.ts')
-rw-r--r-- | packages/contracts/test/asset_proxy/authorizable.ts | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/packages/contracts/test/asset_proxy/authorizable.ts b/packages/contracts/test/asset_proxy/authorizable.ts index c2295dda6..8c9d0495d 100644 --- a/packages/contracts/test/asset_proxy/authorizable.ts +++ b/packages/contracts/test/asset_proxy/authorizable.ts @@ -5,10 +5,7 @@ import * as chai from 'chai'; import { MixinAuthorizableContract } from '../../src/generated_contract_wrappers/mixin_authorizable'; import { artifacts } from '../../src/utils/artifacts'; -import { - expectRevertOrAlwaysFailingTransactionAsync, - expectRevertReasonOrAlwaysFailingTransactionAsync, -} from '../../src/utils/assertions'; +import { expectRevertReasonOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions'; import { chaiSetup } from '../../src/utils/chai_setup'; import { constants } from '../../src/utils/constants'; import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper'; @@ -118,10 +115,11 @@ describe('Authorizable', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); const index = new BigNumber(0); - return expectRevertOrAlwaysFailingTransactionAsync( + return expectRevertReasonOrAlwaysFailingTransactionAsync( authorizable.removeAuthorizedAddressAtIndex.sendTransactionAsync(address, index, { from: notOwner, }), + RevertReason.OnlyContractOwner, ); }); it('should throw if index is >= authorities.length', async () => { @@ -130,18 +128,20 @@ describe('Authorizable', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); const index = new BigNumber(1); - return expectRevertOrAlwaysFailingTransactionAsync( + return expectRevertReasonOrAlwaysFailingTransactionAsync( authorizable.removeAuthorizedAddressAtIndex.sendTransactionAsync(address, index, { from: owner, }), + RevertReason.IndexOutOfBounds, ); }); it('should throw if owner attempts to remove an address that is not authorized', async () => { const index = new BigNumber(0); - return expectRevertOrAlwaysFailingTransactionAsync( + return expectRevertReasonOrAlwaysFailingTransactionAsync( authorizable.removeAuthorizedAddressAtIndex.sendTransactionAsync(address, index, { from: owner, }), + RevertReason.TargetNotAuthorized, ); }); it('should throw if address at index does not match target', async () => { @@ -156,10 +156,11 @@ describe('Authorizable', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); const address1Index = new BigNumber(0); - return expectRevertOrAlwaysFailingTransactionAsync( + return expectRevertReasonOrAlwaysFailingTransactionAsync( authorizable.removeAuthorizedAddressAtIndex.sendTransactionAsync(address2, address1Index, { from: owner, }), + RevertReason.AuthorizedAddressMismatch, ); }); it('should allow owner to remove an authorized address', async () => { |