pub(crate) fn can_finalize(&self) -> impl Future<Output = bool> {
        let lock = match self {
            UpdateStrategy::FleetLock(s) => s.can_finalize(),
            UpdateStrategy::Immediate(s) => s.can_finalize(),
            UpdateStrategy::Periodic(s) => s.can_finalize(),
        };

        async {
            match lock.await {
                Ok(can_finalize) => {
                    if can_finalize {
                        FINALIZATION_STRATEGY_RESPONSES
                            .with_label_values(&[CAN_FINALIZE_ALLOW_LABEL])
                            .inc();
                    } else {
                        FINALIZATION_STRATEGY_RESPONSES
                            .with_label_values(&[CAN_FINALIZE_DENY_LABEL])
                            .inc();
                    }
                    can_finalize
                }
                Err(e) => {
                    FINALIZATION_STRATEGY_RESPONSES
                        .with_label_values(&[CAN_FINALIZE_ERROR_LABEL])
                        .inc();
                    error!("{}", e);
                    false
                }
            }
        }
    }
/// Check if finalization is allowed at this time.
Check if finalization is allowed at this time.
Check if finalization is allowed at this time .
pub(crate) fn can_finalize(&self) -> impl Future<Output = bool> {
        let lock = match self {
            UpdateStrategy::FleetLock(s) => s.can_finalize(),
            UpdateStrategy::Immediate(s) => s.can_finalize(),
            UpdateStrategy::Periodic(s) => s.can_finalize(),
        };
        async {
            match lock.await {
                Ok(can_finalize) => {
                    if can_finalize {
                        FINALIZATION_STRATEGY_RESPONSES
                            .with_label_values(&[CAN_FINALIZE_ALLOW_LABEL])
                            .inc();
                    } else {
                        FINALIZATION_STRATEGY_RESPONSES
                            .with_label_values(&[CAN_FINALIZE_DENY_LABEL])
                            .inc();
                    }
                    can_finalize
                }
                Err(e) => {
                    FINALIZATION_STRATEGY_RESPONSES
                        .with_label_values(&[CAN_FINALIZE_ERROR_LABEL])
                        .inc();
                    error!("{}", e);
                    false
                }
            }
        }
    }
pub ( crate ) fn can_finalize ( & self ) -> impl Future < Output = bool > { let lock = match self { UpdateStrategy :: FleetLock ( s ) => s . can_finalize ( ) , UpdateStrategy :: Immediate ( s ) => s . can_finalize ( ) , UpdateStrategy :: Periodic ( s ) => s . can_finalize ( ) , } ; async { match lock . await { Ok ( can_finalize ) => { if can_finalize { FINALIZATION_STRATEGY_RESPONSES . with_label_values ( & [ CAN_FINALIZE_ALLOW_LABEL ] ) . inc ( ) ; } else { FINALIZATION_STRATEGY_RESPONSES . with_label_values ( & [ CAN_FINALIZE_DENY_LABEL ] ) . inc ( ) ; } can_finalize } Err ( e ) => { FINALIZATION_STRATEGY_RESPONSES . with_label_values ( & [ CAN_FINALIZE_ERROR_LABEL ] ) . inc ( ) ; error ! ( " " e ) ; false } } } }
Check if finalization is allowed at this time.
Check if finalization is allowed at this time .
&self