From 0eec1ad57f55dc138a627553515b763fcd02457b Mon Sep 17 00:00:00 2001 From: steviez Date: Tue, 11 Apr 2023 02:39:31 -0500 Subject: [PATCH] chore: Update Blockstore::get_slots_since() doc comments (#31134) Additionally, change the function definition to use Slot instead of u64. Slot is defined as an alias of u64 so these are functionally equivalent, but using Slot over u64 is more expressive of the intent. --- ledger/src/blockstore.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ledger/src/blockstore.rs b/ledger/src/blockstore.rs index 065ce8d674..bdeeba57a2 100644 --- a/ledger/src/blockstore.rs +++ b/ledger/src/blockstore.rs @@ -3034,13 +3034,14 @@ impl Blockstore { entries.into_iter().flatten().collect() } - // Returns slots connecting to any element of the list `slots`. - pub fn get_slots_since(&self, slots: &[u64]) -> Result>> { + /// Returns a mapping from each elements of `slots` to a list of the + /// element's children slots. + pub fn get_slots_since(&self, slots: &[Slot]) -> Result>> { let slot_metas: Result>> = self.meta_cf.multi_get(slots.to_vec()).into_iter().collect(); let slot_metas = slot_metas?; - let result: HashMap> = slots + let result: HashMap> = slots .iter() .zip(slot_metas) .filter_map(|(slot, meta)| meta.map(|meta| (*slot, meta.next_slots.to_vec())))