mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 11:41:04 +00:00
@@ -51,35 +51,6 @@ pub use polkadot_node_jaeger as jaeger;
|
||||
/// If there are greater than this number of slots, then we fall back to a heap vector.
|
||||
const ACTIVE_LEAVES_SMALLVEC_CAPACITY: usize = 8;
|
||||
|
||||
/// The status of an activated leaf.
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum LeafStatus {
|
||||
/// A leaf is fresh when it's the first time the leaf has been encountered.
|
||||
/// Most leaves should be fresh.
|
||||
Fresh,
|
||||
/// A leaf is stale when it's encountered for a subsequent time. This will happen
|
||||
/// when the chain is reverted or the fork-choice rule abandons some chain.
|
||||
Stale,
|
||||
}
|
||||
|
||||
impl LeafStatus {
|
||||
/// Returns a `bool` indicating fresh status.
|
||||
pub fn is_fresh(&self) -> bool {
|
||||
match *self {
|
||||
LeafStatus::Fresh => true,
|
||||
LeafStatus::Stale => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a `bool` indicating stale status.
|
||||
pub fn is_stale(&self) -> bool {
|
||||
match *self {
|
||||
LeafStatus::Fresh => false,
|
||||
LeafStatus::Stale => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Activated leaf.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ActivatedLeaf {
|
||||
@@ -87,8 +58,6 @@ pub struct ActivatedLeaf {
|
||||
pub hash: Hash,
|
||||
/// The block number.
|
||||
pub number: BlockNumber,
|
||||
/// The status of the leaf.
|
||||
pub status: LeafStatus,
|
||||
/// A handle to unpin the block on drop.
|
||||
pub unpin_handle: UnpinHandle,
|
||||
/// An associated [`jaeger::Span`].
|
||||
|
||||
Reference in New Issue
Block a user