diff options
author | Remco Bloemen <remco@wicked.ventures> | 2018-06-14 02:21:01 +0800 |
---|---|---|
committer | Remco Bloemen <remco@wicked.ventures> | 2018-06-23 19:53:39 +0800 |
commit | 6a6f98299de5fd67f9162cc57c73583702924a2f (patch) | |
tree | 7a36d4764d2ff19ef8cb66b1c5faf76767593f24 /packages/contracts/test | |
parent | 19ba272d62a3d838bb024e5152a2eb88f33645cd (diff) | |
download | dexon-sol-tools-6a6f98299de5fd67f9162cc57c73583702924a2f.tar dexon-sol-tools-6a6f98299de5fd67f9162cc57c73583702924a2f.tar.gz dexon-sol-tools-6a6f98299de5fd67f9162cc57c73583702924a2f.tar.bz2 dexon-sol-tools-6a6f98299de5fd67f9162cc57c73583702924a2f.tar.lz dexon-sol-tools-6a6f98299de5fd67f9162cc57c73583702924a2f.tar.xz dexon-sol-tools-6a6f98299de5fd67f9162cc57c73583702924a2f.tar.zst dexon-sol-tools-6a6f98299de5fd67f9162cc57c73583702924a2f.zip |
Move isFunctionRemoveAuthorizedAddress to test
Diffstat (limited to 'packages/contracts/test')
-rw-r--r-- | packages/contracts/test/asset_proxy_owner.ts | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/packages/contracts/test/asset_proxy_owner.ts b/packages/contracts/test/asset_proxy_owner.ts index aa4999e95..a46882828 100644 --- a/packages/contracts/test/asset_proxy_owner.ts +++ b/packages/contracts/test/asset_proxy_owner.ts @@ -10,11 +10,11 @@ import { ExecutionFailureContractEventArgs, SubmissionContractEventArgs, } from '../src/generated_contract_wrappers/asset_proxy_owner'; -import { MixinAuthorizableContract } from '../src/generated_contract_wrappers/mixin_authorizable'; +import { MixinAuthorizableContract } from '../src/generated_contract_wrappers/mixin_authorizable'; +import { TestAssetProxyOwnerContract} from '../src/generated_contract_wrappers/test_asset_proxy_owner'; import { artifacts } from '../src/utils/artifacts'; import { expectRevertOrAlwaysFailingTransactionAsync, - expectRevertOrContractCallFailedAsync, } from '../src/utils/assertions'; import { chaiSetup } from '../src/utils/chai_setup'; import { constants } from '../src/utils/constants'; @@ -35,6 +35,7 @@ describe('AssetProxyOwner', () => { let erc20Proxy: MixinAuthorizableContract; let erc721Proxy: MixinAuthorizableContract; let multiSig: AssetProxyOwnerContract; + let testAssetProxyOwner: TestAssetProxyOwnerContract; let multiSigWrapper: MultiSigWrapper; before(async () => { @@ -68,6 +69,15 @@ describe('AssetProxyOwner', () => { SECONDS_TIME_LOCKED, ); multiSigWrapper = new MultiSigWrapper(multiSig, provider); + testAssetProxyOwner = await TestAssetProxyOwnerContract.deployFrom0xArtifactAsync( + artifacts.TestAssetProxyOwner, + provider, + txDefaults, + owners, + defaultAssetProxyContractAddresses, + REQUIRED_APPROVALS, + SECONDS_TIME_LOCKED, + ); await web3Wrapper.awaitTransactionSuccessAsync( await erc20Proxy.transferOwnership.sendTransactionAsync(multiSig.address, { from: initialOwner }), constants.AWAIT_TRANSACTION_MINED_MS, @@ -118,23 +128,24 @@ describe('AssetProxyOwner', () => { }); describe('isFunctionRemoveAuthorizedAddress', () => { - it('should throw if data is not for removeAuthorizedAddress', async () => { + it('should return false if data is not for removeAuthorizedAddress', async () => { const notRemoveAuthorizedAddressData = erc20Proxy.addAuthorizedAddress.getABIEncodedTransactionData( owners[0], ); - return expectRevertOrContractCallFailedAsync( - multiSig.isFunctionRemoveAuthorizedAddress.callAsync(notRemoveAuthorizedAddressData), + const result = await testAssetProxyOwner.isFunctionRemoveAuthorizedAddress.callAsync( + notRemoveAuthorizedAddressData, ); + expect(result).to.be.false(); }); it('should return true if data is for removeAuthorizedAddress', async () => { const removeAuthorizedAddressData = erc20Proxy.removeAuthorizedAddress.getABIEncodedTransactionData( owners[0], ); - const isFunctionRemoveAuthorizedAddress = await multiSig.isFunctionRemoveAuthorizedAddress.callAsync( + const result = await testAssetProxyOwner.isFunctionRemoveAuthorizedAddress.callAsync( removeAuthorizedAddressData, ); - expect(isFunctionRemoveAuthorizedAddress).to.be.true(); + expect(result).to.be.true(); }); }); |