BlockId removal: refactor: ProofProvider (#12519)

* BlockId removal: refactor: ProofProvider

It changes the arguments of methods of `ProofProvider` trait from:
block: `BlockId<Block>` to: hash: `&Block::Hash`

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

* LightClientRequestHandler: excessive BlockIdTo bound removed

* imports cleanup

* formatting

* args tyeps cleanup
This commit is contained in:
Michal Kucharczyk
2022-10-19 12:13:57 +02:00
committed by GitHub
parent e3b269ab0f
commit 1d5aa47bee
5 changed files with 57 additions and 67 deletions
@@ -32,7 +32,7 @@ use sc_network_common::{
config::ProtocolId,
request_responses::{IncomingRequest, OutgoingResponse, ProtocolConfig},
};
use sp_runtime::{generic::BlockId, traits::Block as BlockT};
use sp_runtime::traits::Block as BlockT;
use std::{
hash::{Hash, Hasher},
sync::Arc,
@@ -205,14 +205,14 @@ where
if !request.no_proof {
let (proof, _count) = self.client.read_proof_collection(
&BlockId::hash(block),
&block,
request.start.as_slice(),
MAX_RESPONSE_BYTES,
)?;
response.proof = proof.encode();
} else {
let entries = self.client.storage_collection(
&BlockId::hash(block),
&block,
request.start.as_slice(),
MAX_RESPONSE_BYTES,
)?;