diff options
author | Fabio Berger <me@fabioberger.com> | 2017-06-08 22:45:50 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-06-08 22:45:50 +0800 |
commit | f25447aa3dbbad0986d6dbd414b51a4591ccbc7c (patch) | |
tree | 967b82bf9c04d72f206bcd7c62e3e47c96f02c5b /test/exchange_wrapper_test.ts | |
parent | 6e97489c1af02ad584b01f62a3eadf676cc82b2b (diff) | |
parent | 2195bc61347d6d132b6ce23ec05186c4afa4dd46 (diff) | |
download | dexon-sol-tools-f25447aa3dbbad0986d6dbd414b51a4591ccbc7c.tar dexon-sol-tools-f25447aa3dbbad0986d6dbd414b51a4591ccbc7c.tar.gz dexon-sol-tools-f25447aa3dbbad0986d6dbd414b51a4591ccbc7c.tar.bz2 dexon-sol-tools-f25447aa3dbbad0986d6dbd414b51a4591ccbc7c.tar.lz dexon-sol-tools-f25447aa3dbbad0986d6dbd414b51a4591ccbc7c.tar.xz dexon-sol-tools-f25447aa3dbbad0986d6dbd414b51a4591ccbc7c.tar.zst dexon-sol-tools-f25447aa3dbbad0986d6dbd414b51a4591ccbc7c.zip |
Merge branch 'master' into batchFillOrKill
Diffstat (limited to 'test/exchange_wrapper_test.ts')
-rw-r--r-- | test/exchange_wrapper_test.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts index 586fbac02..972354f4e 100644 --- a/test/exchange_wrapper_test.ts +++ b/test/exchange_wrapper_test.ts @@ -686,4 +686,26 @@ describe('ExchangeWrapper', () => { })(); }); }); + describe('#getOrderHashHexUsingContractCallAsync', () => { + let makerTokenAddress: string; + let takerTokenAddress: string; + let makerAddress: string; + let takerAddress: string; + const fillableAmount = new BigNumber(5); + before(async () => { + [, makerAddress, takerAddress] = userAddresses; + const [makerToken, takerToken] = tokenUtils.getNonProtocolTokens(); + makerTokenAddress = makerToken.address; + takerTokenAddress = takerToken.address; + }); + it('get\'s the same hash as the local function', async () => { + const signedOrder = await fillScenarios.createFillableSignedOrderAsync( + makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount, + ); + const orderHash = await zeroEx.getOrderHashHexAsync(signedOrder); + const orderHashFromContract = await (zeroEx.exchange as any) + .getOrderHashHexUsingContractCallAsync(signedOrder); + expect(orderHash).to.equal(orderHashFromContract); + }); + }); }); |