Skip to content

Commit 2123fc7

Browse files
Update src/oracle_tests.nr
Co-authored-by: Tom French <[email protected]>
1 parent 55751c4 commit 2123fc7

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/oracle_tests.nr

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@ unconstrained fn get_poseidon2_hash(input: [Field; 10]) -> Field {
88
poseidon2_hash_oracle(input)
99
}
1010

11-
unconstrained fn test_poseidon2_comparison(input: [Field; 10]) -> bool {
12-
// get hash from Noir implementation
11+
#[test]
12+
unconstrained fn test_poseidon2(input: [Field; 10]) {
13+
// get hash from Noir implementation
1314
let noir_hash = poseidon2::Poseidon2::hash(input, input.len());
1415

1516
// get hash from bb.js via oracle
1617
let bb_hash = get_poseidon2_hash(input);
1718

18-
noir_hash == bb_hash
19-
}
20-
21-
#[test]
22-
unconstrained fn test_poseidon2(input: [Field; 10]) {
23-
let result = test_poseidon2_comparison(input);
24-
25-
assert(result);
19+
assert_eq(noir_hash, bb_hash)
2620
}

0 commit comments

Comments
 (0)