diff options
author | Fabio Berger <me@fabioberger.com> | 2018-11-09 07:45:48 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-11-09 07:45:48 +0800 |
commit | 857a35d4f71c1c954033c3b0505250e18be21cfb (patch) | |
tree | 47dc81508fe8d71b0c0acfcd24b36fa8455c6ae6 /packages/contract-wrappers/test | |
parent | 8b06b3627426c3f9eda3262d0b6479d55cc4c9ad (diff) | |
download | dexon-sol-tools-857a35d4f71c1c954033c3b0505250e18be21cfb.tar dexon-sol-tools-857a35d4f71c1c954033c3b0505250e18be21cfb.tar.gz dexon-sol-tools-857a35d4f71c1c954033c3b0505250e18be21cfb.tar.bz2 dexon-sol-tools-857a35d4f71c1c954033c3b0505250e18be21cfb.tar.lz dexon-sol-tools-857a35d4f71c1c954033c3b0505250e18be21cfb.tar.xz dexon-sol-tools-857a35d4f71c1c954033c3b0505250e18be21cfb.tar.zst dexon-sol-tools-857a35d4f71c1c954033c3b0505250e18be21cfb.zip |
Fix validateOrderFillableOrThrowAsync method so it also checks order signature, cancelled, cancelledUpTo, and throws helpful error messages
Diffstat (limited to 'packages/contract-wrappers/test')
-rw-r--r-- | packages/contract-wrappers/test/exchange_wrapper_test.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/contract-wrappers/test/exchange_wrapper_test.ts b/packages/contract-wrappers/test/exchange_wrapper_test.ts index 0e537bd83..8058be873 100644 --- a/packages/contract-wrappers/test/exchange_wrapper_test.ts +++ b/packages/contract-wrappers/test/exchange_wrapper_test.ts @@ -282,6 +282,18 @@ describe('ExchangeWrapper', () => { expect(ordersInfo[1].orderHash).to.be.equal(anotherOrderHash); }); }); + describe('#validateOrderFillableOrThrowAsync', () => { + it('should throw if signature is invalid', async () => { + const signedOrderWithInvalidSignature = { + ...signedOrder, + signature: '0xdeadbeef', + }; + + expect( + contractWrappers.exchange.validateOrderFillableOrThrowAsync(signedOrderWithInvalidSignature), + ).to.eventually.to.be.rejected(); + }); + }); describe('#isValidSignature', () => { it('should check if the signature is valid', async () => { const orderHash = orderHashUtils.getOrderHashHex(signedOrder); |