mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 00:28:01 +00:00
Removed From<H256> bound (#790)
This commit is contained in:
committed by
Robert Habermeier
parent
f71200ee3c
commit
da991efd5f
@@ -25,7 +25,6 @@ use runtime_primitives::generic::BlockId;
|
||||
use runtime_primitives::traits::{Block as BlockT, Header as HeaderT};
|
||||
use state_machine::{Backend as StateBackend, CodeExecutor, OverlayedChanges,
|
||||
execution_proof_check, ExecutionManager};
|
||||
use primitives::H256;
|
||||
use patricia_trie::NodeCodec;
|
||||
use hashdb::Hasher;
|
||||
use rlp::Encodable;
|
||||
@@ -138,14 +137,16 @@ pub fn check_execution_proof<Header, E, H, C>(
|
||||
Header: HeaderT,
|
||||
E: CodeExecutor<H>,
|
||||
H: Hasher,
|
||||
H::Out: Ord + Encodable + HeapSizeOf + From<H256>,
|
||||
H::Out: Ord + Encodable + HeapSizeOf,
|
||||
C: NodeCodec<H>,
|
||||
{
|
||||
let local_state_root = request.header.state_root();
|
||||
let mut root: H::Out = Default::default();
|
||||
root.as_mut().copy_from_slice(local_state_root.as_ref());
|
||||
|
||||
let mut changes = OverlayedChanges::default();
|
||||
let local_result = execution_proof_check::<H, C, _>(
|
||||
H256::from_slice(local_state_root.as_ref()).into(),
|
||||
root,
|
||||
remote_proof,
|
||||
&mut changes,
|
||||
executor,
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
use futures::IntoFuture;
|
||||
|
||||
use primitives::H256;
|
||||
use hashdb::Hasher;
|
||||
use patricia_trie::NodeCodec;
|
||||
use rlp::Encodable;
|
||||
@@ -134,11 +133,10 @@ impl<E, H, C> LightDataChecker<E, H, C> {
|
||||
impl<E, Block, H, C> FetchChecker<Block> for LightDataChecker<E, H, C>
|
||||
where
|
||||
Block: BlockT,
|
||||
Block::Hash: Into<H::Out> + From<H256>,
|
||||
E: CodeExecutor<H>,
|
||||
H: Hasher,
|
||||
C: NodeCodec<H> + Sync + Send,
|
||||
H::Out: Ord + Encodable + HeapSizeOf + From<Block::Hash> + From<H256>,
|
||||
H::Out: Ord + Encodable + HeapSizeOf,
|
||||
{
|
||||
fn check_header_proof(
|
||||
&self,
|
||||
@@ -162,8 +160,9 @@ impl<E, Block, H, C> FetchChecker<Block> for LightDataChecker<E, H, C>
|
||||
request: &RemoteReadRequest<Block::Header>,
|
||||
remote_proof: Vec<Vec<u8>>
|
||||
) -> ClientResult<Option<Vec<u8>>> {
|
||||
let local_state_root = request.header.state_root().clone();
|
||||
read_proof_check::<H, C>(local_state_root.into(), remote_proof, &request.key).map_err(Into::into)
|
||||
let mut root: H::Out = Default::default();
|
||||
root.as_mut().copy_from_slice(request.header.state_root().as_ref());
|
||||
read_proof_check::<H, C>(root, remote_proof, &request.key).map_err(Into::into)
|
||||
}
|
||||
|
||||
fn check_execution_proof(
|
||||
|
||||
Reference in New Issue
Block a user