aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-01 23:56:01 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-01 23:56:01 +0800
commit389c18e98e2b5663b1732d7c34f9b21afef66e44 (patch)
tree26df8de1c8244927b178af4f997212140b99dda4 /test
parent19e922724e963950c97c009def39019b382fb516 (diff)
downloaddexon-sol-tools-389c18e98e2b5663b1732d7c34f9b21afef66e44.tar
dexon-sol-tools-389c18e98e2b5663b1732d7c34f9b21afef66e44.tar.gz
dexon-sol-tools-389c18e98e2b5663b1732d7c34f9b21afef66e44.tar.bz2
dexon-sol-tools-389c18e98e2b5663b1732d7c34f9b21afef66e44.tar.lz
dexon-sol-tools-389c18e98e2b5663b1732d7c34f9b21afef66e44.tar.xz
dexon-sol-tools-389c18e98e2b5663b1732d7c34f9b21afef66e44.tar.zst
dexon-sol-tools-389c18e98e2b5663b1732d7c34f9b21afef66e44.zip
Add test to check the balance
Diffstat (limited to 'test')
-rw-r--r--test/exchange_wrapper_test.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts
index ad5eba699..6b2fd6477 100644
--- a/test/exchange_wrapper_test.ts
+++ b/test/exchange_wrapper_test.ts
@@ -154,6 +154,16 @@ describe('ExchangeWrapper', () => {
expect(zeroEx.exchange.fillOrderAsync(signedOrder, fillAmount, shouldCheckTransfer))
.to.be.rejectedWith(FillOrderValidationErrs.EXPIRED);
});
+ it('should throw when not enough balance', async () => {
+ const makerAmount = 10;
+ const takerAmount = 10;
+ const signedOrder = await orderFactory.createSignedOrderAsync(zeroEx, maker, taker,
+ makerAmount, addressBySymbol.MLN, takerAmount, addressBySymbol.GNT);
+ zeroEx.setDefaultAccount(taker);
+ const tooMuch = new BigNumber(6);
+ expect(zeroEx.exchange.fillOrderAsync(signedOrder, tooMuch, true))
+ .to.be.rejectedWith(FillOrderValidationErrs.EXPIRED);
+ });
});
describe('successful fills', () => {
it('should fill the valid order', async () => {