Skip to content

Commit

Permalink
feat(transition-frontier): Implement missing enabling conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
tizoc committed Mar 29, 2024
1 parent 213500a commit b0fda52
Showing 1 changed file with 28 additions and 6 deletions.
Expand Up @@ -250,13 +250,35 @@ impl redux::EnablingCondition<crate::State> for TransitionFrontierSyncLedgerSnar
.and_then(|s| s.attempts.get(sender))
.map_or(false, |s| s.is_success())
}
// TODO(tizoc): implement
TransitionFrontierSyncLedgerSnarkedAction::NumAccountsSuccess { .. } => true,
TransitionFrontierSyncLedgerSnarkedAction::NumAccountsSuccess { .. } => state
.transition_frontier
.sync
.ledger()
.and_then(|s| s.snarked()?.num_accounts_pending())
.is_some(),

// TODO(tizoc): implement
TransitionFrontierSyncLedgerSnarkedAction::MerkleTreeSyncPending => true,
// TODO(tizoc): implement
TransitionFrontierSyncLedgerSnarkedAction::MerkleTreeSyncSuccess => true,
TransitionFrontierSyncLedgerSnarkedAction::MerkleTreeSyncPending => state
.transition_frontier
.sync
.ledger()
.and_then(|s| s.snarked())
.map_or(false, |s| {
matches!(
s,
TransitionFrontierSyncLedgerSnarkedState::NumAccountsSuccess { .. }
)
}),
TransitionFrontierSyncLedgerSnarkedAction::MerkleTreeSyncSuccess => state
.transition_frontier
.sync
.ledger()
.and_then(|s| s.snarked())
.map_or(false, |s| {
matches!(
s,
TransitionFrontierSyncLedgerSnarkedState::MerkleTreeSyncPending { .. }
)
}),

// hashes and contents
TransitionFrontierSyncLedgerSnarkedAction::PeerQueryAddressInit {
Expand Down

0 comments on commit b0fda52

Please sign in to comment.