aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/asset_proxy/authorizable.ts
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-06-07 04:43:29 +0800
committerGitHub <noreply@github.com>2018-06-07 04:43:29 +0800
commit785b9811f30869f01242ce9ff81c282bf7f5352f (patch)
treefe1615f0db90f76627bfb88874c19634321105bc /packages/contracts/test/asset_proxy/authorizable.ts
parentda3f783a9ff69b059b1a98f502d980660d6bacab (diff)
parent643c77ded08d3082aff7ae47063d40c9c1fdb677 (diff)
downloaddexon-sol-tools-785b9811f30869f01242ce9ff81c282bf7f5352f.tar.gz
dexon-sol-tools-785b9811f30869f01242ce9ff81c282bf7f5352f.tar.zst
dexon-sol-tools-785b9811f30869f01242ce9ff81c282bf7f5352f.zip
Merge pull request #622 from 0xProject/geth-devnet-rebase-on-v2
Run contract tests against private Geth network
Diffstat (limited to 'packages/contracts/test/asset_proxy/authorizable.ts')
-rw-r--r--packages/contracts/test/asset_proxy/authorizable.ts17
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 e8274acb1..945208d82 100644
--- a/packages/contracts/test/asset_proxy/authorizable.ts
+++ b/packages/contracts/test/asset_proxy/authorizable.ts
@@ -6,6 +6,7 @@ import * as Web3 from 'web3';
import { MixinAuthorizableContract } from '../../src/contract_wrappers/generated/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 +45,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 +62,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 +74,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 +97,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);
+ );
});
});