From e649cb702d12f4711714fc37d44a2186b20007f0 Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Mon, 19 Aug 2024 14:34:20 -0700 Subject: [PATCH] Update example --- examples/prove-and-verify.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/prove-and-verify.rs b/examples/prove-and-verify.rs index aa025ff..3f18eb7 100644 --- a/examples/prove-and-verify.rs +++ b/examples/prove-and-verify.rs @@ -72,14 +72,14 @@ fn verifier( ) -> TrieRoot { let hasher = &mut DigestHasher::::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);