From 1c42401e8aee69651dd942080ee34ce24e3c915d Mon Sep 17 00:00:00 2001 From: benesjan Date: Thu, 2 Jan 2025 15:51:21 +0000 Subject: [PATCH] zod schema fix --- yarn-project/circuit-types/src/tx/tx_hash.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/yarn-project/circuit-types/src/tx/tx_hash.ts b/yarn-project/circuit-types/src/tx/tx_hash.ts index 98a3c6ed8d2..bba7395a741 100644 --- a/yarn-project/circuit-types/src/tx/tx_hash.ts +++ b/yarn-project/circuit-types/src/tx/tx_hash.ts @@ -2,6 +2,8 @@ import { Fr } from '@aztec/circuits.js'; import { schemas } from '@aztec/foundation/schemas'; import { BufferReader } from '@aztec/foundation/serialize'; +import { z } from 'zod'; + /** * A class representing hash of Aztec transaction. */ @@ -49,7 +51,11 @@ export class TxHash { } static get schema() { - return schemas.Fr.transform(value => new TxHash(value)); + return z + .object({ + hash: schemas.Fr, + }) + .transform(({ hash }) => new TxHash(hash)); } static zero() {