mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 05:51:02 +00:00
Add small header cache (#7516)
* Remove header query * Header cache * Fix potential race issue * Simplify status query
This commit is contained in:
@@ -1159,12 +1159,12 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
|
||||
|
||||
/// Prepare in-memory header that is used in execution environment.
|
||||
fn prepare_environment_block(&self, parent: &BlockId<Block>) -> sp_blockchain::Result<Block::Header> {
|
||||
let parent_header = self.backend.blockchain().expect_header(*parent)?;
|
||||
let parent_hash = self.backend.blockchain().expect_block_hash_from_id(parent)?;
|
||||
Ok(<<Block as BlockT>::Header as HeaderT>::new(
|
||||
self.backend.blockchain().expect_block_number_from_id(parent)? + One::one(),
|
||||
Default::default(),
|
||||
Default::default(),
|
||||
parent_header.hash(),
|
||||
parent_hash,
|
||||
Default::default(),
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user