aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/asset_proxy/authorizable.ts
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-07-03 09:44:37 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-07-03 09:57:33 +0800
commit5b64b3ea937326978b5742ec1b3692ebe5c41991 (patch)
tree34f4029b1985295490479d3da93cae62de5396d1 /packages/contracts/test/asset_proxy/authorizable.ts
parentb1dc20bbb35e8fb6370820a94d6f56306453fc4d (diff)
downloaddexon-sol-tools-5b64b3ea937326978b5742ec1b3692ebe5c41991.tar
dexon-sol-tools-5b64b3ea937326978b5742ec1b3692ebe5c41991.tar.gz
dexon-sol-tools-5b64b3ea937326978b5742ec1b3692ebe5c41991.tar.bz2
dexon-sol-tools-5b64b3ea937326978b5742ec1b3692ebe5c41991.tar.lz
dexon-sol-tools-5b64b3ea937326978b5742ec1b3692ebe5c41991.tar.xz
dexon-sol-tools-5b64b3ea937326978b5742ec1b3692ebe5c41991.tar.zst
dexon-sol-tools-5b64b3ea937326978b5742ec1b3692ebe5c41991.zip
Improve robustness of revert reason assertions
Diffstat (limited to 'packages/contracts/test/asset_proxy/authorizable.ts')
-rw-r--r--packages/contracts/test/asset_proxy/authorizable.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/packages/contracts/test/asset_proxy/authorizable.ts b/packages/contracts/test/asset_proxy/authorizable.ts
index 5a0586c28..e99c6cee3 100644
--- a/packages/contracts/test/asset_proxy/authorizable.ts
+++ b/packages/contracts/test/asset_proxy/authorizable.ts
@@ -5,7 +5,7 @@ import * as chai from 'chai';
import { MixinAuthorizableContract } from '../../generated_contract_wrappers/mixin_authorizable';
import { artifacts } from '../utils/artifacts';
-import { expectRevertReasonOrAlwaysFailingTransactionAsync } from '../utils/assertions';
+import { expectTransactionFailedAsync } from '../utils/assertions';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
import { provider, txDefaults, web3Wrapper } from '../utils/web3_wrapper';
@@ -44,7 +44,7 @@ describe('Authorizable', () => {
});
describe('addAuthorizedAddress', () => {
it('should throw if not called by owner', async () => {
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
authorizable.addAuthorizedAddress.sendTransactionAsync(notOwner, { from: notOwner }),
RevertReason.OnlyContractOwner,
);
@@ -62,7 +62,7 @@ describe('Authorizable', () => {
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
constants.AWAIT_TRANSACTION_MINED_MS,
);
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
RevertReason.TargetAlreadyAuthorized,
);
@@ -75,7 +75,7 @@ describe('Authorizable', () => {
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
constants.AWAIT_TRANSACTION_MINED_MS,
);
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
authorizable.removeAuthorizedAddress.sendTransactionAsync(address, {
from: notOwner,
}),
@@ -99,7 +99,7 @@ describe('Authorizable', () => {
});
it('should throw if owner attempts to remove an address that is not authorized', async () => {
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
authorizable.removeAuthorizedAddress.sendTransactionAsync(address, {
from: owner,
}),
@@ -115,7 +115,7 @@ describe('Authorizable', () => {
constants.AWAIT_TRANSACTION_MINED_MS,
);
const index = new BigNumber(0);
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
authorizable.removeAuthorizedAddressAtIndex.sendTransactionAsync(address, index, {
from: notOwner,
}),
@@ -128,7 +128,7 @@ describe('Authorizable', () => {
constants.AWAIT_TRANSACTION_MINED_MS,
);
const index = new BigNumber(1);
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
authorizable.removeAuthorizedAddressAtIndex.sendTransactionAsync(address, index, {
from: owner,
}),
@@ -137,7 +137,7 @@ describe('Authorizable', () => {
});
it('should throw if owner attempts to remove an address that is not authorized', async () => {
const index = new BigNumber(0);
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
authorizable.removeAuthorizedAddressAtIndex.sendTransactionAsync(address, index, {
from: owner,
}),
@@ -156,7 +156,7 @@ describe('Authorizable', () => {
constants.AWAIT_TRANSACTION_MINED_MS,
);
const address1Index = new BigNumber(0);
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
authorizable.removeAuthorizedAddressAtIndex.sendTransactionAsync(address2, address1Index, {
from: owner,
}),