Skip to content

Commit

Permalink
Refactor the code
Browse files Browse the repository at this point in the history
  • Loading branch information
MaksymMalicki committed Dec 16, 2024
1 parent 7753686 commit 9c4fb34
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pkg/hintrunner/hintrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,19 @@ type HintRunner struct {
}

func NewHintRunner(hints map[uint64][]h.Hinter, userArgs []starknet.CairoFuncArgs) HintRunner {
return HintRunner{
// Context for certain hints that require it. Each manager is
// initialized only when required by the hint
context: *h.SetContextWithScope(
context := *h.InitializeDefaultContext()
if userArgs != nil {
context = *h.SetContextWithScope(
map[string]any{
"userArgs": userArgs,
},
),
hints: hints,
)
}
return HintRunner{
// Context for certain hints that require it. Each manager is
// initialized only when required by the hint
context: context,
hints: hints,
}
}

Expand Down

0 comments on commit 9c4fb34

Please sign in to comment.