Skip to content
Snippets Groups Projects

Refactor node implementation

Merged Benjamin Gallois requested to merge 216-refactor-node into master
1 file
+ 10
11
Compare changes
  • Side-by-side
  • Inline
+ 10
11
@@ -29,6 +29,7 @@ use sc_consensus_manual_seal::{run_manual_seal, EngineCommand, ManualSealParams}
@@ -29,6 +29,7 @@ use sc_consensus_manual_seal::{run_manual_seal, EngineCommand, ManualSealParams}
use sc_service::WarpSyncParams;
use sc_service::WarpSyncParams;
use sc_service::{error::Error as ServiceError, Configuration, PartialComponents, TaskManager};
use sc_service::{error::Error as ServiceError, Configuration, PartialComponents, TaskManager};
use sc_telemetry::{Telemetry, TelemetryWorker};
use sc_telemetry::{Telemetry, TelemetryWorker};
 
use sp_consensus_babe::inherents::InherentDataProvider;
use sp_core::H256;
use sp_core::H256;
use sp_runtime::traits::BlakeTwo256;
use sp_runtime::traits::BlakeTwo256;
use std::{sync::Arc, time::Duration};
use std::{sync::Arc, time::Duration};
@@ -256,11 +257,10 @@ where
@@ -256,11 +257,10 @@ where
create_inherent_data_providers: move |_, ()| async move {
create_inherent_data_providers: move |_, ()| async move {
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
let slot =
let slot = InherentDataProvider::from_timestamp_and_slot_duration(
sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
*timestamp,
*timestamp,
slot_duration,
slot_duration,
);
);
Ok((slot, timestamp))
Ok((slot, timestamp))
},
},
@@ -477,7 +477,7 @@ where
@@ -477,7 +477,7 @@ where
client.clone(),
client.clone(),
)
)
.map_err(|err| format!("{:?}", err))?;
.map_err(|err| format!("{:?}", err))?;
let babe = sp_consensus_babe::inherents::InherentDataProvider::new(
let babe = InherentDataProvider::new(
timestamp.slot(),
timestamp.slot(),
);
);
let distance =
let distance =
@@ -517,11 +517,10 @@ where
@@ -517,11 +517,10 @@ where
async move {
async move {
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
let slot =
let slot = InherentDataProvider::from_timestamp_and_slot_duration(
sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
*timestamp,
*timestamp,
slot_duration,
slot_duration,
);
);
let storage_proof =
let storage_proof =
sp_transaction_storage_proof::registration::new_data_provider(
sp_transaction_storage_proof::registration::new_data_provider(
Loading