diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/contracts/src/utils/order_factory.ts | 2 | ||||
-rw-r--r-- | packages/contracts/src/utils/signing_utils.ts | 2 | ||||
-rw-r--r-- | packages/contracts/src/utils/transaction_factory.ts | 5 |
3 files changed, 3 insertions, 6 deletions
diff --git a/packages/contracts/src/utils/order_factory.ts b/packages/contracts/src/utils/order_factory.ts index 59fc663f4..fc491d967 100644 --- a/packages/contracts/src/utils/order_factory.ts +++ b/packages/contracts/src/utils/order_factory.ts @@ -16,7 +16,7 @@ export class OrderFactory { } public newSignedOrder( customOrderParams: Partial<Order> = {}, - signatureType: SignatureType = SignatureType.Ecrecover, + signatureType: SignatureType = SignatureType.EthSign, ): SignedOrder { const randomExpiration = new BigNumber(Math.floor((Date.now() + Math.random() * 100000000000) / 1000)); const order = ({ diff --git a/packages/contracts/src/utils/signing_utils.ts b/packages/contracts/src/utils/signing_utils.ts index d56d2cd44..9c711c72c 100644 --- a/packages/contracts/src/utils/signing_utils.ts +++ b/packages/contracts/src/utils/signing_utils.ts @@ -3,7 +3,7 @@ import * as ethUtil from 'ethereumjs-util'; export const signingUtils = { signMessage(message: Buffer, privateKey: Buffer, signatureType: SignatureType): Buffer { - if (signatureType === SignatureType.Ecrecover) { + if (signatureType === SignatureType.EthSign) { const prefixedMessage = ethUtil.hashPersonalMessage(message); const ecSignature = ethUtil.ecsign(prefixedMessage, privateKey); const signature = Buffer.concat([ diff --git a/packages/contracts/src/utils/transaction_factory.ts b/packages/contracts/src/utils/transaction_factory.ts index f66d55f9b..434611908 100644 --- a/packages/contracts/src/utils/transaction_factory.ts +++ b/packages/contracts/src/utils/transaction_factory.ts @@ -15,10 +15,7 @@ export class TransactionFactory { this._exchangeAddress = exchangeAddress; this._signerBuff = ethUtil.privateToAddress(this._privateKey); } - public newSignedTransaction( - data: string, - signatureType: SignatureType = SignatureType.Ecrecover, - ): SignedTransaction { + public newSignedTransaction(data: string, signatureType: SignatureType = SignatureType.EthSign): SignedTransaction { const salt = generatePseudoRandomSalt(); const txHash = crypto.solSHA3([this._exchangeAddress, this._signerBuff, salt, ethUtil.toBuffer(data)]); const signature = signingUtils.signMessage(txHash, this._privateKey, signatureType); |