Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
Avi-D-coder committed Aug 19, 2024
1 parent 39572d5 commit e649cb7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/prove-and-verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ fn verifier(
) -> TrieRoot<NodeHash> {
let hasher = &mut DigestHasher::<Sha256>::default();

let mut txn = Transaction::from_verified_snapshot(
VerifiedSnapshot::verify_snapshot(snapshot, hasher).unwrap(),
);
let verified_snapshot = VerifiedSnapshot::verify_snapshot(snapshot, hasher).unwrap();

let pre_batch_trie_root = txn.calc_root_hash(hasher).unwrap();
let pre_batch_trie_root = verified_snapshot.trie_root_hash();
// Assert that the trie started the transaction with the correct root hash.
assert_eq!(pre_batch_trie_root, pre_txn_merkle_root);

let mut txn = Transaction::from(verified_snapshot);

// Replay the exact same operations inside the zkVM.
// The business logic is entirely identical.
apply_operations(&mut txn, operations);
Expand Down

0 comments on commit e649cb7

Please sign in to comment.