Skip to content

Commit

Permalink
Handle error in import_block (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikhailK committed Jul 8, 2024
1 parent 880834a commit 70205fc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion consensus/poscan/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,15 @@ impl<B, I, C, S, Algorithm, CAW, CIDP, AccountId, BlockNumber> BlockImport<B> fo
let hs: Vec<H256> = pscan_hashes[16..].chunks(32).map(H256::from_slice).collect();

let parent_id: BlockId<B> = BlockId::hash(parent_hash);
let ver = self.client.runtime_api().version(&parent_id).unwrap();
let ver = self.client
.runtime_api()
.version(&parent_id)
.map_err(|err|
Error::<B>::Environment(format!(
">>> get version call failed in import_block: {:?}",
err
))
)?;

let (inner_seal, psdata) = if ver.spec_version < CONS_V2_SPEC_VER {
let inner_seal = fetch_seal::<B>(block.post_digests.get(digest_size - 3), block.header.hash())?;
Expand Down

0 comments on commit 70205fc

Please sign in to comment.