From 93e984a5ea0ea9d9f501eb77d028982549dc3b31 Mon Sep 17 00:00:00 2001 From: Davide Galassi Date: Thu, 23 Mar 2023 15:39:37 +0100 Subject: [PATCH] Rename 'AppKey' to 'AppCrypto' --- polkadot-parachain/src/service.rs | 45 ++++++++++++++++--------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/polkadot-parachain/src/service.rs b/polkadot-parachain/src/service.rs index b83a3f84fc8..ee5ae0572a8 100644 --- a/polkadot-parachain/src/service.rs +++ b/polkadot-parachain/src/service.rs @@ -51,7 +51,7 @@ use sp_api::{ApiExt, ConstructRuntimeApi}; use sp_consensus_aura::AuraApi; use sp_keystore::KeystorePtr; use sp_runtime::{ - app_crypto::AppKey, + app_crypto::AppCrypto, traits::{BlakeTwo256, Header as HeaderT}, }; use std::{marker::PhantomData, sync::Arc, time::Duration}; @@ -1042,7 +1042,7 @@ where } /// Build the import queue for Statemint and other Aura-based runtimes. -pub fn aura_build_import_queue( +pub fn aura_build_import_queue( client: Arc>, block_import: ParachainBlockImport, config: &Configuration, @@ -1059,9 +1059,9 @@ where StateBackend = sc_client_api::StateBackendFor, > + sp_offchain::OffchainWorkerApi + sp_block_builder::BlockBuilder - + sp_consensus_aura::AuraApi::Pair as Pair>::Public>, + + sp_consensus_aura::AuraApi::Pair as Pair>::Public>, sc_client_api::StateBackendFor: sp_api::StateBackend, - <::Pair as Pair>::Signature: + <::Pair as Pair>::Signature: TryFrom> + std::hash::Hash + sp_runtime::traits::Member + Codec, { let client2 = client.clone(); @@ -1069,25 +1069,26 @@ where let aura_verifier = move || { let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client2).unwrap(); - Box::new( - cumulus_client_consensus_aura::build_verifier::<::Pair, _, _, _>( - cumulus_client_consensus_aura::BuildVerifierParams { - client: client2.clone(), - create_inherent_data_providers: move |_, _| async move { - let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - - let slot = + Box::new(cumulus_client_consensus_aura::build_verifier::< + ::Pair, + _, + _, + _, + >(cumulus_client_consensus_aura::BuildVerifierParams { + client: client2.clone(), + create_inherent_data_providers: move |_, _| async move { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + + let slot = sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( *timestamp, slot_duration, ); - Ok((slot, timestamp)) - }, - telemetry: telemetry_handle, - }, - ), - ) as Box<_> + Ok((slot, timestamp)) + }, + telemetry: telemetry_handle, + })) as Box<_> }; let relay_chain_verifier = @@ -1108,7 +1109,7 @@ where /// Start an aura powered parachain node. /// (collective-polkadot and statemine/t use this) -pub async fn start_generic_aura_node( +pub async fn start_generic_aura_node( parachain_config: Configuration, polkadot_config: Configuration, collator_options: CollatorOptions, @@ -1126,11 +1127,11 @@ where > + sp_offchain::OffchainWorkerApi + sp_block_builder::BlockBuilder + cumulus_primitives_core::CollectCollationInfo - + sp_consensus_aura::AuraApi::Pair as Pair>::Public> + + sp_consensus_aura::AuraApi::Pair as Pair>::Public> + pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi + frame_rpc_system::AccountNonceApi, sc_client_api::StateBackendFor: sp_api::StateBackend, - <::Pair as Pair>::Signature: + <::Pair as Pair>::Signature: TryFrom> + std::hash::Hash + sp_runtime::traits::Member + Codec, { start_node_impl::( @@ -1170,7 +1171,7 @@ where telemetry2.clone(), ); - AuraConsensus::build::<::Pair, _, _, _, _, _, _>( + AuraConsensus::build::<::Pair, _, _, _, _, _, _>( BuildAuraConsensusParams { proposer_factory, create_inherent_data_providers: