From fe17802cd203f4138118c65e8b783375065bf0f5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 31 May 2018 16:12:21 -0700 Subject: Rename Ecrecover to EthSign --- packages/contracts/src/utils/order_factory.ts | 2 +- packages/contracts/src/utils/signing_utils.ts | 2 +- packages/contracts/src/utils/transaction_factory.ts | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'packages/contracts') 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 = {}, - 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); -- cgit v1.2.3