diff options
author | Fabio Berger <me@fabioberger.com> | 2017-12-16 02:37:03 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-12-16 02:37:03 +0800 |
commit | b46dd2e0a277340c19fa137a436981cc53c8cb80 (patch) | |
tree | d2814176fe8ffc5ec6a61534aa77487aae6bcc13 /packages/contracts/test/ts/token_registry.ts | |
parent | 484dd4c33aa5786def1f0b159f5b51f99a585aa8 (diff) | |
parent | 3eb08735d4d0fe4b046dd6b74f5ed503cf5c64e3 (diff) | |
download | dexon-0x-contracts-b46dd2e0a277340c19fa137a436981cc53c8cb80.tar.gz dexon-0x-contracts-b46dd2e0a277340c19fa137a436981cc53c8cb80.tar.zst dexon-0x-contracts-b46dd2e0a277340c19fa137a436981cc53c8cb80.zip |
Merge branch 'development' into createWethPage
* development: (54 commits)
Fix redundant spaces
Fix tests
Fix website unused vars
Fix connect unused vars
Fix 0x.js unused vars
Dissallow unused vars/imports
Implement first custom linter rule async-suffix
Reuse intervalutils in website
Add a newline
Name a variable
Add a comment
Fix a conditional
Make migrations deterministic
Fix linter error
Fix linter errors
Add a function to init token balances
Rename tokenUtils.getNonProtocolTokens to tokenUtils.getDummyTokens
Add DummyToken to gitignore
Add DummyToken to artifacts list
Increase mocha timeout
...
Diffstat (limited to 'packages/contracts/test/ts/token_registry.ts')
-rw-r--r-- | packages/contracts/test/ts/token_registry.ts | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/packages/contracts/test/ts/token_registry.ts b/packages/contracts/test/ts/token_registry.ts index ed0bbf55b..36f3edcfc 100644 --- a/packages/contracts/test/ts/token_registry.ts +++ b/packages/contracts/test/ts/token_registry.ts @@ -58,7 +58,7 @@ contract('TokenRegistry', (accounts: string[]) => { describe('addToken', () => { it('should throw when not called by owner', async () => { - return expect(tokenRegWrapper.addTokenAsync(token1, notOwner)).to.be.rejectedWith(constants.INVALID_OPCODE); + return expect(tokenRegWrapper.addTokenAsync(token1, notOwner)).to.be.rejectedWith(constants.REVERT); }); it('should add token metadata when called by owner', async () => { @@ -70,11 +70,11 @@ contract('TokenRegistry', (accounts: string[]) => { it('should throw if token already exists', async () => { await tokenRegWrapper.addTokenAsync(token1, owner); - return expect(tokenRegWrapper.addTokenAsync(token1, owner)).to.be.rejectedWith(constants.INVALID_OPCODE); + return expect(tokenRegWrapper.addTokenAsync(token1, owner)).to.be.rejectedWith(constants.REVERT); }); it('should throw if token address is null', async () => { - return expect(tokenRegWrapper.addTokenAsync(nullToken, owner)).to.be.rejectedWith(constants.INVALID_OPCODE); + return expect(tokenRegWrapper.addTokenAsync(nullToken, owner)).to.be.rejectedWith(constants.REVERT); }); it('should throw if name already exists', async () => { @@ -82,7 +82,7 @@ contract('TokenRegistry', (accounts: string[]) => { const duplicateNameToken = _.assign({}, token2, {name: token1.name}); return expect(tokenRegWrapper.addTokenAsync(duplicateNameToken, owner)) - .to.be.rejectedWith(constants.INVALID_OPCODE); + .to.be.rejectedWith(constants.REVERT); }); it('should throw if symbol already exists', async () => { @@ -90,7 +90,7 @@ contract('TokenRegistry', (accounts: string[]) => { const duplicateSymbolToken = _.assign({}, token2, {symbol: token1.symbol}); return expect(tokenRegWrapper.addTokenAsync(duplicateSymbolToken, owner)) - .to.be.rejectedWith(constants.INVALID_OPCODE); + .to.be.rejectedWith(constants.REVERT); }); }); @@ -116,7 +116,7 @@ contract('TokenRegistry', (accounts: string[]) => { describe('setTokenName', () => { it('should throw when not called by owner', async () => { return expect(tokenReg.setTokenName(token1.address, token2.name, {from: notOwner})) - .to.be.rejectedWith(constants.INVALID_OPCODE); + .to.be.rejectedWith(constants.REVERT); }); it('should change the token name when called by owner', async () => { @@ -137,19 +137,19 @@ contract('TokenRegistry', (accounts: string[]) => { await tokenRegWrapper.addTokenAsync(token2, owner); return expect(tokenReg.setTokenName(token1.address, token2.name, {from: owner})) - .to.be.rejectedWith(constants.INVALID_OPCODE); + .to.be.rejectedWith(constants.REVERT); }); it('should throw if token does not exist', async () => { return expect(tokenReg.setTokenName(nullToken.address, token2.name, {from: owner})) - .to.be.rejectedWith(constants.INVALID_OPCODE); + .to.be.rejectedWith(constants.REVERT); }); }); describe('setTokenSymbol', () => { it('should throw when not called by owner', async () => { return expect(tokenReg.setTokenSymbol(token1.address, token2.symbol, {from: notOwner})) - .to.be.rejectedWith(constants.INVALID_OPCODE); + .to.be.rejectedWith(constants.REVERT); }); it('should change the token symbol when called by owner', async () => { @@ -170,12 +170,12 @@ contract('TokenRegistry', (accounts: string[]) => { await tokenRegWrapper.addTokenAsync(token2, owner); return expect(tokenReg.setTokenSymbol(token1.address, token2.symbol, {from: owner})) - .to.be.rejectedWith(constants.INVALID_OPCODE); + .to.be.rejectedWith(constants.REVERT); }); it('should throw if token does not exist', async () => { return expect(tokenReg.setTokenSymbol(nullToken.address, token2.symbol, {from: owner})) - .to.be.rejectedWith(constants.INVALID_OPCODE); + .to.be.rejectedWith(constants.REVERT); }); }); @@ -183,7 +183,7 @@ contract('TokenRegistry', (accounts: string[]) => { it('should throw if not called by owner', async () => { const index = 0; return expect(tokenReg.removeToken(token1.address, index, {from: notOwner})) - .to.be.rejectedWith(constants.INVALID_OPCODE); + .to.be.rejectedWith(constants.REVERT); }); it('should remove token metadata when called by owner', async () => { @@ -197,14 +197,14 @@ contract('TokenRegistry', (accounts: string[]) => { it('should throw if token does not exist', async () => { const index = 0; return expect(tokenReg.removeToken(nullToken.address, index, {from: owner})) - .to.be.rejectedWith(constants.INVALID_OPCODE); + .to.be.rejectedWith(constants.REVERT); }); it('should throw if token at given index does not match address', async () => { await tokenRegWrapper.addTokenAsync(token2, owner); const incorrectIndex = 0; return expect(tokenReg.removeToken(token2.address, incorrectIndex, {from: owner})) - .to.be.rejectedWith(constants.INVALID_OPCODE); + .to.be.rejectedWith(constants.REVERT); }); }); |