mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-16 23:41:02 +00:00
parachain-template: Simplify it (#3801)
Also while doing this, move slot duration fetching into the AURA code.
This commit is contained in:
@@ -42,7 +42,7 @@ use sp_api::{CallApiAt, ProvideRuntimeApi};
|
||||
use sp_application_crypto::AppPublic;
|
||||
use sp_blockchain::HeaderBackend;
|
||||
use sp_consensus::SyncOracle;
|
||||
use sp_consensus_aura::{AuraApi, SlotDuration};
|
||||
use sp_consensus_aura::AuraApi;
|
||||
use sp_core::crypto::Pair;
|
||||
use sp_inherents::CreateInherentDataProviders;
|
||||
use sp_keystore::KeystorePtr;
|
||||
@@ -74,8 +74,6 @@ pub struct Params<BI, CIDP, Client, RClient, SO, Proposer, CS> {
|
||||
pub para_id: ParaId,
|
||||
/// A handle to the relay-chain client's "Overseer" or task orchestrator.
|
||||
pub overseer_handle: OverseerHandle,
|
||||
/// The length of slots in this chain.
|
||||
pub slot_duration: SlotDuration,
|
||||
/// The length of slots in the relay chain.
|
||||
pub relay_chain_slot_duration: Duration,
|
||||
/// The underlying block proposer this should call into.
|
||||
@@ -197,11 +195,16 @@ where
|
||||
Ok(Some(h)) => h,
|
||||
};
|
||||
|
||||
let slot_duration = match params.para_client.runtime_api().slot_duration(parent_hash) {
|
||||
Ok(d) => d,
|
||||
Err(e) => reject_with_error!(e),
|
||||
};
|
||||
|
||||
let claim = match collator_util::claim_slot::<_, _, P>(
|
||||
&*params.para_client,
|
||||
parent_hash,
|
||||
&relay_parent_header,
|
||||
params.slot_duration,
|
||||
slot_duration,
|
||||
params.relay_chain_slot_duration,
|
||||
¶ms.keystore,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user