Skip to content

Commit

Permalink
Review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Thoralf-M committed Dec 6, 2023
1 parent b73f82f commit c7a9a62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions sdk/src/types/block/output/unlock_condition/expiration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,11 @@ impl ExpirationUnlockCondition {
) -> Option<&'a Address> {
let slot_index = slot_index.into();

if self.slot_index() > (slot_index + committable_age_range.max) {
Some(address)
} else if self.slot_index() <= (slot_index + committable_age_range.min) {
Some(&self.return_address)
} else {
None
}
self.is_expired(slot_index, committable_age_range).map(
|expired| {
if expired { &self.return_address } else { address }
},
)
}
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/wallet/operations/helpers/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub(crate) fn can_output_be_unlocked_now(
.required_address(slot_index.into(), committable_age_range)?;

// In case of `None` the output can currently not be unlocked because of expiration unlock condition
required_address.map_or_else(|| Ok(false), |required_address| Ok(wallet_address == &required_address))
Ok(required_address.map_or_else(|| false, |required_address| wallet_address == &required_address))
}

// Check if an output can be unlocked by the wallet address at the current time and at any
Expand Down

0 comments on commit c7a9a62

Please sign in to comment.