Skip to content

Commit

Permalink
case 4
Browse files Browse the repository at this point in the history
  • Loading branch information
rkdud007 committed Apr 14, 2024
1 parent 3056e1c commit 06e0b24
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
17 changes: 17 additions & 0 deletions csv/entry_16_overflow_case_4.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
username,balance_ETH_ETH,balance_USDT_ETH
dxGaEAii,18446744073709551616,18446744073709551616
MBlfbBGI,18446744073709551616,18446744073709551616
lAhWlEWZ,18446744073709551616,18446744073709551616
nuZweYtO,18446744073709551616,18446744073709551616
gbdSwiuY,18446744073709551616,18446744073709551616
RZNneNuP,18446744073709551616,18446744073709551616
YsscHXkp,18446744073709551616,18446744073709551616
RkLzkDun,18446744073709551616,18446744073709551616
HlQlnEYI,18446744073709551616,18446744073709551616
RqkZOFYe,18446744073709551616,18446744073709551616
NjCSRAfD,18446744073709551616,18446744073709551616
pHniJMQY,18446744073709551616,18446744073709551616
dOGIMzKR,18446744073709551616,18446744073709551616
HfMDmNLp,18446744073709551616,18446744073709551616
xPLKzCBl,18446744073709551616,18446744073709551616
AtwIxZHo,18446744073709551616,18446744073709551616
20 changes: 20 additions & 0 deletions prover/src/circuits/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,26 @@ mod test {
);
}

#[test]
fn test_balance_not_in_range_case_4() {
// Case 4: every balance out of range
let path = "../csv/entry_16_overflow_case_4.csv";

let mut entries: Vec<Entry<N_CURRENCIES>> = vec![Entry::init_empty(); N_USERS];
let mut cryptos = vec![Cryptocurrency::init_empty(); N_CURRENCIES];
parse_csv_to_entries::<&str, N_CURRENCIES>(path, &mut entries, &mut cryptos).unwrap();

let circuit = UnivariateGrandSum::<
N_USERS,
N_CURRENCIES,
UnivariateGrandSumConfig<N_CURRENCIES, N_USERS>,
>::init(entries.to_vec());

let invalid_prover = MockProver::run(K, &circuit, vec![vec![Fp::one()]]).unwrap();
println!("{:?}", invalid_prover.verify());
assert_eq!(invalid_prover.verify(), Ok(()));
}

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

0 comments on commit 06e0b24

Please sign in to comment.