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