diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-07 18:27:03 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-07 18:27:03 +0800 |
commit | 73429fc7202ff7b58eb64a7e0b939b971f16a27e (patch) | |
tree | 6abd050f91750c819e98045d21cd8952a0e14071 /packages/contracts/test/asset_proxy/authorizable.ts | |
parent | cb754ee1253622974e751e4a8d723a424250c878 (diff) | |
parent | e0bc01eea1c20e0afda296f331c6a475e062b59c (diff) | |
download | dexon-sol-tools-73429fc7202ff7b58eb64a7e0b939b971f16a27e.tar.gz dexon-sol-tools-73429fc7202ff7b58eb64a7e0b939b971f16a27e.tar.zst dexon-sol-tools-73429fc7202ff7b58eb64a7e0b939b971f16a27e.zip |
merge v2-prototype
Diffstat (limited to 'packages/contracts/test/asset_proxy/authorizable.ts')
-rw-r--r-- | packages/contracts/test/asset_proxy/authorizable.ts | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/packages/contracts/test/asset_proxy/authorizable.ts b/packages/contracts/test/asset_proxy/authorizable.ts index 6ceebf089..347d060d6 100644 --- a/packages/contracts/test/asset_proxy/authorizable.ts +++ b/packages/contracts/test/asset_proxy/authorizable.ts @@ -1,11 +1,10 @@ -import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; -import { Web3Wrapper } from '@0xproject/web3-wrapper'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import * as chai from 'chai'; import 'make-promises-safe'; -import * as Web3 from 'web3'; import { MixinAuthorizableContract } from '../../src/generated_contract_wrappers/mixin_authorizable'; import { artifacts } from '../../src/utils/artifacts'; +import { expectRevertOrAlwaysFailingTransactionAsync } 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'; @@ -44,9 +43,9 @@ describe('Authorizable', () => { }); describe('addAuthorizedAddress', () => { it('should throw if not called by owner', async () => { - return expect( + return expectRevertOrAlwaysFailingTransactionAsync( authorizable.addAuthorizedAddress.sendTransactionAsync(notOwner, { from: notOwner }), - ).to.be.rejectedWith(constants.REVERT); + ); }); it('should allow owner to add an authorized address', async () => { await web3Wrapper.awaitTransactionSuccessAsync( @@ -61,9 +60,9 @@ describe('Authorizable', () => { await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }), constants.AWAIT_TRANSACTION_MINED_MS, ); - return expect( + return expectRevertOrAlwaysFailingTransactionAsync( authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }), - ).to.be.rejectedWith(constants.REVERT); + ); }); }); @@ -73,11 +72,11 @@ describe('Authorizable', () => { await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }), constants.AWAIT_TRANSACTION_MINED_MS, ); - return expect( + return expectRevertOrAlwaysFailingTransactionAsync( authorizable.removeAuthorizedAddress.sendTransactionAsync(address, { from: notOwner, }), - ).to.be.rejectedWith(constants.REVERT); + ); }); it('should allow owner to remove an authorized address', async () => { @@ -96,11 +95,11 @@ describe('Authorizable', () => { }); it('should throw if owner attempts to remove an address that is not authorized', async () => { - return expect( + return expectRevertOrAlwaysFailingTransactionAsync( authorizable.removeAuthorizedAddress.sendTransactionAsync(address, { from: owner, }), - ).to.be.rejectedWith(constants.REVERT); + ); }); }); |