diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-22 20:00:41 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-22 20:00:41 +0800 |
commit | beb483ea85ca0df707e81883d612125be1968389 (patch) | |
tree | 9b9a043b2225cb980fa04d0be8a8040147a8b5df /packages/0x.js/test | |
parent | 46b7fecafe283e814e2088373ec857747e4cf314 (diff) | |
parent | 8478dc8d6d05efcdeac6653872f35149f3c9589c (diff) | |
download | dexon-sol-tools-beb483ea85ca0df707e81883d612125be1968389.tar.gz dexon-sol-tools-beb483ea85ca0df707e81883d612125be1968389.tar.zst dexon-sol-tools-beb483ea85ca0df707e81883d612125be1968389.zip |
Merge branch 'development' into addExtraDocs
* development:
Change blockchain prop to not optional
Other style changes
Updated padding and colors
Refactor TokenState type
Fix a bug causing fillOrdersUpTo validation to fail because of some extra orders being passed
Implement initial wallet interface
# Conflicts:
# packages/react-shared/CHANGELOG.md
# packages/website/ts/types.ts
Diffstat (limited to 'packages/0x.js/test')
-rw-r--r-- | packages/0x.js/test/exchange_wrapper_test.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/0x.js/test/exchange_wrapper_test.ts b/packages/0x.js/test/exchange_wrapper_test.ts index 0a4ea608d..cfc390bae 100644 --- a/packages/0x.js/test/exchange_wrapper_test.ts +++ b/packages/0x.js/test/exchange_wrapper_test.ts @@ -596,6 +596,19 @@ describe('ExchangeWrapper', () => { const remainingFillAmount = fillableAmount.minus(1); expect(anotherFilledAmount).to.be.bignumber.equal(remainingFillAmount); }); + it('should successfully fill up to specified amount and leave the rest of the orders untouched', async () => { + const txHash = await zeroEx.exchange.fillOrdersUpToAsync( + signedOrders, + fillableAmount, + shouldThrowOnInsufficientBalanceOrAllowance, + takerAddress, + ); + await zeroEx.awaitTransactionMinedAsync(txHash); + const filledAmount = await zeroEx.exchange.getFilledTakerAmountAsync(signedOrderHashHex); + const zeroAmount = await zeroEx.exchange.getFilledTakerAmountAsync(anotherOrderHashHex); + expect(filledAmount).to.be.bignumber.equal(fillableAmount); + expect(zeroAmount).to.be.bignumber.equal(0); + }); it('should successfully fill up to specified amount even if filling all orders would fail', async () => { const missingBalance = new BigNumber(1); // User will still have enough balance to fill up to 9, // but won't have 10 to fully fill all orders in a batch. |