mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 09:57:56 +00:00
BlockId removal: refactor: Backend::state_at (#12488)
* Minor naming improved * BlockId removal refactor: Backend::state_at * formatting
This commit is contained in:
committed by
GitHub
parent
dcd56b1ffd
commit
532dd5ecc2
@@ -34,7 +34,7 @@ use std::borrow::Cow;
|
||||
|
||||
use node_primitives::Block;
|
||||
use node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes, Profile};
|
||||
use sc_client_api::backend::Backend;
|
||||
use sc_client_api::{backend::Backend, HeaderBackend};
|
||||
use sp_runtime::generic::BlockId;
|
||||
use sp_state_machine::InspectState;
|
||||
|
||||
@@ -127,10 +127,15 @@ impl core::Benchmark for ImportBenchmark {
|
||||
context.import_block(self.block.clone());
|
||||
let elapsed = start.elapsed();
|
||||
|
||||
let hash = context
|
||||
.client
|
||||
.expect_block_hash_from_id(&BlockId::number(1))
|
||||
.expect("Block 1 was imported; qed");
|
||||
|
||||
// Sanity checks.
|
||||
context
|
||||
.client
|
||||
.state_at(&BlockId::number(1))
|
||||
.state_at(&hash)
|
||||
.expect("state_at failed for block#1")
|
||||
.inspect_state(|| {
|
||||
match self.block_type {
|
||||
|
||||
Reference in New Issue
Block a user