pub(super) fn new(
        finalized_deploys: Vec<(DeployHash, DeployHeader)>,
        next_finalized_height: u64,
        cached_state: CachedState,
    ) -> (BlockProposerDeploySets, PruneResult) {
        let finalized_deploys: HashMap<_, _> = finalized_deploys.into_iter().collect();

        let CachedState {
            mut pending_deploys,
            mut pending_transfers,
        } = cached_state;
        pending_deploys.retain(|hash, _| !finalized_deploys.contains_key(hash));
        pending_transfers.retain(|hash, _| !finalized_deploys.contains_key(hash));

        let mut sets = BlockProposerDeploySets {
            pending_deploys,
            pending_transfers,
            finalized_deploys,
            next_finalized: next_finalized_height,
            ..Default::default()
        };
        let prune_result = sets.prune(Timestamp::now());
        (sets, prune_result)
    }
/// Constructs the instance of `BlockProposerDeploySets` from the list of finalized deploys and
/// the cached state.
Constructs the instance of `BlockProposerDeploySets` from the list of finalized deploys and
the cached state.
Constructs the instance of ` BlockProposerDeploySets ` from the list of finalized deploys and the cached state .
pub(super) fn new(
        finalized_deploys: Vec<(DeployHash, DeployHeader)>,
        next_finalized_height: u64,
        cached_state: CachedState,
    ) -> (BlockProposerDeploySets, PruneResult) {
        let finalized_deploys: HashMap<_, _> = finalized_deploys.into_iter().collect();
        let CachedState {
            mut pending_deploys,
            mut pending_transfers,
        } = cached_state;
        pending_deploys.retain(|hash, _| !finalized_deploys.contains_key(hash));
        pending_transfers.retain(|hash, _| !finalized_deploys.contains_key(hash));
        let mut sets = BlockProposerDeploySets {
            pending_deploys,
            pending_transfers,
            finalized_deploys,
            next_finalized: next_finalized_height,
            ..Default::default()
        };
        let prune_result = sets.prune(Timestamp::now());
        (sets, prune_result)
    }
pub ( super ) fn new ( finalized_deploys : Vec < ( DeployHash , DeployHeader ) > , next_finalized_height : u64 , cached_state : CachedState , ) -> ( BlockProposerDeploySets , PruneResult ) { let finalized_deploys : HashMap < _ , _ > = finalized_deploys . into_iter ( ) . collect ( ) ; let CachedState { mut pending_deploys , mut pending_transfers , } = cached_state ; pending_deploys . retain ( | hash , _ | ! finalized_deploys . contains_key ( hash ) ) ; pending_transfers . retain ( | hash , _ | ! finalized_deploys . contains_key ( hash ) ) ; let mut sets = BlockProposerDeploySets { pending_deploys , pending_transfers , finalized_deploys , next_finalized : next_finalized_height , .. Default :: default ( ) } ; let prune_result = sets . prune ( Timestamp :: now ( ) ) ; ( sets , prune_result ) }
Constructs the instance of `BlockProposerDeploySets` from the list of finalized deploys and
the cached state.
Constructs the instance of ` BlockProposerDeploySets ` from the list of finalized deploys and the cached state .
finalized_deploys
Vec<(DeployHash, DeployHeader)>
next_finalized_height
u64
cached_state
CachedState
finalized_deploys
Vec<(DeployHash, DeployHeader)>
next_finalized_height
u64
cached_state
CachedState