BlockId removal: refactor: Backend::state_at (#12488)

* Minor naming improved

* BlockId removal refactor: Backend::state_at

* formatting
This commit is contained in:
Michal Kucharczyk
2022-10-14 11:27:32 +02:00
committed by GitHub
parent dcd56b1ffd
commit 532dd5ecc2
12 changed files with 105 additions and 100 deletions
@@ -78,8 +78,8 @@ pub trait HeaderBackend<Block: BlockT>: Send + Sync {
/// Convert an arbitrary block ID into a block hash. Returns `UnknownBlock` error if block is
/// not found.
fn expect_block_hash_from_id(&self, id: &BlockId<Block>) -> Result<Block::Hash> {
self.block_hash_from_id(id).and_then(|n| {
n.ok_or_else(|| Error::UnknownBlock(format!("Expect block hash from id: {}", id)))
self.block_hash_from_id(id).and_then(|h| {
h.ok_or_else(|| Error::UnknownBlock(format!("Expect block hash from id: {}", id)))
})
}
}