Skip to content

Commit

Permalink
simpler schema
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Jan 2, 2025
1 parent 6d9067a commit 2c021b7
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions yarn-project/circuit-types/src/tx/tx_hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ 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 @@ -51,11 +49,7 @@ export class TxHash {
}

static get schema() {
return z
.object({
hash: schemas.Fr,
})
.transform(({ hash }) => new TxHash(hash));
return schemas.BufferHex.transform(value => new TxHash(Fr.fromBuffer(value)));
}

static zero() {
Expand Down

0 comments on commit 2c021b7

Please sign in to comment.