* uses Option<Slot> for SlotMeta.parent_slot (#21808)
SlotMeta.parent_slot for the head of a detached chain of slots is
unknown and that is indicated by u64::MAX which lacks type-safety:
https://github.com/solana-labs/solana/blob/6c108c8fc/ledger/src/blockstore_meta.rs#L203-L205
The commit changes the type to Option<Slot>. Backward compatibility is
maintained by customizing serde serialize/deserialize implementations.
(cherry picked from commit 8d980f07ba
)
# Conflicts:
# ledger-tool/src/main.rs
* removes backport merge conflicts
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
This commit is contained in:
@@ -2759,7 +2759,7 @@ fn test_no_voting() {
|
||||
let meta = ledger.meta(i as u64).unwrap().unwrap();
|
||||
let parent = meta.parent_slot;
|
||||
let expected_parent = i.saturating_sub(1);
|
||||
assert_eq!(parent, expected_parent as u64);
|
||||
assert_eq!(parent, Some(expected_parent as u64));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user