aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/token_registry.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-01-23 04:53:32 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-01-30 23:01:36 +0800
commit387363283ca03ac1d6c9be5b7be2107790bbf79d (patch)
tree7f9ce518e2f4931321901dfeb2675d70854e996d /packages/contracts/test/token_registry.ts
parent709026bf1a49d468850b4ebed845c8598fa4fd75 (diff)
downloaddexon-sol-tools-387363283ca03ac1d6c9be5b7be2107790bbf79d.tar
dexon-sol-tools-387363283ca03ac1d6c9be5b7be2107790bbf79d.tar.gz
dexon-sol-tools-387363283ca03ac1d6c9be5b7be2107790bbf79d.tar.bz2
dexon-sol-tools-387363283ca03ac1d6c9be5b7be2107790bbf79d.tar.lz
dexon-sol-tools-387363283ca03ac1d6c9be5b7be2107790bbf79d.tar.xz
dexon-sol-tools-387363283ca03ac1d6c9be5b7be2107790bbf79d.tar.zst
dexon-sol-tools-387363283ca03ac1d6c9be5b7be2107790bbf79d.zip
Remove truffle from tests
Diffstat (limited to 'packages/contracts/test/token_registry.ts')
-rw-r--r--packages/contracts/test/token_registry.ts16
1 files changed, 6 insertions, 10 deletions
diff --git a/packages/contracts/test/token_registry.ts b/packages/contracts/test/token_registry.ts
index cc78feba3..1146353da 100644
--- a/packages/contracts/test/token_registry.ts
+++ b/packages/contracts/test/token_registry.ts
@@ -4,31 +4,30 @@ import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import ethUtil = require('ethereumjs-util');
import * as _ from 'lodash';
+import * as Web3 from 'web3';
-import { Artifacts } from '../util/artifacts';
import { constants } from '../util/constants';
import { TokenRegWrapper } from '../util/token_registry_wrapper';
-import { ContractInstance } from '../util/types';
import { chaiSetup } from './utils/chai_setup';
+import { deployer } from './utils/deployer';
-const { TokenRegistry } = new Artifacts(artifacts);
chaiSetup.configure();
const expect = chai.expect;
const web3 = web3Factory.create();
+const web3Wrapper = new Web3Wrapper(web3.currentProvider);
const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL);
describe('TokenRegistry', () => {
- const web3Wrapper = new Web3Wrapper(web3.currentProvider);
let owner: string;
let notOwner: string;
- let tokenReg: ContractInstance;
+ let tokenReg: Web3.ContractInstance;
let tokenRegWrapper: TokenRegWrapper;
before(async () => {
const accounts = await web3Wrapper.getAvailableAddressesAsync();
owner = accounts[0];
notOwner = accounts[1];
- tokenReg = await TokenRegistry.new();
+ tokenReg = await deployer.deployAsync('TokenRegistry');
tokenRegWrapper = new TokenRegWrapper(tokenReg);
});
beforeEach(async () => {
@@ -137,10 +136,9 @@ describe('TokenRegistry', () => {
});
it('should change the token name when called by owner', async () => {
- const res = await tokenReg.setTokenName(token1.address, token2.name, {
+ await tokenReg.setTokenName(token1.address, token2.name, {
from: owner,
});
- expect(res.logs).to.have.length(1);
const [newData, oldData] = await Promise.all([
tokenRegWrapper.getTokenByNameAsync(token2.name),
tokenRegWrapper.getTokenByNameAsync(token1.name),
@@ -178,7 +176,6 @@ describe('TokenRegistry', () => {
it('should change the token symbol when called by owner', async () => {
const res = await tokenReg.setTokenSymbol(token1.address, token2.symbol, { from: owner });
- expect(res.logs).to.have.length(1);
const [newData, oldData] = await Promise.all([
tokenRegWrapper.getTokenBySymbolAsync(token2.symbol),
tokenRegWrapper.getTokenBySymbolAsync(token1.symbol),
@@ -222,7 +219,6 @@ describe('TokenRegistry', () => {
const res = await tokenReg.removeToken(token1.address, index, {
from: owner,
});
- expect(res.logs).to.have.length(1);
const tokenData = await tokenRegWrapper.getTokenMetaDataAsync(token1.address);
expect(tokenData).to.be.deep.equal(nullToken);
});