impl better debug for Ancestors (#21737)
This commit is contained in:
parent
f32216588d
commit
16a6dceb6b
|
@ -1,12 +1,23 @@
|
||||||
use {crate::accounts_index::RollingBitField, solana_sdk::clock::Slot, std::collections::HashMap};
|
use {
|
||||||
|
crate::accounts_index::RollingBitField,
|
||||||
|
core::fmt::{Debug, Formatter},
|
||||||
|
solana_sdk::clock::Slot,
|
||||||
|
std::collections::HashMap,
|
||||||
|
};
|
||||||
|
|
||||||
pub type AncestorsForSerialization = HashMap<Slot, usize>;
|
pub type AncestorsForSerialization = HashMap<Slot, usize>;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, AbiExample)]
|
#[derive(Clone, PartialEq, AbiExample)]
|
||||||
pub struct Ancestors {
|
pub struct Ancestors {
|
||||||
ancestors: RollingBitField,
|
ancestors: RollingBitField,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Debug for Ancestors {
|
||||||
|
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
|
||||||
|
write!(f, "{:?}", self.keys())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// some tests produce ancestors ranges that are too large such
|
// some tests produce ancestors ranges that are too large such
|
||||||
// that we prefer to implement them in a sparse HashMap
|
// that we prefer to implement them in a sparse HashMap
|
||||||
const ANCESTORS_HASH_MAP_SIZE: u64 = 8192;
|
const ANCESTORS_HASH_MAP_SIZE: u64 = 8192;
|
||||||
|
|
Loading…
Reference in New Issue