From 464e761053e1f84a05dbc6af2512effafa8d6350 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 8 Jun 2017 12:03:14 +0200 Subject: Add getOrderHashHexUsingContractCallAsync --- src/contract_wrappers/exchange_wrapper.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/contract_wrappers/exchange_wrapper.ts') diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index d144d8aad..9cb2332fe 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -342,6 +342,12 @@ export class ExchangeWrapper extends ContractWrapper { const orderHashHex = utils.getOrderHashHex(order, exchangeInstance.address); return orderHashHex; } + private async getOrderHashHexUsingContractCallAsync(order: Order|SignedOrder): Promise { + const exchangeInstance = await this.getExchangeContractAsync(); + const [orderAddresses, orderValues] = ExchangeWrapper.getOrderAddressesAndValues(order); + const orderHashHex = await exchangeInstance.getOrderHash.call(orderAddresses, orderValues); + return orderHashHex; + } private async stopWatchingExchangeLogEventsAsync() { const stopWatchingPromises = _.map(this.exchangeLogEventObjs, logEventObj => { return promisify(logEventObj.stopWatching, logEventObj)(); -- cgit