Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions ledger/src/scan_state/transaction_logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3301,6 +3301,13 @@ pub mod zkapp_command {
self.fold_impl(init, &mut fun)
}

pub fn exists<'a, F>(&'a self, mut fun: F) -> bool
where
F: FnMut(&'a AccUpdate) -> bool,
{
self.fold(false, |acc, x| acc || fun(x))
}

fn map_to_impl<F, AnotherAccUpdate: Clone + AccountUpdateRef>(
&self,
fun: &F,
Expand Down Expand Up @@ -3627,16 +3634,15 @@ pub mod zkapp_command {

pub fn has_zero_vesting_period(&self) -> bool {
self.account_updates
.iter()
.any(|p| match &p.elt.account_update.body.update.timing {
.exists(|account_update| match &account_update.body.update.timing {
SetOrKeep::Keep => false,
SetOrKeep::Set(Timing { vesting_period, .. }) => vesting_period.is_zero(),
})
}

pub fn is_incompatible_version(&self) -> bool {
self.account_updates.iter().any(|p| {
match &p.elt.account_update.body.update.permissions {
self.account_updates.exists(|account_update| {
match &account_update.body.update.permissions {
SetOrKeep::Keep => false,
SetOrKeep::Set(Permissions {
set_verification_key,
Expand Down
Loading