Skip to content

Commit

Permalink
Verify effect hash
Browse files Browse the repository at this point in the history
  • Loading branch information
neithanmo committed Dec 31, 2024
1 parent 3ab0f58 commit 8e11c9c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/rust/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ mod check_signature {

let fvk = sk.full_viewing_key();
let auth_data = plan.authorize(rand_chacha::rand_core::OsRng, &sk).unwrap();
// compare effect hash:
std::println!("expected_hash: {:?}", EFFECT_HASH);
std::println!(
"effect hash: {:?}",
hex::encode(auth_data.effect_hash.unwrap().0)
);
assert_eq!(
hex::decode(EFFECT_HASH).unwrap(),
auth_data.effect_hash.unwrap().0
);
std::println!("AuthorizationData: {:?}", auth_data);
}
}

0 comments on commit 8e11c9c

Please sign in to comment.