From 8dacebc7453469dd8cd7bcfa1b90b10d6bba56aa Mon Sep 17 00:00:00 2001 From: oleh Date: Thu, 29 Aug 2024 22:46:59 +0000 Subject: [PATCH] fix: correct size in bytes of a complete address --- .../circuits.js/src/structs/complete_address.test.ts | 5 +++++ yarn-project/circuits.js/src/structs/complete_address.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/yarn-project/circuits.js/src/structs/complete_address.test.ts b/yarn-project/circuits.js/src/structs/complete_address.test.ts index 50a7b071c9f4..2f7352b7ee09 100644 --- a/yarn-project/circuits.js/src/structs/complete_address.test.ts +++ b/yarn-project/circuits.js/src/structs/complete_address.test.ts @@ -67,4 +67,9 @@ describe('CompleteAddress', () => { expect(completeAddressFromComponents.equals(completeAddressFromString)).toBe(true); }); + + it('has correct size in bytes', () => { + const completeAddress = CompleteAddress.random(); + expect(completeAddress.toBuffer().length).toBe(CompleteAddress.SIZE_IN_BYTES); + }); }); diff --git a/yarn-project/circuits.js/src/structs/complete_address.ts b/yarn-project/circuits.js/src/structs/complete_address.ts index 31c36f15698d..a15582fb9da5 100644 --- a/yarn-project/circuits.js/src/structs/complete_address.ts +++ b/yarn-project/circuits.js/src/structs/complete_address.ts @@ -28,7 +28,7 @@ export class CompleteAddress { } /** Size in bytes of an instance */ - static readonly SIZE_IN_BYTES = 32 * 4; + static readonly SIZE_IN_BYTES = 32 * 10; static random(): CompleteAddress { return this.fromSecretKeyAndPartialAddress(Fr.random(), Fr.random());