Add shouldAddPersonalMessagePrefix param to signOrderHashAsync instead of trying to infer whether to add it or not from the nodeVersion

This commit is contained in:
Fabio Berger
2018-01-30 12:38:44 +01:00
parent ad52a82190
commit 1cadbeed88
5 changed files with 44 additions and 21 deletions

View File

@@ -3,6 +3,8 @@ import * as _ from 'lodash';
import { SignedOrder, ZeroEx } from '../../src';
const SHOULD_ADD_PERSONAL_MESSAGE_PREFIX = false;
export const orderFactory = {
async createSignedOrderAsync(
zeroEx: ZeroEx,
@@ -37,7 +39,7 @@ export const orderFactory = {
expirationUnixTimestampSec,
};
const orderHash = ZeroEx.getOrderHashHex(order);
const ecSignature = await zeroEx.signOrderHashAsync(orderHash, maker);
const ecSignature = await zeroEx.signOrderHashAsync(orderHash, maker, SHOULD_ADD_PERSONAL_MESSAGE_PREFIX);
const signedOrder: SignedOrder = _.assign(order, { ecSignature });
return signedOrder;
},