Skip to content

Commit fd39355

Browse files
committed
Code clean
1 parent 75f0906 commit fd39355

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

node/src/service/mod.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ where
299299
telemetry_worker_handle,
300300
),
301301
} = new_partial::<RuntimeApi, Executor>(&parachain_config, eth_rpc_config)?;
302-
303302
let (relay_chain_interface, collator_key) =
304303
cumulus_client_service::build_relay_chain_interface(
305304
polkadot_config,
@@ -311,12 +310,10 @@ where
311310
)
312311
.await
313312
.map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;
314-
315313
let validator = parachain_config.role.is_authority();
316314
let prometheus_registry = parachain_config.prometheus_registry().cloned();
317315
let import_queue_service = import_queue.service();
318316
let net_config = sc_network::config::FullNetworkConfiguration::new(&parachain_config.network);
319-
320317
let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
321318
cumulus_client_service::build_network(cumulus_client_service::BuildNetworkParams {
322319
parachain_config: &parachain_config,
@@ -701,10 +698,10 @@ pub fn start_dev_node<RuntimeApi, Executor>(
701698
eth_rpc_config: &crate::cli::EthRpcConfig,
702699
) -> Result<sc_service::TaskManager, sc_service::error::Error>
703700
where
704-
RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, Executor>>
701+
RuntimeApi: 'static
705702
+ Send
706703
+ Sync
707-
+ 'static,
704+
+ sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, Executor>>,
708705
RuntimeApi::RuntimeApi: RuntimeApiCollection,
709706
RuntimeApi::RuntimeApi:
710707
sp_consensus_aura::AuraApi<Block, sp_consensus_aura::sr25519::AuthorityId>,
@@ -733,7 +730,6 @@ where
733730
),
734731
} = new_partial::<RuntimeApi, Executor>(&config, eth_rpc_config)?;
735732
let net_config = sc_network::config::FullNetworkConfiguration::new(&config.network);
736-
737733
let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
738734
sc_service::build_network(sc_service::BuildNetworkParams {
739735
config: &config,
@@ -770,17 +766,17 @@ where
770766
}
771767

772768
let force_authoring = config.force_authoring;
773-
let backoff_authoring_blocks: Option<()> = None;
769+
let backoff_authoring_blocks = <Option<()>>::None;
770+
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
774771
let proposer_factory = sc_basic_authorship::ProposerFactory::new(
775772
task_manager.spawn_handle(),
776773
client.clone(),
777774
transaction_pool.clone(),
778775
None,
779776
None,
780777
);
781-
782-
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
783778
let client_for_cidp = client.clone();
779+
784780
if config.role.is_authority() {
785781
let aura = sc_consensus_aura::start_aura::<
786782
sp_consensus_aura::sr25519::AuthorityPair,
@@ -795,7 +791,7 @@ where
795791
_,
796792
_,
797793
>(sc_consensus_aura::StartAuraParams {
798-
slot_duration: sc_consensus_aura::slot_duration(&*client)?,
794+
slot_duration,
799795
client: client.clone(),
800796
select_chain,
801797
block_import: instant_finalize::InstantFinalizeBlockImport::new(client.clone()),
@@ -900,8 +896,6 @@ where
900896
let collator = config.role.is_authority();
901897
let eth_rpc_config = eth_rpc_config.clone();
902898
let sync_service = sync_service.clone();
903-
904-
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
905899
let pending_create_inherent_data_providers = move |_, ()| async move {
906900
let current = sp_timestamp::InherentDataProvider::from_system_time();
907901
let next_slot = current.timestamp().as_millis() + slot_duration.as_millis();

0 commit comments

Comments
 (0)