Skip to content

Commit

Permalink
Code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
MaksymMalicki committed Oct 25, 2024
1 parent a9800e2 commit 078c2b4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cmd/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,16 @@ func main() {
return fmt.Errorf("path to cairo file not set")
}

var hints map[uint64][]hinter.Hinter
var program *runner.Program
fmt.Printf("Loading program at %s\n", pathToFile)
zeroProgram, err := zero.ZeroProgramFromFile(pathToFile)
if err != nil {
return fmt.Errorf("cannot load program: %w", err)
}
hints, err = hintrunner.GetZeroHints(zeroProgram)
hints, err := hintrunner.GetZeroHints(zeroProgram)
if err != nil {
return fmt.Errorf("cannot create hints: %w", err)
}
program, err = runner.LoadCairoZeroProgram(zeroProgram)
program, err := runner.LoadCairoZeroProgram(zeroProgram)
if err != nil {
return fmt.Errorf("cannot load program: %w", err)
}
Expand Down Expand Up @@ -202,17 +200,15 @@ func main() {
return fmt.Errorf("path to cairo file not set")
}

var hints map[uint64][]hinter.Hinter
var program *runner.Program
cairoProgram, err := starknet.StarknetProgramFromFile(pathToFile)
if err != nil {
return fmt.Errorf("cannot load program: %w", err)
}
hints, err = core.GetCairoHints(cairoProgram)
hints, err := core.GetCairoHints(cairoProgram)
if err != nil {
return fmt.Errorf("cannot get hints: %w", err)
}
program, err = runner.LoadCairoProgram(cairoProgram)
program, err := runner.LoadCairoProgram(cairoProgram)
if err != nil {
return fmt.Errorf("cannot load program: %w", err)
}
Expand Down

0 comments on commit 078c2b4

Please sign in to comment.