BlockId removal: refactor: BlockBackend::block|block_status (#13014)

* BlockId removal: refactor: BlockBackend::block|block_status

It changes the arguments of:
-  `BlockBackend::block`
-  `BlockBackend::block_status`

method from: `BlockId<Block>` to: `Block::Hash`

This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292)

* non-obvious reworks

* doc fix

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <git@kchr.de>

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: parity-processbot <>
This commit is contained in:
Michal Kucharczyk
2023-01-02 10:42:05 +01:00
committed by GitHub
parent 66cfd01f17
commit 9c69fc1b32
12 changed files with 75 additions and 101 deletions
+1 -4
View File
@@ -69,10 +69,7 @@ where
self.deny_unsafe.check_if_safe()?;
let block = {
let block = self
.client
.block(&BlockId::Hash(hash))
.map_err(|e| Error::BlockQueryError(Box::new(e)))?;
let block = self.client.block(hash).map_err(|e| Error::BlockQueryError(Box::new(e)))?;
if let Some(block) = block {
let (mut header, body) = block.block.deconstruct();
// Remove the `Seal` to ensure we have the number of digests as expected by the