Commit 05352b1
authored
feat: specify initial value for exec_scopes (#1772)
* feat: specify initial value for exec_scopes
Context: bootloader and Starknet OS support.
Added an `exec_scopes` parameter to `cairo_run_program` to pass
variables to the hints of the program being run.
We need a way to set initial variables inside the execution scopes to
pass bootloader/OS arguments. The Python VM relies on a program input file
and uses hints to deserialize this input. In most cases we do not want
to have to deserialize these input types, but rather pass them directly
as variables inside the root execution scope.
We did not extend this feature to `cairo_run` to keep the PR minimal for
discussion, TBD if it is desirable.
* changelog
* cairo_run_program_with_initial_scope
* fix: revert change to call to cairo_run_program1 parent cc9baac commit 05352b1
2 files changed
+21
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| 72 | + | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
98 | 116 | | |
99 | 117 | | |
100 | 118 | | |
| |||
0 commit comments