mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-07-17 11:19:25 +00:00
test(lee): pin for_dummy nullifier and commitment derivations
This commit is contained in:
parent
949ae47499
commit
7347ce615d
@ -129,7 +129,7 @@ mod tests {
|
||||
use risc0_zkvm::sha::{Impl, Sha256 as _};
|
||||
|
||||
use crate::{
|
||||
Commitment, DUMMY_COMMITMENT, DUMMY_COMMITMENT_HASH,
|
||||
Commitment, DUMMY_COMMITMENT, DUMMY_COMMITMENT_HASH, Nullifier,
|
||||
account::{Account, AccountId},
|
||||
};
|
||||
|
||||
@ -150,4 +150,18 @@ mod tests {
|
||||
.unwrap();
|
||||
assert_eq!(DUMMY_COMMITMENT_HASH, expected_dummy_commitment_hash);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn for_dummy_matches_pinned_value() {
|
||||
let nullifier = Nullifier::for_dummy(&[0; 32]);
|
||||
let commitment_seed = [1; 32];
|
||||
let expected_commitment = Commitment([
|
||||
106, 88, 233, 248, 28, 251, 254, 48, 62, 53, 61, 248, 25, 148, 223, 133, 108, 213, 184,
|
||||
83, 73, 145, 122, 104, 89, 220, 111, 132, 40, 87, 12, 105,
|
||||
]);
|
||||
assert_eq!(
|
||||
Commitment::for_dummy(&nullifier, &commitment_seed),
|
||||
expected_commitment
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,4 +217,14 @@ mod tests {
|
||||
|
||||
assert_eq!(account_id, expected_account_id);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn for_dummy_matches_pinned_value() {
|
||||
let nullifier_seed = [0; 32];
|
||||
let expected_nullifier = Nullifier([
|
||||
244, 220, 48, 137, 204, 138, 180, 41, 108, 86, 40, 46, 187, 7, 232, 57, 57, 167, 143,
|
||||
157, 125, 171, 137, 46, 64, 206, 191, 211, 231, 0, 11, 86,
|
||||
]);
|
||||
assert_eq!(Nullifier::for_dummy(&nullifier_seed), expected_nullifier);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user