From 51cce6c084f44231ce6848723dfb516ecb6759af Mon Sep 17 00:00:00 2001 From: Pavel Prichodko <14926950+prichodko@users.noreply.github.com> Date: Thu, 9 Jun 2022 14:44:45 +0200 Subject: [PATCH] fix account tests --- packages/status-js/src/account.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/status-js/src/account.test.ts b/packages/status-js/src/account.test.ts index c953a55..6385a06 100644 --- a/packages/status-js/src/account.test.ts +++ b/packages/status-js/src/account.test.ts @@ -11,9 +11,12 @@ describe('Account', () => { const message = utf8ToBytes('123') const messageHash = keccak256(message) - const signature = await account.signMessage(message) + const signature = await account.sign(message) + const signatureWithoutRecoveryId = signature.slice(0, -1) - expect(secp.verify(signature, messageHash, account.publicKey)).toBeTruthy() + expect( + secp.verify(signatureWithoutRecoveryId, messageHash, account.publicKey) + ).toBeTruthy() }) it('should not verify signature with different message', async () => { @@ -22,7 +25,7 @@ describe('Account', () => { const message = utf8ToBytes('123') const messageHash = keccak256(message) - const signature = await account.signMessage(utf8ToBytes('abc')) + const signature = await account.sign(utf8ToBytes('abc')) expect(secp.verify(signature, messageHash, account.publicKey)).toBeFalsy() })