Skip to content

Commit

Permalink
feat: rm test_balance_not_in_range
Browse files Browse the repository at this point in the history
  • Loading branch information
enricobottazzi committed Nov 21, 2023
1 parent d95feef commit 68ab601
Showing 1 changed file with 0 additions and 98 deletions.
98 changes: 0 additions & 98 deletions zk_prover/src/circuits/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,104 +463,6 @@ mod test {
);
}

// // Adding a balance at the verge of overflowing should fail the range check for any following computed sum and, because we are adding a fake balance.
// // Furthermore, the public input check on the root hash and on root_balances[0] should fail too
// #[test]
// fn test_balance_not_in_range() {
// let merkle_sum_tree =
// MerkleSumTree::<N_ASSETS, N_BYTES>::new("src/merkle_sum_tree/csv/entry_16.csv")
// .unwrap();

// let user_index = 0;

// let merkle_proof = merkle_sum_tree.generate_proof(user_index).unwrap();
// let user_entry = merkle_sum_tree.get_entry(user_index);

// // Only now we can instantiate the circuit with the actual inputs
// let mut circuit = MstInclusionCircuit::<LEVELS, N_ASSETS, N_BYTES>::init(
// merkle_proof,
// user_entry.clone(),
// );

// let balance = BigUint::from(2u64).pow(N_BYTES as u32 * 8) - BigUint::from(1u64);

// circuit.path_element_balances[0][0] = big_uint_to_fp(&balance); // 2^64 - 1. It means that as soon as it is summed with the other balances, it will overflow

// let invalid_prover = MockProver::run(K, &circuit, circuit.instances()).unwrap();

// assert_eq!(
// invalid_prover.verify(),
// Err(vec![
// VerifyFailure::Permutation {
// column: (Any::Fixed, 2).into(),
// location: FailureLocation::OutsideRegion { row: 351 }
// },
// VerifyFailure::Permutation {
// column: (Any::Fixed, 2).into(),
// location: FailureLocation::OutsideRegion { row: 579 }
// },
// VerifyFailure::Permutation {
// column: (Any::Fixed, 2).into(),
// location: FailureLocation::OutsideRegion { row: 807 }
// },
// VerifyFailure::Permutation {
// column: (Any::Fixed, 2).into(),
// location: FailureLocation::OutsideRegion { row: 1035 }
// },
// VerifyFailure::Permutation {
// column: (Any::advice(), 0).into(),
// location: FailureLocation::InRegion {
// region: (31, "assign value to perform range check").into(),
// offset: 14
// }
// },
// VerifyFailure::Permutation {
// column: (Any::advice(), 0).into(),
// location: FailureLocation::InRegion {
// region: (48, "assign value to perform range check").into(),
// offset: 14
// }
// },
// VerifyFailure::Permutation {
// column: (Any::advice(), 0).into(),
// location: FailureLocation::InRegion {
// region: (65, "assign value to perform range check").into(),
// offset: 14
// }
// },
// VerifyFailure::Permutation {
// column: (Any::advice(), 0).into(),
// location: FailureLocation::InRegion {
// region: (78, "permute state").into(),
// offset: 36
// }
// },
// VerifyFailure::Permutation {
// column: (Any::advice(), 0).into(),
// location: FailureLocation::InRegion {
// region: (79, "assign value to perform range check").into(),
// offset: 0
// }
// },
// VerifyFailure::Permutation {
// column: (Any::advice(), 0).into(),
// location: FailureLocation::InRegion {
// region: (79, "assign value to perform range check").into(),
// offset: 14
// }
// },
// VerifyFailure::Permutation {
// column: (Any::Instance, 0).into(),
// location: FailureLocation::OutsideRegion { row: 1 }
// },
// VerifyFailure::Permutation {
// column: (Any::Instance, 0).into(),
// location: FailureLocation::OutsideRegion { row: 2 }
// },
// ])
// );
// }

#[cfg(feature = "dev-graph")]
#[test]
fn print_mst_inclusion() {
Expand Down

0 comments on commit 68ab601

Please sign in to comment.