Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor backend following updated contracts #152

Merged
merged 13 commits into from
Sep 12, 2023
Prev Previous commit
Next Next commit
fix: remove not used csv files and fix example
  • Loading branch information
sifnoc committed Sep 6, 2023
commit 35bf5a26006d8cb0f333ddfa0a736cc7ef12867b
1 change: 0 additions & 1 deletion backend/examples/signatures.csv

This file was deleted.

12 changes: 3 additions & 9 deletions backend/examples/verify_inclusion.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
use halo2_proofs::halo2curves::{bn256::Fr as Fp, ff::PrimeField};
use num_bigint::BigUint;

use summa_backend::apis::snapshot::Snapshot;
use summa_backend::apis::round::Snapshot;
use summa_solvency::{
circuits::{
merkle_sum_tree::MstInclusionCircuit,
@@ -32,18 +32,12 @@ fn main() {
const N_BYTES: usize = 8;

let ptau_path = "./ptau/hermez-raw-11";
let signature_csv_path = "./examples/signatures.csv";
let entry_csv_path = "../zk_prover/src/merkle_sum_tree/csv/entry_16.csv";

// CEX Generate the Merkle Sum Tree and then initialize the circuit.
// Note that `signature_csv` is empty because this is only needed to generate π of Solvency, which is not the case here.
let snapshot = Snapshot::<LEVELS, N_ASSETS, N_BYTES>::new(
&entry_csv_path,
&signature_csv_path,
"Summa proof of solvency for CryptoExchange".to_string(),
&ptau_path,
)
.unwrap();
let snapshot =
Snapshot::<LEVELS, N_ASSETS, N_BYTES>::new(&entry_csv_path, &ptau_path, 1).unwrap();

let inclusion_proof = snapshot.generate_proof_of_inclusion(0 as usize).unwrap();