-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add layout option to CLI * feat: add short flags for layout and function options in CLI * chore: add JSDoc CairoRunner errors * feat: add builtins validation against layout * refactor: refactor layout names array * fix: filter invalid builtins * refactor: use includes method * refactor: use a single error for builtin validation * feat: add layout class attribute * refactor: rename UnorderedBuiltins to InvalidBuiltins * feat: add test on CairoRunner builtin validation against layout * refactor: remove needles variables in builtins validation tests * refactor: simplify isSubsequence to a recursive version * feat: add builtin segment getter from name * feat: add ratio * refactor: remove entrypoint attribute in CairoRunner * doc: check run Cairo programs box * chore: remove Cairo program with arguments * chore: update cairo vm zig * chore: add Cairo programs to run-all target * feat: add validation of allowed builtins not in layout (segment_arena, gas, system) * chore: add more cases to layout builtin validation * chore: update JSDoc getOutput * chore: add JSDoc * doc: improve Layout JSDoc for clarity
- Loading branch information
Showing
11 changed files
with
677 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,37 @@ | ||
class CairoRunnerError extends Error {} | ||
|
||
/** The relocated memory is empty. It cannot be exported. */ | ||
export class EmptyRelocatedMemory extends CairoRunnerError { | ||
constructor() { | ||
super('Relocated memory is empty'); | ||
} | ||
} | ||
|
||
/** The Cairo Zero hints are not supported. */ | ||
export class CairoZeroHintsNotSupported extends CairoRunnerError { | ||
constructor() { | ||
super('Cairo Zero hints are not supported yet.'); | ||
} | ||
} | ||
|
||
export class CairoOutputNotSupported extends CairoRunnerError { | ||
constructor() { | ||
super('The output serialization of Cairo programs is not supported yet.'); | ||
} | ||
} | ||
|
||
/** The given entrypoint is not in the program, it cannot be executed. */ | ||
export class UndefinedEntrypoint extends CairoRunnerError { | ||
constructor(name: string) { | ||
super(`The function to be executed doesn't exist: ${name}`); | ||
} | ||
} | ||
|
||
/** The program builtins are not a subsequence of the builtins available in the chosen layout. */ | ||
export class InvalidBuiltins extends CairoRunnerError { | ||
constructor( | ||
programBuiltins: string[], | ||
layoutBuiltins: string[], | ||
layout: string | ||
) { | ||
super( | ||
`The program builtins are not a subsequence of the '${layout}' layout builtins. | ||
Program builtins: ${programBuiltins.join(', ')} | ||
Layout builtins: ${layoutBuiltins.join(', ')}` | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.