Adapt code to new sc-telemetry (#362)

This commit is contained in:
Cecile Tonglet
2021-03-11 13:45:02 +01:00
committed by GitHub
parent cb5a244f3d
commit a3d50f2dd7
9 changed files with 282 additions and 242 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ impl BlockAnnounceData {
///
/// This will not check the signature, for this you should use [`BlockAnnounceData::check_signature`].
fn validate(&self, encoded_header: Vec<u8>) -> Result<(), Validation> {
let candidate_hash = if let CompactStatement::Candidate(h) = self.statement.payload() {
let candidate_hash = if let CompactStatement::Seconded(h) = self.statement.payload() {
h
} else {
tracing::debug!(
+1
View File
@@ -14,6 +14,7 @@ cumulus-primitives-core = { path = "../../primitives/core" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
+3
View File
@@ -27,6 +27,7 @@ use sc_client_api::{
Backend as BackendT, BlockBackend, BlockchainEvents, Finalizer, UsageProvider,
};
use sc_service::{error::Result as ServiceResult, Configuration, Role, TaskManager};
use sc_telemetry::TelemetryWorkerHandle;
use sp_blockchain::HeaderBackend;
use sp_consensus::BlockImport;
use sp_core::traits::SpawnNamed;
@@ -233,6 +234,7 @@ pub fn prepare_node_config(mut parachain_config: Configuration) -> Configuration
pub fn build_polkadot_full_node(
config: Configuration,
collator_id: CollatorId,
telemetry_worker_handle: Option<TelemetryWorkerHandle>,
) -> Result<RFullNode<PClient>, polkadot_service::Error> {
let is_light = matches!(config.role, Role::Light);
if is_light {
@@ -245,6 +247,7 @@ pub fn build_polkadot_full_node(
polkadot_service::IsCollator::Yes(collator_id),
None,
None,
telemetry_worker_handle,
)
}
}