From 40800dc957f53a5daa39f1dd35834cbd7ac15b85 Mon Sep 17 00:00:00 2001 From: Bradley Hart Date: Fri, 10 Apr 2020 13:27:30 -0400 Subject: [PATCH] Added false for shouldHash to sign() usages Adjusted Tests --- src/eosjs-jssig.ts | 2 +- src/tests/eosjs-jssig.test.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/eosjs-jssig.ts b/src/eosjs-jssig.ts index 4575498f0..a9417dc8f 100644 --- a/src/eosjs-jssig.ts +++ b/src/eosjs-jssig.ts @@ -69,7 +69,7 @@ class JsSignatureProvider implements SignatureProvider { const publicKey = PublicKey.fromString(key); const ellipticPrivateKey = this.keys.get(convertLegacyPublicKey(key)); const privateKey = PrivateKey.fromElliptic(ellipticPrivateKey, publicKey.getType()); - const signature = privateKey.sign(digest); + const signature = privateKey.sign(digest, false); signatures.push(signature.toString()); } diff --git a/src/tests/eosjs-jssig.test.ts b/src/tests/eosjs-jssig.test.ts index 13d3ab0b0..18e22011b 100644 --- a/src/tests/eosjs-jssig.test.ts +++ b/src/tests/eosjs-jssig.test.ts @@ -126,7 +126,8 @@ describe('JsSignatureProvider', () => { expect( signature.verify( digestFromSerializedData(chainId, serializedTransaction), - PublicKey.fromString(k1FormatPublicKeys[0]) + PublicKey.fromString(k1FormatPublicKeys[0]), + false ) ).toEqual(true); }); @@ -289,7 +290,8 @@ describe('JsSignatureProvider', () => { expect( signature.verify( digestFromSerializedData(chainId, serializedTransaction), - PublicKey.fromString(r1FormatPublicKeys[0]) + PublicKey.fromString(r1FormatPublicKeys[0]), + false ) ).toEqual(true); });