From 49f6c20b200edf353856af4940bf946ea33869fc Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Thu, 8 Mar 2018 10:42:06 -0800 Subject: Update order utils --- packages/contracts/src/utils/order_utils.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'packages') diff --git a/packages/contracts/src/utils/order_utils.ts b/packages/contracts/src/utils/order_utils.ts index 513d0087e..c14dc4e80 100644 --- a/packages/contracts/src/utils/order_utils.ts +++ b/packages/contracts/src/utils/order_utils.ts @@ -53,8 +53,7 @@ export const orderUtils = { 'uint256 expirationTimeSeconds', 'uint256 salt', ]); - const orderSchemaHashHex = `0x${orderSchemaHashBuff.toString('hex')}`; - const orderHashBuff = crypto.solSHA3([ + const orderParamsHashBuff = crypto.solSHA3([ order.exchangeAddress, order.makerAddress, order.takerAddress, @@ -68,9 +67,10 @@ export const orderUtils = { order.expirationTimeSeconds, order.salt, ]); - const orderHashHex = `0x${orderHashBuff.toString('hex')}`; - const prefixedOrderHashBuff = crypto.solSHA3([new BigNumber(orderSchemaHashHex), new BigNumber(orderHashHex)]); - return prefixedOrderHashBuff; + const orderSchemaHashHex = `0x${orderSchemaHashBuff.toString('hex')}`; + const orderParamsHashHex = `0x${orderParamsHashBuff.toString('hex')}`; + const orderHashBuff = crypto.solSHA3([new BigNumber(orderSchemaHashHex), new BigNumber(orderParamsHashHex)]); + return orderHashBuff; }, getOrderHashHex(order: SignedOrder | UnsignedOrder): string { const orderHashBuff = orderUtils.getOrderHashBuff(order); -- cgit v1.2.3