mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
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 <>
This commit is contained in:
committed by
GitHub
parent
539a9a9158
commit
01fcc27465
Generated
+181
-180
File diff suppressed because it is too large
Load Diff
@@ -29,7 +29,7 @@ use sp_api::{CallApiAt, Encode, NumberFor, ProvideRuntimeApi};
|
|||||||
use sp_blockchain::{HeaderBackend, HeaderMetadata};
|
use sp_blockchain::{HeaderBackend, HeaderMetadata};
|
||||||
use sp_consensus::BlockStatus;
|
use sp_consensus::BlockStatus;
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
generic::{BlockId, SignedBlock},
|
generic::SignedBlock,
|
||||||
traits::{BlakeTwo256, Block as BlockT},
|
traits::{BlakeTwo256, Block as BlockT},
|
||||||
Justifications,
|
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! {
|
with_client! {
|
||||||
self,
|
self,
|
||||||
client,
|
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! {
|
with_client! {
|
||||||
self,
|
self,
|
||||||
client,
|
client,
|
||||||
{
|
{
|
||||||
client.block_status(id)
|
client.block_status(hash)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user