mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 19:17:58 +00:00
warp-sync: Return an error when trying to enable it for archive nodes. (#11086)
* warp-sync: Return an error when trying to enable it for archive nodes. * Fix checks * Ups * FMT
This commit is contained in:
@@ -377,8 +377,8 @@ impl From<multiaddr::Error> for ParseErr {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
/// Sync operation mode.
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum SyncMode {
|
||||
/// Full block download and verification.
|
||||
Full,
|
||||
@@ -393,6 +393,18 @@ pub enum SyncMode {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user