mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 19:17:58 +00:00
Unify SyncMode data structures under one (#14465)
This commit is contained in:
@@ -38,7 +38,7 @@ use zeroize::Zeroize;
|
||||
|
||||
pub use sc_network_common::{
|
||||
role::{Role, Roles},
|
||||
sync::warp::WarpSyncProvider,
|
||||
sync::{warp::WarpSyncProvider, SyncMode},
|
||||
ExHashT,
|
||||
};
|
||||
use sc_utils::mpsc::TracingUnboundedSender;
|
||||
@@ -277,40 +277,6 @@ impl NonReservedPeerMode {
|
||||
}
|
||||
}
|
||||
|
||||
/// Sync operation mode.
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub enum SyncMode {
|
||||
/// Full block download and verification.
|
||||
Full,
|
||||
/// Download blocks and the latest state.
|
||||
Fast {
|
||||
/// Skip state proof download and verification.
|
||||
skip_proofs: bool,
|
||||
/// Download indexed transactions for recent blocks.
|
||||
storage_chain_mode: bool,
|
||||
},
|
||||
/// Warp sync - verify authority set transitions and the latest state.
|
||||
Warp,
|
||||
}
|
||||
|
||||
impl SyncMode {
|
||||
/// Returns if `self` is [`Self::Warp`].
|
||||
pub fn is_warp(&self) -> bool {
|
||||
matches!(self, Self::Warp)
|
||||
}
|
||||
|
||||
/// Returns if `self` is [`Self::Fast`].
|
||||
pub fn is_fast(&self) -> bool {
|
||||
matches!(self, Self::Fast { .. })
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for SyncMode {
|
||||
fn default() -> Self {
|
||||
Self::Full
|
||||
}
|
||||
}
|
||||
|
||||
/// The configuration of a node's secret key, describing the type of key
|
||||
/// and how it is obtained. A node's identity keypair is the result of
|
||||
/// the evaluation of the node key configuration.
|
||||
|
||||
Reference in New Issue
Block a user