diff options
author | Fabio Berger <me@fabioberger.com> | 2017-06-01 23:38:25 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-06-01 23:38:25 +0800 |
commit | 3a4020c78b9b22a52db0f964ac20ced905fa1bcd (patch) | |
tree | c4d6e539700ec3e4eb252363dc28b6dca72cf665 | |
parent | 35b7a60e9704e5ab222dc7552cbe523d12dcb003 (diff) | |
parent | 39957df2c3cd676625d6ebda0fe24f52cd1d3134 (diff) | |
download | dexon-0x-contracts-3a4020c78b9b22a52db0f964ac20ced905fa1bcd.tar dexon-0x-contracts-3a4020c78b9b22a52db0f964ac20ced905fa1bcd.tar.gz dexon-0x-contracts-3a4020c78b9b22a52db0f964ac20ced905fa1bcd.tar.bz2 dexon-0x-contracts-3a4020c78b9b22a52db0f964ac20ced905fa1bcd.tar.lz dexon-0x-contracts-3a4020c78b9b22a52db0f964ac20ced905fa1bcd.tar.xz dexon-0x-contracts-3a4020c78b9b22a52db0f964ac20ced905fa1bcd.tar.zst dexon-0x-contracts-3a4020c78b9b22a52db0f964ac20ced905fa1bcd.zip |
Merge branch 'fillOrderAsync' of github.com:0xProject/0x.js into fillOrderAsync
-rw-r--r-- | test/exchange_wrapper_test.ts | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts index cb7482c99..091d23fca 100644 --- a/test/exchange_wrapper_test.ts +++ b/test/exchange_wrapper_test.ts @@ -110,18 +110,6 @@ describe('ExchangeWrapper', () => { let networkId: number; const addressBySymbol: {[symbol: string]: string} = {}; const shouldCheckTransfer = false; - const setBalanceAsync = async (toAddress: string, - amountInBaseUnits: BigNumber.BigNumber|number, - tokenAddress: string) => { - const amount = _.isNumber(amountInBaseUnits) ? new BigNumber(amountInBaseUnits) : amountInBaseUnits; - await zeroEx.token.transferAsync(tokenAddress, userAddresses[0], toAddress, amount); - }; - const setAllowanceAsync = async (ownerAddress: string, - amountInBaseUnits: BigNumber.BigNumber|number, - tokenAddress: string) => { - const amount = _.isNumber(amountInBaseUnits) ? new BigNumber(amountInBaseUnits) : amountInBaseUnits; - await zeroEx.token.setProxyAllowanceAsync(tokenAddress, ownerAddress, amount); - }; before('fetch tokens', async () => { tokens = await zeroEx.tokenRegistry.getTokensAsync(); _.forEach(tokens, token => { @@ -132,9 +120,9 @@ describe('ExchangeWrapper', () => { beforeEach('setup', async () => { maker = userAddresses[0]; taker = userAddresses[1]; - await setAllowanceAsync(maker, 5, addressBySymbol.MLN); - await setBalanceAsync(taker, 5, addressBySymbol.GNT); - await setAllowanceAsync(taker, 5, addressBySymbol.GNT); + await zeroEx.token.setProxyAllowanceAsync(addressBySymbol.MLN, maker, new BigNumber(5)); + await zeroEx.token.transferAsync(addressBySymbol.GNT, maker, taker, new BigNumber(5)); + await zeroEx.token.setProxyAllowanceAsync(addressBySymbol.GNT, taker, new BigNumber(5)); }); afterEach('reset default account', () => { zeroEx.setDefaultAccount(userAddresses[0]); |