From e72b9889fe64dab5382b1352744f7ff4ac9884a1 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:55:59 +0000 Subject: [PATCH] fix: correct size in bytes of a complete address (#10574) This PR replaces #8282 as CI won't run for PRs from forks. Co-authored-by: oleh --- .../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 ec45caaa8d9..5a2381605eb 100644 --- a/yarn-project/circuits.js/src/structs/complete_address.test.ts +++ b/yarn-project/circuits.js/src/structs/complete_address.test.ts @@ -65,4 +65,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 5fbd1132e40..a58014ea60c 100644 --- a/yarn-project/circuits.js/src/structs/complete_address.ts +++ b/yarn-project/circuits.js/src/structs/complete_address.ts @@ -30,7 +30,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 get schema() { return hexSchemaFor(CompleteAddress);