diff options
Diffstat (limited to 'packages/order-utils/src/order_hash.ts')
-rw-r--r-- | packages/order-utils/src/order_hash.ts | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/packages/order-utils/src/order_hash.ts b/packages/order-utils/src/order_hash.ts index b2414febc..46cce4b3b 100644 --- a/packages/order-utils/src/order_hash.ts +++ b/packages/order-utils/src/order_hash.ts @@ -75,24 +75,7 @@ export const orderHashUtils = { * @return The resulting orderHash from hashing the supplied order as a Buffer */ getOrderHashBuffer(order: SignedOrder | Order): Buffer { - const makerAssetDataHash = crypto.solSHA3([ethUtil.toBuffer(order.makerAssetData)]); - const takerAssetDataHash = crypto.solSHA3([ethUtil.toBuffer(order.takerAssetData)]); - - const orderParamsHashBuff = crypto.solSHA3([ - orderHashUtils._getOrderSchemaBuffer(), - EIP712Utils.pad32Address(order.makerAddress), - EIP712Utils.pad32Address(order.takerAddress), - EIP712Utils.pad32Address(order.feeRecipientAddress), - EIP712Utils.pad32Address(order.senderAddress), - order.makerAssetAmount, - order.takerAssetAmount, - order.makerFee, - order.takerFee, - order.expirationTimeSeconds, - order.salt, - makerAssetDataHash, - takerAssetDataHash, - ]); + const orderParamsHashBuff = EIP712Utils.structHash(EIP712_ORDER_SCHEMA, order); const orderHashBuff = EIP712Utils.createEIP712Message(orderParamsHashBuff, order.exchangeAddress); return orderHashBuff; }, |