diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-01 07:12:21 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-01 07:12:21 +0800 |
commit | fe17802cd203f4138118c65e8b783375065bf0f5 (patch) | |
tree | 0750f331b65a5aea55df9277f546ec843ee5bd0e /packages/contracts | |
parent | 368d59c3cab7677fedc12f8d6f714ee30ffa13af (diff) | |
download | dexon-sol-tools-fe17802cd203f4138118c65e8b783375065bf0f5.tar dexon-sol-tools-fe17802cd203f4138118c65e8b783375065bf0f5.tar.gz dexon-sol-tools-fe17802cd203f4138118c65e8b783375065bf0f5.tar.bz2 dexon-sol-tools-fe17802cd203f4138118c65e8b783375065bf0f5.tar.lz dexon-sol-tools-fe17802cd203f4138118c65e8b783375065bf0f5.tar.xz dexon-sol-tools-fe17802cd203f4138118c65e8b783375065bf0f5.tar.zst dexon-sol-tools-fe17802cd203f4138118c65e8b783375065bf0f5.zip |
Rename Ecrecover to EthSign
Diffstat (limited to 'packages/contracts')
-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); |