Skip to content

Commit

Permalink
zod schema fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Jan 2, 2025
1 parent da2fd37 commit 1c42401
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion yarn-project/circuit-types/src/tx/tx_hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 1c42401

Please sign in to comment.