Skip to content

Commit

Permalink
fix: replace swap_balances_per_level with sum_balances_per_level (#…
Browse files Browse the repository at this point in the history
…255)

* fix: replace `swap_balances_per_level` with `sum_balances_per_level`

* chore: update readme

* chore: update verifier contract and set `N_BYTES` from 14 to 8

* test: fix

* chore: fix comment
  • Loading branch information
enricobottazzi authored Jan 23, 2024
1 parent b832e5e commit d6e85c9
Show file tree
Hide file tree
Showing 19 changed files with 3,020 additions and 2,673 deletions.
2 changes: 1 addition & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ cargo test --release -- --nocapture

### Generating and updating verifier contract for Backend

The verifier contract in the backend were generated using a predefined set of parameters: `N_CURRENCIES = 2` and `N_BYTES=14`, as indicated [here](https://github.com/summa-dev/summa-solvency/blob/master/zk_prover/examples/gen_inclusion_verifier.rs#L21-L22).
The verifier contract in the backend were generated using a predefined set of parameters: `N_CURRENCIES = 2` and `N_BYTES=8`, as indicated [here](https://github.com/summa-dev/summa-solvency/blob/master/zk_prover/examples/gen_inclusion_verifier.rs#L21-L22).
If you intend to work with different parameters, you'll need to adjust these hard-coded values and then generate new verifier contract.

The process described below assists in both generating the verifier and updating the Summa contract, which integrates the new verifier as constructors.
Expand Down
2 changes: 1 addition & 1 deletion backend/examples/summa_solvency_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async fn main() -> Result<(), Box<dyn Error>> {

// Using the `round` instance, the commitment is dispatched to the Summa contract with the `dispatch_commitment` method.
let timestamp = 1u64;
let mut round = Round::<4, 2, 14>::new(&signer, Box::new(mst), params_path, timestamp).unwrap();
let mut round = Round::<4, 2, 8>::new(&signer, Box::new(mst), params_path, timestamp).unwrap();

// Sends the commitment, which should ideally complete without errors.
round.dispatch_commitment().await?;
Expand Down
2 changes: 1 addition & 1 deletion backend/src/contracts/abi/InclusionVerifier.json

Large diffs are not rendered by default.

Loading

0 comments on commit d6e85c9

Please sign in to comment.