[chain_redesign] Rename LocalChain::inner() to blocks()
Also, we can get rid of `LocalChain::get_blockhash`, since we can already expose the internal map. Additionally, tests and docs are improved.
This commit is contained in:
@@ -64,8 +64,8 @@ impl LocalChain {
|
||||
}
|
||||
}
|
||||
|
||||
/// Get a reference to the inner map of block height to hash.
|
||||
pub fn inner(&self) -> &BTreeMap<u32, BlockHash> {
|
||||
/// Get a reference to a map of block height to hash.
|
||||
pub fn blocks(&self) -> &BTreeMap<u32, BlockHash> {
|
||||
&self.blocks
|
||||
}
|
||||
|
||||
@@ -76,11 +76,6 @@ impl LocalChain {
|
||||
.map(|(&height, &hash)| BlockId { height, hash })
|
||||
}
|
||||
|
||||
/// Get a [`BlockHash`] at the given height.
|
||||
pub fn get_blockhash(&self, height: u32) -> Option<BlockHash> {
|
||||
self.blocks.get(&height).cloned()
|
||||
}
|
||||
|
||||
/// This is like the sparsechain's logic, expect we must guarantee that all invalidated heights
|
||||
/// are to be re-filled.
|
||||
pub fn determine_changeset(&self, update: &Self) -> Result<ChangeSet, UpdateNotConnectedError> {
|
||||
|
||||
Reference in New Issue
Block a user