aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/utils
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-05-22 06:59:58 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-05-31 08:11:30 +0800
commit822e319efea9c862702ddf589eb2344ff02e5bc5 (patch)
treeae5421da5b6ac84c318ed1aa66445222be45a579 /packages/contracts/src/utils
parent6d462fc961da2ba4d5502ad6b71654c1715550d9 (diff)
downloaddexon-sol-tools-822e319efea9c862702ddf589eb2344ff02e5bc5.tar
dexon-sol-tools-822e319efea9c862702ddf589eb2344ff02e5bc5.tar.gz
dexon-sol-tools-822e319efea9c862702ddf589eb2344ff02e5bc5.tar.bz2
dexon-sol-tools-822e319efea9c862702ddf589eb2344ff02e5bc5.tar.lz
dexon-sol-tools-822e319efea9c862702ddf589eb2344ff02e5bc5.tar.xz
dexon-sol-tools-822e319efea9c862702ddf589eb2344ff02e5bc5.tar.zst
dexon-sol-tools-822e319efea9c862702ddf589eb2344ff02e5bc5.zip
Use last byte of signature as signature type
Diffstat (limited to 'packages/contracts/src/utils')
-rw-r--r--packages/contracts/src/utils/signing_utils.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/contracts/src/utils/signing_utils.ts b/packages/contracts/src/utils/signing_utils.ts
index 61ab1f138..4c36c8310 100644
--- a/packages/contracts/src/utils/signing_utils.ts
+++ b/packages/contracts/src/utils/signing_utils.ts
@@ -8,19 +8,19 @@ export const signingUtils = {
const prefixedMessage = ethUtil.hashPersonalMessage(message);
const ecSignature = ethUtil.ecsign(prefixedMessage, privateKey);
const signature = Buffer.concat([
- ethUtil.toBuffer(signatureType),
ethUtil.toBuffer(ecSignature.v),
ecSignature.r,
ecSignature.s,
+ ethUtil.toBuffer(signatureType),
]);
return signature;
} else if (signatureType === SignatureType.EIP712) {
const ecSignature = ethUtil.ecsign(message, privateKey);
const signature = Buffer.concat([
- ethUtil.toBuffer(signatureType),
ethUtil.toBuffer(ecSignature.v),
ecSignature.r,
ecSignature.s,
+ ethUtil.toBuffer(signatureType),
]);
return signature;
} else {