From 83ad8ef74c11e069b2bfaf6489d91c37478675b7 Mon Sep 17 00:00:00 2001 From: bgallois <benjamin@gallois.cc> Date: Mon, 18 Mar 2024 13:52:26 +0100 Subject: [PATCH] fix formatting --- node/src/command.rs | 4 +--- node/src/service.rs | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/node/src/command.rs b/node/src/command.rs index 83ab2b62d..fa6900d93 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -20,8 +20,6 @@ pub mod key; pub mod utils; -#[cfg(feature = "gtest")] -use crate::chain_spec::gtest; use crate::cli::{Cli, Subcommand}; use crate::service::runtime_executor::Executor; use crate::service::RuntimeType; @@ -134,7 +132,7 @@ impl SubstrateCli for Cli { #[cfg(feature = "gtest")] "gtest_live" => { const JSON_CLIENT_SPEC: &str = "./node/specs/gtest_client-specs.yaml"; - let client_spec: gtest::ClientSpec = serde_yaml::from_slice( + let client_spec: chain_spec::gtest::ClientSpec = serde_yaml::from_slice( &std::fs::read( std::env::var("DUNITER_CLIENT_SPEC") .unwrap_or_else(|_| JSON_CLIENT_SPEC.to_string()), diff --git a/node/src/service.rs b/node/src/service.rs index e52f1f127..e8375a7af 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -29,6 +29,7 @@ use sc_consensus_manual_seal::{run_manual_seal, EngineCommand, ManualSealParams} use sc_service::WarpSyncParams; use sc_service::{error::Error as ServiceError, Configuration, PartialComponents, TaskManager}; use sc_telemetry::{Telemetry, TelemetryWorker}; +use sp_consensus_babe::inherents::InherentDataProvider; use sp_core::H256; use sp_runtime::traits::BlakeTwo256; use std::{sync::Arc, time::Duration}; @@ -256,11 +257,10 @@ where create_inherent_data_providers: move |_, ()| async move { let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - let slot = - sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration( - *timestamp, - slot_duration, - ); + let slot = InherentDataProvider::from_timestamp_and_slot_duration( + *timestamp, + slot_duration, + ); Ok((slot, timestamp)) }, @@ -477,7 +477,7 @@ where client.clone(), ) .map_err(|err| format!("{:?}", err))?; - let babe = sp_consensus_babe::inherents::InherentDataProvider::new( + let babe = InherentDataProvider::new( timestamp.slot(), ); let distance = @@ -517,11 +517,10 @@ where async move { let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - let slot = - sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration( - *timestamp, - slot_duration, - ); + let slot = InherentDataProvider::from_timestamp_and_slot_duration( + *timestamp, + slot_duration, + ); let storage_proof = sp_transaction_storage_proof::registration::new_data_provider( -- GitLab