Skip to content

Commit

Permalink
Revert "Integration test for Is_Zero (#494)"
Browse files Browse the repository at this point in the history
This reverts commit b5dac4c.
  • Loading branch information
Sh0g0-1758 committed Jun 28, 2024
1 parent b5dac4c commit 83ca35c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
python-version: '3.9'

- name: Install cairo-lang
run: pip install cairo-lang==0.13.1
run: pip install cairo-lang==0.11

- name: Build
run: make build
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Set to run some specific file tests (ex. fib.cairo,alloc.cairo)
INTEGRATION_TESTS_FILTERS=is_zero.small.cairo
INTEGRATION_TESTS_FILTERS=
31 changes: 0 additions & 31 deletions integration_tests/cairo_zero_hint_tests/is_zero.small.cairo

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/hintrunner/zero/hintcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ ids.multiplicities = segments.gen_arg([len(positions_dict[k]) for k in output])`
ecDoubleAssignNewXV1Code string = "from starkware.cairo.common.cairo_secp.secp_utils import SECP_P, pack\n\nslope = pack(ids.slope, PRIME)\nx = pack(ids.point.x, PRIME)\ny = pack(ids.point.y, PRIME)\n\nvalue = new_x = (pow(slope, 2, SECP_P) - 2 * x) % SECP_P"
ecDoubleAssignNewYV1Code string = "value = new_y = (slope * (x - new_x) - y) % SECP_P"
ecMulInnerCode string = "memory[ap] = (ids.scalar % PRIME) % 2"
isZeroNondetCode string = "memory[ap] = to_felt_or_relocatable(x == 0)"
isZeroNondetCode string = "x == 0"
isZeroPackCode string = "from starkware.cairo.common.cairo_secp.secp_utils import SECP_P, pack\n\nx = pack(ids.x, PRIME) % SECP_P"
isZeroDivModCode string = "from starkware.cairo.common.cairo_secp.secp_utils import SECP_P\nfrom starkware.python.math_utils import div_mod\n\nvalue = x_inv = div_mod(1, x, SECP_P)"

Expand Down
7 changes: 2 additions & 5 deletions pkg/hintrunner/zero/zerohint_ec.go
Original file line number Diff line number Diff line change
Expand Up @@ -736,10 +736,9 @@ func createEcMulInnerHinter(resolver hintReferenceResolver) (hinter.Hinter, erro
// i.e, 1 if `x == 0`, 0 otherwise
func newIsZeroNondetHint() hinter.Hinter {
return &GenericZeroHinter{
Name: "IsZeroNondet",
Name: "IsZeroConditional",
Op: func(vm *VM.VirtualMachine, ctx *hinter.HintRunnerContext) error {
//> python hint in cairo file: "x == 0"
//> compiled file hint: "memory[ap] = to_felt_or_relocatable(x == 0)"
//> x == 0

x, err := ctx.ScopeManager.GetVariableValueAsBigInt("x")
if err != nil {
Expand Down Expand Up @@ -776,7 +775,6 @@ func newIsZeroPackHint(x hinter.ResOperander) hinter.Hinter {
Name: "IsZeroPack",
Op: func(vm *VM.VirtualMachine, ctx *hinter.HintRunnerContext) error {
//> from starkware.cairo.common.cairo_secp.secp_utils import SECP_P, pack

//> x = pack(ids.x, PRIME) % SECP_P

xAddr, err := x.GetAddress(vm)
Expand Down Expand Up @@ -831,7 +829,6 @@ func newIsZeroDivModHint() hinter.Hinter {
Op: func(vm *VM.VirtualMachine, ctx *hinter.HintRunnerContext) error {
//> from starkware.cairo.common.cairo_secp.secp_utils import SECP_P
//> from starkware.python.math_utils import div_mod

//> value = x_inv = div_mod(1, x, SECP_P)

secPBig, ok := secp_utils.GetSecPBig()
Expand Down

0 comments on commit 83ca35c

Please sign in to comment.