Skip to content
Snippets Groups Projects
Commit 01fcc274 authored by Michal Kucharczyk's avatar Michal Kucharczyk Committed by GitHub
Browse files

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

* 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)

* update lockfile for {"substrate"}

* ".git/.scripts/fmt.sh"

Co-authored-by: parity-processbot <>
parent 539a9a91
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -29,7 +29,7 @@ use sp_api::{CallApiAt, Encode, NumberFor, ProvideRuntimeApi};
use sp_blockchain::{HeaderBackend, HeaderMetadata};
use sp_consensus::BlockStatus;
use sp_runtime::{
generic::{BlockId, SignedBlock},
generic::SignedBlock,
traits::{BlakeTwo256, Block as BlockT},
Justifications,
};
......@@ -338,22 +338,25 @@ impl sc_client_api::BlockBackend<Block> for Client {
}
}
fn block(&self, id: &BlockId<Block>) -> sp_blockchain::Result<Option<SignedBlock<Block>>> {
fn block(
&self,
hash: <Block as BlockT>::Hash,
) -> sp_blockchain::Result<Option<SignedBlock<Block>>> {
with_client! {
self,
client,
{
client.block(id)
client.block(hash)
}
}
}
fn block_status(&self, id: &BlockId<Block>) -> sp_blockchain::Result<BlockStatus> {
fn block_status(&self, hash: <Block as BlockT>::Hash) -> sp_blockchain::Result<BlockStatus> {
with_client! {
self,
client,
{
client.block_status(id)
client.block_status(hash)
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment