mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 07:37:57 +00:00
BlockId removal: BlockBuilderProvider::new_block_at (#13401)
* `BlockId` removal: `BlockBuilderProvider::new_block_at` It changes the arguments of `BlockBuilderProvider::new_block_at` from: `BlockId<Block>` to: `Block::Hash` * fmt * fix * more fixes
This commit is contained in:
committed by
GitHub
parent
cd299d2b45
commit
5ef88dd398
@@ -38,7 +38,6 @@ use sp_consensus::{DisableProofRecording, EnableProofRecording, ProofRecording,
|
||||
use sp_core::traits::SpawnNamed;
|
||||
use sp_inherents::InherentData;
|
||||
use sp_runtime::{
|
||||
generic::BlockId,
|
||||
traits::{BlakeTwo256, Block as BlockT, Hash as HashT, Header as HeaderT},
|
||||
Digest, Percent, SaturatedConversion,
|
||||
};
|
||||
@@ -196,14 +195,12 @@ where
|
||||
) -> Proposer<B, Block, C, A, PR> {
|
||||
let parent_hash = parent_header.hash();
|
||||
|
||||
let id = BlockId::hash(parent_hash);
|
||||
|
||||
info!("🙌 Starting consensus session on top of parent {:?}", parent_hash);
|
||||
|
||||
let proposer = Proposer::<_, _, _, _, PR> {
|
||||
spawn_handle: self.spawn_handle.clone(),
|
||||
client: self.client.clone(),
|
||||
parent_id: id,
|
||||
parent_hash,
|
||||
parent_number: *parent_header.number(),
|
||||
transaction_pool: self.transaction_pool.clone(),
|
||||
now,
|
||||
@@ -247,7 +244,7 @@ where
|
||||
pub struct Proposer<B, Block: BlockT, C, A: TransactionPool, PR> {
|
||||
spawn_handle: Box<dyn SpawnNamed>,
|
||||
client: Arc<C>,
|
||||
parent_id: BlockId<Block>,
|
||||
parent_hash: Block::Hash,
|
||||
parent_number: <<Block as BlockT>::Header as HeaderT>::Number,
|
||||
transaction_pool: Arc<A>,
|
||||
now: Box<dyn Fn() -> time::Instant + Send + Sync>,
|
||||
@@ -344,7 +341,7 @@ where
|
||||
{
|
||||
let propose_with_start = time::Instant::now();
|
||||
let mut block_builder =
|
||||
self.client.new_block_at(&self.parent_id, inherent_digests, PR::ENABLED)?;
|
||||
self.client.new_block_at(self.parent_hash, inherent_digests, PR::ENABLED)?;
|
||||
|
||||
let create_inherents_start = time::Instant::now();
|
||||
let inherents = block_builder.create_inherents(inherent_data)?;
|
||||
@@ -559,7 +556,7 @@ mod tests {
|
||||
use sp_blockchain::HeaderBackend;
|
||||
use sp_consensus::{BlockOrigin, Environment, Proposer};
|
||||
use sp_core::Pair;
|
||||
use sp_runtime::traits::NumberFor;
|
||||
use sp_runtime::{generic::BlockId, traits::NumberFor};
|
||||
use substrate_test_runtime_client::{
|
||||
prelude::*,
|
||||
runtime::{Extrinsic, Transfer},
|
||||
|
||||
Reference in New Issue
Block a user