aboutsummaryrefslogtreecommitdiffstats
path: root/test/exchange_wrapper_test.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-22 06:16:35 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-22 06:16:35 +0800
commitd088dcdd36ddab32568bd8b71fb59cb59e52acc2 (patch)
treeddaec72d9246f6a6584d7a02612e3ef8dd7b75f5 /test/exchange_wrapper_test.ts
parent7b471858fa78d6f4f7116c198490a83f6e1ddd35 (diff)
downloaddexon-sol-tools-d088dcdd36ddab32568bd8b71fb59cb59e52acc2.tar
dexon-sol-tools-d088dcdd36ddab32568bd8b71fb59cb59e52acc2.tar.gz
dexon-sol-tools-d088dcdd36ddab32568bd8b71fb59cb59e52acc2.tar.bz2
dexon-sol-tools-d088dcdd36ddab32568bd8b71fb59cb59e52acc2.tar.lz
dexon-sol-tools-d088dcdd36ddab32568bd8b71fb59cb59e52acc2.tar.xz
dexon-sol-tools-d088dcdd36ddab32568bd8b71fb59cb59e52acc2.tar.zst
dexon-sol-tools-d088dcdd36ddab32568bd8b71fb59cb59e52acc2.zip
Add simple test checking that fillOrderAsync return filled amount
Diffstat (limited to 'test/exchange_wrapper_test.ts')
-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 6425e308a..cda2d4435 100644
--- a/test/exchange_wrapper_test.ts
+++ b/test/exchange_wrapper_test.ts
@@ -344,6 +344,16 @@ describe('ExchangeWrapper', () => {
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
);
const partialFillAmount = new BigNumber(3);
+ const filledAmount = await zeroEx.exchange.fillOrderAsync(
+ signedOrder, partialFillAmount, shouldCheckTransfer, takerAddress);
+ expect(filledAmount).to.be.bignumber.equal(partialFillAmount);
+ });
+ it('should return the partially filled amount \
+ if the fill amount specified is greater then the amount available', async () => {
+ const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
+ makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
+ );
+ const partialFillAmount = new BigNumber(3);
await zeroEx.exchange.fillOrderAsync(
signedOrder, partialFillAmount, shouldCheckTransfer, takerAddress);
const missingBalance = new BigNumber(1);