aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/token_registry.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-05 06:38:15 +0800
committerFabio Berger <me@fabioberger.com>2018-07-05 06:38:15 +0800
commita0b9c7777b2171456a19aa6ddcf2a023b663a816 (patch)
treeb9cf9fe6d0030bf0e2591d3facccf38ff2d622c6 /packages/contracts/test/token_registry.ts
parent5204e4c08da7d32012047ee6ca4d898b0c45a47d (diff)
parent5176d929fa6d3c6ce414448ea2441bd450f04e3c (diff)
downloaddexon-sol-tools-a0b9c7777b2171456a19aa6ddcf2a023b663a816.tar
dexon-sol-tools-a0b9c7777b2171456a19aa6ddcf2a023b663a816.tar.gz
dexon-sol-tools-a0b9c7777b2171456a19aa6ddcf2a023b663a816.tar.bz2
dexon-sol-tools-a0b9c7777b2171456a19aa6ddcf2a023b663a816.tar.lz
dexon-sol-tools-a0b9c7777b2171456a19aa6ddcf2a023b663a816.tar.xz
dexon-sol-tools-a0b9c7777b2171456a19aa6ddcf2a023b663a816.tar.zst
dexon-sol-tools-a0b9c7777b2171456a19aa6ddcf2a023b663a816.zip
merge v2-prototype
Diffstat (limited to 'packages/contracts/test/token_registry.ts')
-rw-r--r--packages/contracts/test/token_registry.ts32
1 files changed, 15 insertions, 17 deletions
diff --git a/packages/contracts/test/token_registry.ts b/packages/contracts/test/token_registry.ts
index 32f8cdee3..7cc43be9b 100644
--- a/packages/contracts/test/token_registry.ts
+++ b/packages/contracts/test/token_registry.ts
@@ -7,7 +7,7 @@ import * as _ from 'lodash';
import { TokenRegistryContract } from '../generated_contract_wrappers/token_registry';
import { artifacts } from './utils/artifacts';
-import { expectRevertOrAlwaysFailingTransactionAsync } from './utils/assertions';
+import { expectTransactionFailedWithoutReasonAsync } from './utils/assertions';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
import { TokenRegWrapper } from './utils/token_registry_wrapper';
@@ -75,7 +75,7 @@ describe('TokenRegistry', () => {
describe('addToken', () => {
it('should throw when not called by owner', async () => {
- return expectRevertOrAlwaysFailingTransactionAsync(tokenRegWrapper.addTokenAsync(token1, notOwner));
+ return expectTransactionFailedWithoutReasonAsync(tokenRegWrapper.addTokenAsync(token1, notOwner));
});
it('should add token metadata when called by owner', async () => {
@@ -87,20 +87,18 @@ describe('TokenRegistry', () => {
it('should throw if token already exists', async () => {
await tokenRegWrapper.addTokenAsync(token1, owner);
- return expectRevertOrAlwaysFailingTransactionAsync(tokenRegWrapper.addTokenAsync(token1, owner));
+ return expectTransactionFailedWithoutReasonAsync(tokenRegWrapper.addTokenAsync(token1, owner));
});
it('should throw if token address is null', async () => {
- return expectRevertOrAlwaysFailingTransactionAsync(tokenRegWrapper.addTokenAsync(nullToken, owner));
+ return expectTransactionFailedWithoutReasonAsync(tokenRegWrapper.addTokenAsync(nullToken, owner));
});
it('should throw if name already exists', async () => {
await tokenRegWrapper.addTokenAsync(token1, owner);
const duplicateNameToken = _.assign({}, token2, { name: token1.name });
- return expectRevertOrAlwaysFailingTransactionAsync(
- tokenRegWrapper.addTokenAsync(duplicateNameToken, owner),
- );
+ return expectTransactionFailedWithoutReasonAsync(tokenRegWrapper.addTokenAsync(duplicateNameToken, owner));
});
it('should throw if symbol already exists', async () => {
@@ -109,7 +107,7 @@ describe('TokenRegistry', () => {
symbol: token1.symbol,
});
- return expectRevertOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedWithoutReasonAsync(
tokenRegWrapper.addTokenAsync(duplicateSymbolToken, owner),
);
});
@@ -136,7 +134,7 @@ describe('TokenRegistry', () => {
describe('setTokenName', () => {
it('should throw when not called by owner', async () => {
- return expectRevertOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedWithoutReasonAsync(
tokenReg.setTokenName.sendTransactionAsync(token1.address, token2.name, { from: notOwner }),
);
});
@@ -162,13 +160,13 @@ describe('TokenRegistry', () => {
it('should throw if the name already exists', async () => {
await tokenRegWrapper.addTokenAsync(token2, owner);
- return expectRevertOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedWithoutReasonAsync(
tokenReg.setTokenName.sendTransactionAsync(token1.address, token2.name, { from: owner }),
);
});
it('should throw if token does not exist', async () => {
- return expectRevertOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedWithoutReasonAsync(
tokenReg.setTokenName.sendTransactionAsync(nullToken.address, token2.name, { from: owner }),
);
});
@@ -176,7 +174,7 @@ describe('TokenRegistry', () => {
describe('setTokenSymbol', () => {
it('should throw when not called by owner', async () => {
- return expectRevertOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedWithoutReasonAsync(
tokenReg.setTokenSymbol.sendTransactionAsync(token1.address, token2.symbol, {
from: notOwner,
}),
@@ -202,7 +200,7 @@ describe('TokenRegistry', () => {
it('should throw if the symbol already exists', async () => {
await tokenRegWrapper.addTokenAsync(token2, owner);
- return expectRevertOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedWithoutReasonAsync(
tokenReg.setTokenSymbol.sendTransactionAsync(token1.address, token2.symbol, {
from: owner,
}),
@@ -210,7 +208,7 @@ describe('TokenRegistry', () => {
});
it('should throw if token does not exist', async () => {
- return expectRevertOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedWithoutReasonAsync(
tokenReg.setTokenSymbol.sendTransactionAsync(nullToken.address, token2.symbol, {
from: owner,
}),
@@ -221,7 +219,7 @@ describe('TokenRegistry', () => {
describe('removeToken', () => {
it('should throw if not called by owner', async () => {
const index = new BigNumber(0);
- return expectRevertOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedWithoutReasonAsync(
tokenReg.removeToken.sendTransactionAsync(token1.address, index, { from: notOwner }),
);
});
@@ -240,7 +238,7 @@ describe('TokenRegistry', () => {
it('should throw if token does not exist', async () => {
const index = new BigNumber(0);
- return expectRevertOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedWithoutReasonAsync(
tokenReg.removeToken.sendTransactionAsync(nullToken.address, index, { from: owner }),
);
});
@@ -248,7 +246,7 @@ describe('TokenRegistry', () => {
it('should throw if token at given index does not match address', async () => {
await tokenRegWrapper.addTokenAsync(token2, owner);
const incorrectIndex = new BigNumber(0);
- return expectRevertOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedWithoutReasonAsync(
tokenReg.removeToken.sendTransactionAsync(token2.address, incorrectIndex, { from: owner }),
);
});