diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-01 23:13:15 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-01 23:13:15 +0800 |
commit | d1f352810f2228b2be143557f86e55c90193eea4 (patch) | |
tree | f3dc4ffb9dd9556344ebb29e00b8b7c2425bbf84 /test | |
parent | 9a3cd3d06c5cb74e772685501bedee7e3fce5990 (diff) | |
download | dexon-0x-contracts-d1f352810f2228b2be143557f86e55c90193eea4.tar.gz dexon-0x-contracts-d1f352810f2228b2be143557f86e55c90193eea4.tar.zst dexon-0x-contracts-d1f352810f2228b2be143557f86e55c90193eea4.zip |
give some balance and allowance by default
Diffstat (limited to 'test')
-rw-r--r-- | test/exchange_wrapper_test.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts index 92e2514dd..2becd2cbe 100644 --- a/test/exchange_wrapper_test.ts +++ b/test/exchange_wrapper_test.ts @@ -132,9 +132,12 @@ describe('ExchangeWrapper', () => { }); networkId = await promisify(web3.version.getNetwork)(); }); - beforeEach('setup', () => { + beforeEach('setup', async () => { maker = userAddresses[0]; taker = userAddresses[1]; + await setAllowance(maker, 5, addressBySymbol.MLN); + await setBalance(taker, 5, addressBySymbol.GNT); + await setAllowance(taker, 5, addressBySymbol.GNT); }); afterEach('reset default account', () => { zeroEx.setDefaultAccount(userAddresses[0]); @@ -165,12 +168,8 @@ describe('ExchangeWrapper', () => { }); describe('successful fills', () => { it('should fill the valid order', async () => { - await setAllowance(maker, 5, addressBySymbol.MLN); - await setBalance(taker, 5, addressBySymbol.GNT); - await setAllowance(taker, 5, addressBySymbol.GNT); const signedOrder = await orderFactory.createSignedOrderAsync(zeroEx, networkId, maker, taker, 5, addressBySymbol.MLN, 5, addressBySymbol.GNT); - const fillAmount = new BigNumber(5); zeroEx.setDefaultAccount(taker); await zeroEx.exchange.fillOrderAsync(signedOrder, fillAmount, shouldCheckTransfer); expect(await zeroEx.token.getBalanceAsync(addressBySymbol.MLN, taker)).to.be.bignumber.equal(5); |