aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-01 07:12:21 +0800
committerFabio Berger <me@fabioberger.com>2018-06-01 07:12:21 +0800
commitfe17802cd203f4138118c65e8b783375065bf0f5 (patch)
tree0750f331b65a5aea55df9277f546ec843ee5bd0e /packages
parent368d59c3cab7677fedc12f8d6f714ee30ffa13af (diff)
downloaddexon-sol-tools-fe17802cd203f4138118c65e8b783375065bf0f5.tar.gz
dexon-sol-tools-fe17802cd203f4138118c65e8b783375065bf0f5.tar.zst
dexon-sol-tools-fe17802cd203f4138118c65e8b783375065bf0f5.zip
Rename Ecrecover to EthSign
Diffstat (limited to 'packages')
-rw-r--r--packages/contracts/src/utils/order_factory.ts2
-rw-r--r--packages/contracts/src/utils/signing_utils.ts2
-rw-r--r--packages/contracts/src/utils/transaction_factory.ts5
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);