[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:
志宇
2023-05-05 19:49:30 +08:00
parent a56d289eef
commit 065c64a675
4 changed files with 19 additions and 35 deletions

View File

@@ -10,12 +10,13 @@ pub trait ChainOracle {
/// Error type.
type Error: core::fmt::Debug;
/// Determines whether `block` of [`BlockId`] exists as an ancestor of `static_block`.
/// Determines whether `block` of [`BlockId`] exists as an ancestor of `chain_tip`.
///
/// If `None` is returned, it means the implementation cannot determine whether `block` exists.
/// If `None` is returned, it means the implementation cannot determine whether `block` exists
/// under `chain_tip`.
fn is_block_in_chain(
&self,
block: BlockId,
static_block: BlockId,
chain_tip: BlockId,
) -> Result<Option<bool>, Self::Error>;
}