mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-07-17 13:20:17 +00:00
refactor(verifier): consume bundled public_actions directly
This commit is contained in:
parent
beccc9cbaf
commit
ed6349e724
@ -100,14 +100,6 @@ impl Message {
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn public_post_states(&self) -> Vec<Account> {
|
||||
self.public_actions
|
||||
.iter()
|
||||
.map(|action| action.post_state.clone())
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn hash(&self) -> [u8; 32] {
|
||||
let msg = self.to_bytes();
|
||||
|
||||
@ -397,10 +397,10 @@ impl ValidatedStateDiff {
|
||||
// 6. Nullifier uniqueness
|
||||
state.check_nullifiers_are_valid(&nullifiers)?;
|
||||
|
||||
let public_diff = public_account_ids
|
||||
let public_diff = message
|
||||
.public_actions
|
||||
.iter()
|
||||
.copied()
|
||||
.zip(message.public_post_states())
|
||||
.map(|action| (action.account_id, action.post_state.clone()))
|
||||
.collect();
|
||||
let new_nullifiers = nullifiers.iter().map(|(nullifier, _)| *nullifier).collect();
|
||||
|
||||
@ -491,8 +491,11 @@ fn check_privacy_preserving_circuit_proof_is_valid(
|
||||
public_actions: public_pre_states
|
||||
.iter()
|
||||
.cloned()
|
||||
.zip(message.public_post_states())
|
||||
.map(|(pre, post)| PublicAction { pre, post })
|
||||
.zip(&message.public_actions)
|
||||
.map(|(pre, action)| PublicAction {
|
||||
pre,
|
||||
post: action.post_state.clone(),
|
||||
})
|
||||
.collect(),
|
||||
private_actions: message.private_actions.clone(),
|
||||
block_validity_window: message.block_validity_window,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user