aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/zrx_token.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-02-06 23:40:03 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-02-07 09:27:47 +0800
commita264c36a48d224a55c2ef883f207692752ca74c7 (patch)
tree6ae38d36405de58c9c60d3d2164f8427110a1796 /packages/contracts/test/zrx_token.ts
parent0c2ab2265624eb0dc18244b263fed3c8788b5c09 (diff)
downloaddexon-sol-tools-a264c36a48d224a55c2ef883f207692752ca74c7.tar
dexon-sol-tools-a264c36a48d224a55c2ef883f207692752ca74c7.tar.gz
dexon-sol-tools-a264c36a48d224a55c2ef883f207692752ca74c7.tar.bz2
dexon-sol-tools-a264c36a48d224a55c2ef883f207692752ca74c7.tar.lz
dexon-sol-tools-a264c36a48d224a55c2ef883f207692752ca74c7.tar.xz
dexon-sol-tools-a264c36a48d224a55c2ef883f207692752ca74c7.tar.zst
dexon-sol-tools-a264c36a48d224a55c2ef883f207692752ca74c7.zip
Change tests
Diffstat (limited to 'packages/contracts/test/zrx_token.ts')
-rw-r--r--packages/contracts/test/zrx_token.ts16
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/contracts/test/zrx_token.ts b/packages/contracts/test/zrx_token.ts
index 1844a67af..5e4bfed37 100644
--- a/packages/contracts/test/zrx_token.ts
+++ b/packages/contracts/test/zrx_token.ts
@@ -5,6 +5,7 @@ import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import * as Web3 from 'web3';
+import { ZRXTokenContract } from '../src/contract_wrappers/generated/z_r_x_token';
import { constants } from '../util/constants';
import { ContractName } from '../util/types';
@@ -24,7 +25,7 @@ describe('ZRXToken', () => {
let MAX_UINT: BigNumber;
- let zrx: Web3.ContractInstance;
+ let zrx: ZRXTokenContract;
let zrxAddress: string;
before(async () => {
@@ -34,7 +35,8 @@ describe('ZRXToken', () => {
zeroEx = new ZeroEx(web3.currentProvider, {
networkId: constants.TESTRPC_NETWORK_ID,
});
- zrx = await deployer.deployAsync(ContractName.ZRXToken);
+ const zrxInstance = await deployer.deployAsync(ContractName.ZRXToken);
+ zrx = new ZRXTokenContract(zrxInstance);
zrxAddress = zrx.address;
MAX_UINT = zeroEx.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
});
@@ -94,7 +96,7 @@ describe('ZRXToken', () => {
});
it('should return true on a 0 value transfer', async () => {
- const didReturnTrue = await zrx.transfer.call(spender, 0, {
+ const didReturnTrue = await zrx.transfer.callAsync(spender, new BigNumber(0), {
from: owner,
});
expect(didReturnTrue).to.be.true();
@@ -108,7 +110,7 @@ describe('ZRXToken', () => {
await zeroEx.token.setAllowanceAsync(zrxAddress, owner, spender, amountToTransfer, {
gasLimit: constants.MAX_TOKEN_APPROVE_GAS,
});
- const didReturnTrue = await zrx.transferFrom.call(owner, spender, amountToTransfer, { from: spender });
+ const didReturnTrue = await zrx.transferFrom.callAsync(owner, spender, amountToTransfer, { from: spender });
expect(didReturnTrue).to.be.false();
});
@@ -120,13 +122,13 @@ describe('ZRXToken', () => {
const spenderAllowanceIsInsufficient = spenderAllowance.cmp(amountToTransfer) < 0;
expect(spenderAllowanceIsInsufficient).to.be.true();
- const didReturnTrue = await zrx.transferFrom.call(owner, spender, amountToTransfer, { from: spender });
+ const didReturnTrue = await zrx.transferFrom.callAsync(owner, spender, amountToTransfer, { from: spender });
expect(didReturnTrue).to.be.false();
});
it('should return true on a 0 value transfer', async () => {
- const amountToTransfer = 0;
- const didReturnTrue = await zrx.transferFrom.call(owner, spender, amountToTransfer, { from: spender });
+ const amountToTransfer = new BigNumber(0);
+ const didReturnTrue = await zrx.transferFrom.callAsync(owner, spender, amountToTransfer, { from: spender });
expect(didReturnTrue).to.be.true();
});