Skip to content

Commit 4963646

Browse files
authored
fix: add Tag.random() helper required by backported #23088 tests (#23094)
## Summary CI3 on PR #23080 failed because the backported tests in `log_service.test.ts` (from #23088) call `Tag.random()`, but the `Tag` class on `v4-next` does not yet have that static factory — it was added on `next` by #22516, which has not been backported. This adds `Tag.random()` (and switches `Fr` from a type-only import) on the v4-next branch. Mirrors the upstream definition exactly. ## Test plan - CI on PR #23080 should now pass `pxe` unit tests once this lands on `backport-to-v4-next-staging`. ClaudeBox log: https://claudebox.work/s/3be07c7bc11fd1d8?run=1
2 parents 18b40a1 + 216c87e commit 4963646

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • yarn-project/stdlib/src/logs

yarn-project/stdlib/src/logs/tag.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { poseidon2Hash } from '@aztec/foundation/crypto/poseidon';
2-
import type { Fr } from '@aztec/foundation/curves/bn254';
2+
import { Fr } from '@aztec/foundation/curves/bn254';
33
import type { ZodFor } from '@aztec/foundation/schemas';
44

55
import { schemas } from '../schemas/schemas.js';
@@ -36,6 +36,10 @@ export class Tag {
3636
return this.value.equals(other.value);
3737
}
3838

39+
static random(): Tag {
40+
return new Tag(Fr.random());
41+
}
42+
3943
static get schema(): ZodFor<Tag> {
4044
return schemas.Fr.transform((fr: Fr) => new Tag(fr));
4145
}

0 commit comments

Comments
 (0)