From 11363f29f0f590183602950a557e8d0fda37151f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Thu, 27 Jun 2024 00:10:03 +0200 Subject: [PATCH 1/3] fix: fix types since the public key is 34bytes --- src/sdk/keypair.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdk/keypair.ts b/src/sdk/keypair.ts index 0b461d3..5bd73a9 100644 --- a/src/sdk/keypair.ts +++ b/src/sdk/keypair.ts @@ -43,7 +43,7 @@ export const createEIP712 = { name: 'verifyingContract', type: 'address' }, ], // Refer to primaryType. - Reencrypt: [{ name: 'publicKey', type: 'bytes32' }], + Reencrypt: [{ name: 'publicKey', type: 'bytes' }], }, // This defines the message you're proposing the user to sign, is dapp-specific, and contains // anything you want. There are no required fields. Be as explicit as possible when building out From 5d29714c98eadb677792b2d0015a19e467d6424f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Thu, 27 Jun 2024 00:10:24 +0200 Subject: [PATCH 2/3] chore: bump version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e4a29a3..7cac037 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "fhevmjs", - "version": "0.5.0-13", + "version": "0.5.0-14", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "fhevmjs", - "version": "0.5.0-13", + "version": "0.5.0-14", "license": "BSD-3-Clause-Clear", "dependencies": { "@types/keccak": "^3.0.4", diff --git a/package.json b/package.json index d867682..323226c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fhevmjs", - "version": "0.5.0-13", + "version": "0.5.0-14", "description": "fhEVM SDK for blockchain using TFHE", "main": "lib/node.js", "types": "lib/node/node.d.ts", From dcae1778632c3c9b318d796cea54b22978aaf814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Thu, 27 Jun 2024 00:19:14 +0200 Subject: [PATCH 3/3] test: fix test on pk length --- src/sdk/keypair.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sdk/keypair.test.ts b/src/sdk/keypair.test.ts index 860c044..dc9bbc2 100644 --- a/src/sdk/keypair.test.ts +++ b/src/sdk/keypair.test.ts @@ -42,7 +42,7 @@ describe('token', () => { expect(eip712.primaryType).toBe('Reencrypt'); expect(eip712.types.Reencrypt.length).toBe(1); expect(eip712.types.Reencrypt[0].name).toBe('publicKey'); - expect(eip712.types.Reencrypt[0].type).toBe('bytes32'); + expect(eip712.types.Reencrypt[0].type).toBe('bytes'); }); it('create a valid EIP712 with delegated accunt', async () => { @@ -64,7 +64,7 @@ describe('token', () => { expect(eip712.primaryType).toBe('Reencrypt'); expect(eip712.types.Reencrypt.length).toBe(2); expect(eip712.types.Reencrypt[0].name).toBe('publicKey'); - expect(eip712.types.Reencrypt[0].type).toBe('bytes32'); + expect(eip712.types.Reencrypt[0].type).toBe('bytes'); expect(eip712.types.Reencrypt[1].name).toBe('delegatedAccount'); expect(eip712.types.Reencrypt[1].type).toBe('address'); });