aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-01 23:13:15 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-01 23:13:15 +0800
commitd1f352810f2228b2be143557f86e55c90193eea4 (patch)
treef3dc4ffb9dd9556344ebb29e00b8b7c2425bbf84
parent9a3cd3d06c5cb74e772685501bedee7e3fce5990 (diff)
downloaddexon-sol-tools-d1f352810f2228b2be143557f86e55c90193eea4.tar
dexon-sol-tools-d1f352810f2228b2be143557f86e55c90193eea4.tar.gz
dexon-sol-tools-d1f352810f2228b2be143557f86e55c90193eea4.tar.bz2
dexon-sol-tools-d1f352810f2228b2be143557f86e55c90193eea4.tar.lz
dexon-sol-tools-d1f352810f2228b2be143557f86e55c90193eea4.tar.xz
dexon-sol-tools-d1f352810f2228b2be143557f86e55c90193eea4.tar.zst
dexon-sol-tools-d1f352810f2228b2be143557f86e55c90193eea4.zip
give some balance and allowance by default
-rw-r--r--test/exchange_wrapper_test.ts9
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);