aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-06-08 22:46:58 +0800
committerGitHub <noreply@github.com>2017-06-08 22:46:58 +0800
commit3090a71e9df2c91ba44665c6b5098997669f72c3 (patch)
tree10c963e33189da758ec54640fb5ede0c9bff6867 /test
parent49d8b5b18b48604f852038662a0bb0ea598671e0 (diff)
parent2195bc61347d6d132b6ce23ec05186c4afa4dd46 (diff)
downloaddexon-sol-tools-3090a71e9df2c91ba44665c6b5098997669f72c3.tar
dexon-sol-tools-3090a71e9df2c91ba44665c6b5098997669f72c3.tar.gz
dexon-sol-tools-3090a71e9df2c91ba44665c6b5098997669f72c3.tar.bz2
dexon-sol-tools-3090a71e9df2c91ba44665c6b5098997669f72c3.tar.lz
dexon-sol-tools-3090a71e9df2c91ba44665c6b5098997669f72c3.tar.xz
dexon-sol-tools-3090a71e9df2c91ba44665c6b5098997669f72c3.tar.zst
dexon-sol-tools-3090a71e9df2c91ba44665c6b5098997669f72c3.zip
Merge branch 'master' into batchFillAsync
Diffstat (limited to 'test')
-rw-r--r--test/exchange_wrapper_test.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts
index 5cc864d12..097fafa46 100644
--- a/test/exchange_wrapper_test.ts
+++ b/test/exchange_wrapper_test.ts
@@ -677,4 +677,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);
+ });
+ });
});