diff --git a/src/hints/allocSegment.test.ts b/src/hints/allocSegment.test.ts index 9cff75b2..71ef19f0 100644 --- a/src/hints/allocSegment.test.ts +++ b/src/hints/allocSegment.test.ts @@ -4,7 +4,7 @@ import { Relocatable } from 'primitives/relocatable'; import { Register } from 'vm/instruction'; import { VirtualMachine } from 'vm/virtualMachine'; import { HintName } from 'hints/hintName'; -import { allocSegmentZod } from './allocSegment'; +import { allocSegmentParser } from './allocSegment'; const ALLOC_SEGMENT = { AllocSegment: { @@ -17,7 +17,7 @@ const ALLOC_SEGMENT = { describe('AllocSegment', () => { test('should properly parse AllocSegment hint', () => { - const hint = allocSegmentZod.parse(ALLOC_SEGMENT); + const hint = allocSegmentParser.parse(ALLOC_SEGMENT); expect(hint).toEqual({ type: HintName.AllocSegment, dst: { @@ -28,7 +28,7 @@ describe('AllocSegment', () => { }); test('should properly execute AllocSegment hint', () => { - const hint = allocSegmentZod.parse(ALLOC_SEGMENT); + const hint = allocSegmentParser.parse(ALLOC_SEGMENT); const vm = new VirtualMachine(); vm.memory.addSegment(); vm.memory.addSegment(); diff --git a/src/hints/allocSegment.ts b/src/hints/allocSegment.ts index 57c0bb2a..d6be40c0 100644 --- a/src/hints/allocSegment.ts +++ b/src/hints/allocSegment.ts @@ -5,7 +5,7 @@ import { cellRef, CellRef } from 'hints/hintParamsSchema'; import { HintName } from 'hints/hintName'; /** Zod object to parse AllocSegment hint */ -export const allocSegmentZod = z +export const allocSegmentParser = z .object({ AllocSegment: z.object({ dst: cellRef }) }) .transform(({ AllocSegment: { dst } }) => ({ type: HintName.AllocSegment, @@ -17,7 +17,7 @@ export const allocSegmentZod = z * * Add a new segment and store its pointer to `dst` */ -export type AllocSegment = z.infer; +export type AllocSegment = z.infer; /** * Add a new segment and store its pointer at `dst` diff --git a/src/hints/hintSchema.ts b/src/hints/hintSchema.ts index 7d9ef107..6a4899eb 100644 --- a/src/hints/hintSchema.ts +++ b/src/hints/hintSchema.ts @@ -1,10 +1,10 @@ import { z } from 'zod'; -import { allocSegmentZod } from './allocSegment'; -import { testLessThanZod } from './testLessThan'; +import { allocSegmentParser } from './allocSegment'; +import { testLessThanParser } from './testLessThan'; /** Zod object to parse any implemented hints */ -const hint = z.union([allocSegmentZod, testLessThanZod]); +const hint = z.union([allocSegmentParser, testLessThanParser]); /** Zod object to parse an array of hints grouped on a given PC */ export const hintsGroup = z.tuple([z.number(), z.array(hint)]); diff --git a/src/hints/testLessThan.test.ts b/src/hints/testLessThan.test.ts index 5044d02b..66c17ea5 100644 --- a/src/hints/testLessThan.test.ts +++ b/src/hints/testLessThan.test.ts @@ -5,7 +5,7 @@ import { Register } from 'vm/instruction'; import { VirtualMachine } from 'vm/virtualMachine'; import { OpType } from 'hints/hintParamsSchema'; import { HintName } from 'hints/hintName'; -import { testLessThanZod } from './testLessThan'; +import { testLessThanParser } from './testLessThan'; const TEST_LESS_THAN = { TestLessThan: { @@ -27,7 +27,7 @@ const TEST_LESS_THAN = { describe('TestLessThan', () => { test('should properly parse TestLessThan hint', () => { - const hint = testLessThanZod.parse(TEST_LESS_THAN); + const hint = testLessThanParser.parse(TEST_LESS_THAN); expect(hint).toEqual({ type: HintName.TestLessThan, @@ -53,7 +53,7 @@ describe('TestLessThan', () => { [new Felt(-2n), new Felt(0n)], [new Felt(2n), new Felt(1n)], ])('should properly execute TestLessThan hint', (lhs, expected) => { - const hint = testLessThanZod.parse(TEST_LESS_THAN); + const hint = testLessThanParser.parse(TEST_LESS_THAN); const vm = new VirtualMachine(); vm.memory.addSegment(); vm.memory.addSegment(); diff --git a/src/hints/testLessThan.ts b/src/hints/testLessThan.ts index 08f4b49f..95e478da 100644 --- a/src/hints/testLessThan.ts +++ b/src/hints/testLessThan.ts @@ -6,7 +6,7 @@ import { cellRef, resOp, CellRef, ResOp } from 'hints/hintParamsSchema'; import { HintName } from 'hints/hintName'; /** Zod object to parse TestLessThan hint */ -export const testLessThanZod = z +export const testLessThanParser = z .object({ TestLessThan: z.object({ lhs: resOp, rhs: resOp, dst: cellRef }), }) @@ -23,7 +23,7 @@ export const testLessThanZod = z * Store true at `dst` if value at `lhs` is stricty inferior to value at `rhs`. * Store false otherwise */ -export type TestLessThan = z.infer; +export type TestLessThan = z.infer; /** * TestLessThan hint