Skip to content

Commit

Permalink
Move consts, use named import
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoletta committed Sep 19, 2023
1 parent 5e30dcd commit 320bd74
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hints
package hint_codes

const IS_NN = "memory[ap] = 0 if 0 <= (ids.a % PRIME) < range_check_builtin.bound else 1"

Expand Down
6 changes: 3 additions & 3 deletions pkg/hints/math_cmp_hints.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package hints

import (
. "github.com/lambdaclass/cairo-vm.go/pkg/builtins"
"github.com/lambdaclass/cairo-vm.go/pkg/builtins"
. "github.com/lambdaclass/cairo-vm.go/pkg/hints/hint_utils"
. "github.com/lambdaclass/cairo-vm.go/pkg/lambdaworks"
. "github.com/lambdaclass/cairo-vm.go/pkg/vm"
Expand All @@ -14,7 +14,7 @@ func isNN(ids IdsManager, vm *VirtualMachine) error {
if err != nil {
return err
}
if a.Bits() < RANGE_CHECK_N_PARTS*INNER_RC_BOUND_SHIFT {
if a.Bits() < builtins.RANGE_CHECK_N_PARTS*builtins.INNER_RC_BOUND_SHIFT {
return vm.Segments.Memory.Insert(vm.RunContext.Ap, NewMaybeRelocatableFelt(FeltZero()))
}
return vm.Segments.Memory.Insert(vm.RunContext.Ap, NewMaybeRelocatableFelt(FeltOne()))
Expand All @@ -26,7 +26,7 @@ func isNNOutOfRange(ids IdsManager, vm *VirtualMachine) error {
if err != nil {
return err
}
if (FeltZero().Sub(a).Sub(FeltOne())).Bits() < RANGE_CHECK_N_PARTS*INNER_RC_BOUND_SHIFT {
if (FeltZero().Sub(a).Sub(FeltOne())).Bits() < builtins.RANGE_CHECK_N_PARTS*builtins.INNER_RC_BOUND_SHIFT {
return vm.Segments.Memory.Insert(vm.RunContext.Ap, NewMaybeRelocatableFelt(FeltZero()))
}
return vm.Segments.Memory.Insert(vm.RunContext.Ap, NewMaybeRelocatableFelt(FeltOne()))
Expand Down
1 change: 1 addition & 0 deletions pkg/hints/math_cmp_hints_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

. "github.com/lambdaclass/cairo-vm.go/pkg/hints"
. "github.com/lambdaclass/cairo-vm.go/pkg/hints/hint_codes"
. "github.com/lambdaclass/cairo-vm.go/pkg/hints/hint_utils"
. "github.com/lambdaclass/cairo-vm.go/pkg/lambdaworks"
. "github.com/lambdaclass/cairo-vm.go/pkg/vm"
Expand Down

0 comments on commit 320bd74

Please sign in to comment.