Skip to content

Commit

Permalink
feat: add layout class attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
zmalatrax committed Jul 25, 2024
1 parent 4b6047c commit 52c0c6f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/runners/cairoRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { CairoProgram, CairoZeroProgram, Program } from 'vm/program';
import { VirtualMachine } from 'vm/virtualMachine';
import { getBuiltin } from 'builtins/builtin';
import { Hint, Hints } from 'hints/hintSchema';
import { isSubsequence, layouts } from './layout';
import { isSubsequence, Layout, layouts } from './layout';

/**
* Configuration of the run
Expand All @@ -28,6 +28,7 @@ export type RunOptions = {

export class CairoRunner {
program: Program;
layout: Layout;
hints: Hints;
vm: VirtualMachine;
programBase: Relocatable;
Expand All @@ -53,9 +54,9 @@ export class CairoRunner {
this.programBase = this.vm.memory.addSegment();
this.executionBase = this.vm.memory.addSegment();

const layout = layouts[layoutName];
if (!isSubsequence(builtins, layout.builtins))
throw new UnorderedBuiltins(builtins, layout.builtins, layoutName);
this.layout = layouts[layoutName];
if (!isSubsequence(builtins, this.layout.builtins))
throw new UnorderedBuiltins(builtins, this.layout.builtins, layoutName);

const builtin_stack = builtins
.map(getBuiltin)
Expand Down

0 comments on commit 52c0c6f

Please sign in to comment.