diff options
author | Leonid <logvinov.leon@gmail.com> | 2017-06-08 22:51:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-08 22:51:25 +0800 |
commit | 0b5abb29a9ab8f2fda5bc37980c3e40296cf7696 (patch) | |
tree | 28c1e21bd631c8327d4da57971d2ff15ba20797e /test | |
parent | 196130ff96cd20bd13c7bada0ba5eb8d62a2cdc5 (diff) | |
parent | 2195bc61347d6d132b6ce23ec05186c4afa4dd46 (diff) | |
download | dexon-sol-tools-0b5abb29a9ab8f2fda5bc37980c3e40296cf7696.tar dexon-sol-tools-0b5abb29a9ab8f2fda5bc37980c3e40296cf7696.tar.gz dexon-sol-tools-0b5abb29a9ab8f2fda5bc37980c3e40296cf7696.tar.bz2 dexon-sol-tools-0b5abb29a9ab8f2fda5bc37980c3e40296cf7696.tar.lz dexon-sol-tools-0b5abb29a9ab8f2fda5bc37980c3e40296cf7696.tar.xz dexon-sol-tools-0b5abb29a9ab8f2fda5bc37980c3e40296cf7696.tar.zst dexon-sol-tools-0b5abb29a9ab8f2fda5bc37980c3e40296cf7696.zip |
Merge branch 'master' into interfaceTweaks
Diffstat (limited to 'test')
-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 08936f1d2..6fef91946 100644 --- a/test/exchange_wrapper_test.ts +++ b/test/exchange_wrapper_test.ts @@ -661,4 +661,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); + }); + }); }); |