mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07:58 +00:00
error rework, for polkadot convenience (#7446)
Co-authored-by: Bernhard Schuster <bernhard@parity.io> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
1679919830
commit
9687759774
@@ -114,8 +114,7 @@ pub trait CallExecutor<B: BlockT> {
|
||||
) -> Result<(Vec<u8>, StorageProof), sp_blockchain::Error> {
|
||||
let trie_state = state.as_trie_backend()
|
||||
.ok_or_else(||
|
||||
Box::new(sp_state_machine::ExecutionError::UnableToGenerateProof)
|
||||
as Box<dyn sp_state_machine::Error>
|
||||
sp_blockchain::Error::from_state(Box::new(sp_state_machine::ExecutionError::UnableToGenerateProof) as Box<_>)
|
||||
)?;
|
||||
self.prove_at_trie_state(trie_state, overlay, method, call_data)
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ pub fn build_proof<Header, Hasher, BlocksI, HashesI>(
|
||||
prove_read_on_trie_backend(
|
||||
trie_storage,
|
||||
blocks.into_iter().map(|number| encode_cht_key(number)),
|
||||
).map_err(ClientError::Execution)
|
||||
).map_err(ClientError::from_state)
|
||||
}
|
||||
|
||||
/// Check CHT-based header proof.
|
||||
@@ -150,7 +150,7 @@ pub fn check_proof<Header, Hasher>(
|
||||
.map(|mut map| map
|
||||
.remove(local_cht_key)
|
||||
.expect("checked proof of local_cht_key; qed"))
|
||||
.map_err(|e| ClientError::from(e)),
|
||||
.map_err(ClientError::from_state),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ pub fn check_proof_on_proving_backend<Header, Hasher>(
|
||||
read_proof_check_on_proving_backend::<Hasher>(
|
||||
proving_backend,
|
||||
local_cht_key,
|
||||
).map_err(|e| ClientError::from(e)),
|
||||
).map_err(ClientError::from_state),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user