aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/token_registry.ts
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-05-22 07:39:07 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-05-22 07:52:49 +0800
commit2c496a92adaef4132f6b0a135e61bad7b26b18bd (patch)
tree15466ce417120907a7b950c22e8e23230c09f746 /packages/contracts/test/token_registry.ts
parent4ca8903a21d5a78ace5bff3fc5bbc917e369cbfe (diff)
downloaddexon-0x-contracts-2c496a92adaef4132f6b0a135e61bad7b26b18bd.tar
dexon-0x-contracts-2c496a92adaef4132f6b0a135e61bad7b26b18bd.tar.gz
dexon-0x-contracts-2c496a92adaef4132f6b0a135e61bad7b26b18bd.tar.bz2
dexon-0x-contracts-2c496a92adaef4132f6b0a135e61bad7b26b18bd.tar.lz
dexon-0x-contracts-2c496a92adaef4132f6b0a135e61bad7b26b18bd.tar.xz
dexon-0x-contracts-2c496a92adaef4132f6b0a135e61bad7b26b18bd.tar.zst
dexon-0x-contracts-2c496a92adaef4132f6b0a135e61bad7b26b18bd.zip
Add awaitTransactionMinedAsync after every sent transaction
Diffstat (limited to 'packages/contracts/test/token_registry.ts')
-rw-r--r--packages/contracts/test/token_registry.ts23
1 files changed, 16 insertions, 7 deletions
diff --git a/packages/contracts/test/token_registry.ts b/packages/contracts/test/token_registry.ts
index c14f64184..308dee8e6 100644
--- a/packages/contracts/test/token_registry.ts
+++ b/packages/contracts/test/token_registry.ts
@@ -143,9 +143,12 @@ describe('TokenRegistry', () => {
});
it('should change the token name when called by owner', async () => {
- await tokenReg.setTokenName.sendTransactionAsync(token1.address, token2.name, {
- from: owner,
- });
+ await web3Wrapper.awaitTransactionMinedAsync(
+ await tokenReg.setTokenName.sendTransactionAsync(token1.address, token2.name, {
+ from: owner,
+ }),
+ constants.AWAIT_TRANSACTION_MINED_MS,
+ );
const [newData, oldData] = await Promise.all([
tokenRegWrapper.getTokenByNameAsync(token2.name),
tokenRegWrapper.getTokenByNameAsync(token1.name),
@@ -182,7 +185,10 @@ describe('TokenRegistry', () => {
});
it('should change the token symbol when called by owner', async () => {
- await tokenReg.setTokenSymbol.sendTransactionAsync(token1.address, token2.symbol, { from: owner });
+ await web3Wrapper.awaitTransactionMinedAsync(
+ await tokenReg.setTokenSymbol.sendTransactionAsync(token1.address, token2.symbol, { from: owner }),
+ constants.AWAIT_TRANSACTION_MINED_MS,
+ );
const [newData, oldData] = await Promise.all([
tokenRegWrapper.getTokenBySymbolAsync(token2.symbol),
tokenRegWrapper.getTokenBySymbolAsync(token1.symbol),
@@ -223,9 +229,12 @@ describe('TokenRegistry', () => {
it('should remove token metadata when called by owner', async () => {
const index = new BigNumber(0);
- await tokenReg.removeToken.sendTransactionAsync(token1.address, index, {
- from: owner,
- });
+ await web3Wrapper.awaitTransactionMinedAsync(
+ await tokenReg.removeToken.sendTransactionAsync(token1.address, index, {
+ from: owner,
+ }),
+ constants.AWAIT_TRANSACTION_MINED_MS,
+ );
const tokenData = await tokenRegWrapper.getTokenMetaDataAsync(token1.address);
expect(tokenData).to.be.deep.equal(nullToken);
});