-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add functionalities for main function inputs #681
base: main
Are you sure you want to change the base?
Changes from all commits
d7b74e6
dfd9ec8
a7814a1
83872d8
cd04099
5eb27ab
8812042
78cf788
af47a3d
73f6dd5
17b17df
688b3d2
f105506
cc82938
a32add7
07f4016
53d4190
31aeeed
086011a
fc09b66
72b3c14
ce93d4f
734d1e7
b54e9bb
fea8144
bf3a585
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ import ( | |
"fmt" | ||
|
||
h "github.com/NethermindEth/cairo-vm-go/pkg/hintrunner/hinter" | ||
"github.com/NethermindEth/cairo-vm-go/pkg/parsers/starknet" | ||
VM "github.com/NethermindEth/cairo-vm-go/pkg/vm" | ||
) | ||
|
||
|
@@ -15,19 +14,11 @@ type HintRunner struct { | |
hints map[uint64][]h.Hinter | ||
} | ||
|
||
func NewHintRunner(hints map[uint64][]h.Hinter, userArgs []starknet.CairoFuncArgs) HintRunner { | ||
context := *h.InitializeDefaultContext() | ||
if userArgs != nil { | ||
err := context.ScopeManager.AssignVariable("userArgs", userArgs) | ||
// Error handling: this condition should never be true, since the context was initialized above | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to keep this comment, because we usually shouldn't have to use panic instead of handling the error. The fact is that in this case, that line should never be reached, so the comment would be flagging that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Brought the comment back |
||
if err != nil { | ||
panic(fmt.Errorf("assign userArgs: %v", err)) | ||
} | ||
} | ||
func NewHintRunner(hints map[uint64][]h.Hinter, newHintRunnerContext *h.HintRunnerContext) HintRunner { | ||
return HintRunner{ | ||
// Context for certain hints that require it. Each manager is | ||
// initialized only when required by the hint | ||
context: context, | ||
context: *newHintRunnerContext, | ||
hints: hints, | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just confirming here, gas value is written to the execution segment, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes