-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bug fix * Added integration test and fixed hintcode * clean * bug fix * Updated hint comments * Ran gofmt * Update is_zero.small.cairo * Bug Fix * Comment update * Update .env * Bump cairo-lang version * Updated test
- Loading branch information
1 parent
45da4d0
commit b5dac4c
Showing
5 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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= | ||
INTEGRATION_TESTS_FILTERS=is_zero.small.cairo |
31 changes: 31 additions & 0 deletions
31
integration_tests/cairo_zero_hint_tests/is_zero.small.cairo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Returns 1 if x == 0 (mod secp256k1_prime), and 0 otherwise. | ||
// Serves as integration test for the following hints : | ||
// isZeroNondetCode | ||
// isZeroPackCode | ||
// isZeroDivModCode | ||
|
||
%builtins range_check | ||
|
||
from starkware.cairo.common.cairo_secp.field import is_zero, SumBigInt3 | ||
|
||
func main{range_check_ptr}() -> () { | ||
|
||
// Test One | ||
let a = SumBigInt3(0, 0, 0); | ||
let (res: felt) = is_zero(a); | ||
assert res = 1; | ||
|
||
// Test Two | ||
let b = SumBigInt3(42, 0, 0); | ||
let (res: felt) = is_zero(b); | ||
assert res = 0; | ||
|
||
// Test Three | ||
let c = SumBigInt3( | ||
77371252455336262886226991, 77371252455336267181195263, 19342813113834066795298815 | ||
); | ||
let (res: felt) = is_zero(c); | ||
assert res = 1; | ||
|
||
return (); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters