3030//!
3131//! NOTE: Aura itself is designed to be generic over the crypto used.
3232#![ forbid( missing_docs, unsafe_code) ]
33- use std:: { fmt:: Debug , hash :: Hash , marker:: PhantomData , pin:: Pin , sync:: Arc } ;
33+ use std:: { fmt:: Debug , marker:: PhantomData , pin:: Pin , sync:: Arc } ;
3434
35+ use codec:: Codec ;
3536use futures:: prelude:: * ;
3637
37- use codec:: { Codec , Decode , Encode } ;
38-
3938use sc_client_api:: { backend:: AuxStore , BlockOf } ;
4039use sc_consensus:: { BlockImport , BlockImportParams , ForkChoiceStrategy , StateAction } ;
4140use sc_consensus_slots:: {
@@ -48,7 +47,7 @@ use sp_application_crypto::AppPublic;
4847use sp_blockchain:: HeaderBackend ;
4948use sp_consensus:: { BlockOrigin , Environment , Error as ConsensusError , Proposer , SelectChain } ;
5049use sp_consensus_slots:: Slot ;
51- use sp_core:: crypto:: { Pair , Public } ;
50+ use sp_core:: crypto:: Pair ;
5251use sp_inherents:: CreateInherentDataProviders ;
5352use sp_keystore:: KeystorePtr ;
5453use sp_runtime:: traits:: { Block as BlockT , Header , Member , NumberFor } ;
@@ -172,9 +171,9 @@ pub fn start_aura<P, B, C, SC, I, PF, SO, L, CIDP, BS, Error>(
172171 } : StartAuraParams < C , SC , I , PF , SO , L , CIDP , BS , NumberFor < B > > ,
173172) -> Result < impl Future < Output = ( ) > , ConsensusError >
174173where
175- P : Pair + Send + Sync ,
176- P :: Public : AppPublic + Hash + Member + Encode + Decode ,
177- P :: Signature : TryFrom < Vec < u8 > > + Hash + Member + Encode + Decode ,
174+ P : Pair ,
175+ P :: Public : AppPublic + Member ,
176+ P :: Signature : TryFrom < Vec < u8 > > + Member + Codec ,
178177 B : BlockT ,
179178 C : ProvideRuntimeApi < B > + BlockOf + AuxStore + HeaderBackend < B > + Send + Sync ,
180179 C :: Api : AuraApi < B , AuthorityId < P > > ,
@@ -281,9 +280,9 @@ where
281280 C :: Api : AuraApi < B , AuthorityId < P > > ,
282281 PF : Environment < B , Error = Error > + Send + Sync + ' static ,
283282 PF :: Proposer : Proposer < B , Error = Error , Transaction = sp_api:: TransactionFor < C , B > > ,
284- P : Pair + Send + Sync ,
285- P :: Public : AppPublic + Hash + Member + Encode + Decode ,
286- P :: Signature : TryFrom < Vec < u8 > > + Hash + Member + Encode + Decode ,
283+ P : Pair ,
284+ P :: Public : AppPublic + Member ,
285+ P :: Signature : TryFrom < Vec < u8 > > + Member + Codec ,
287286 I : BlockImport < B , Transaction = sp_api:: TransactionFor < C , B > > + Send + Sync + ' static ,
288287 Error : std:: error:: Error + Send + From < ConsensusError > + ' static ,
289288 SO : SyncOracle + Send + Sync + Clone ,
@@ -303,7 +302,7 @@ where
303302 block_proposal_slot_portion,
304303 max_block_proposal_slot_portion,
305304 compatibility_mode,
306- _key_type : PhantomData :: < P > ,
305+ _phantom : PhantomData :: < fn ( ) -> P > ,
307306 }
308307}
309308
@@ -320,7 +319,7 @@ struct AuraWorker<C, E, I, P, SO, L, BS, N> {
320319 max_block_proposal_slot_portion : Option < SlotProportion > ,
321320 telemetry : Option < TelemetryHandle > ,
322321 compatibility_mode : CompatibilityMode < N > ,
323- _key_type : PhantomData < P > ,
322+ _phantom : PhantomData < fn ( ) -> P > ,
324323}
325324
326325#[ async_trait:: async_trait]
@@ -333,9 +332,9 @@ where
333332 E : Environment < B , Error = Error > + Send + Sync ,
334333 E :: Proposer : Proposer < B , Error = Error , Transaction = sp_api:: TransactionFor < C , B > > ,
335334 I : BlockImport < B , Transaction = sp_api:: TransactionFor < C , B > > + Send + Sync + ' static ,
336- P : Pair + Send + Sync ,
337- P :: Public : AppPublic + Public + Member + Encode + Decode + Hash ,
338- P :: Signature : TryFrom < Vec < u8 > > + Member + Encode + Decode + Hash + Debug ,
335+ P : Pair ,
336+ P :: Public : AppPublic + Member ,
337+ P :: Signature : TryFrom < Vec < u8 > > + Member + Codec ,
339338 SO : SyncOracle + Send + Clone + Sync ,
340339 L : sc_consensus:: JustificationSyncLink < B > ,
341340 BS : BackoffAuthoringBlocksStrategy < NumberFor < B > > + Send + Sync + ' static ,
@@ -806,10 +805,10 @@ mod tests {
806805 force_authoring : false ,
807806 backoff_authoring_blocks : Some ( BackoffAuthoringOnFinalizedHeadLagging :: default ( ) ) ,
808807 telemetry : None ,
809- _key_type : PhantomData :: < AuthorityPair > ,
810808 block_proposal_slot_portion : SlotProportion :: new ( 0.5 ) ,
811809 max_block_proposal_slot_portion : None ,
812810 compatibility_mode : Default :: default ( ) ,
811+ _phantom : PhantomData :: < fn ( ) -> AuthorityPair > ,
813812 } ;
814813
815814 let head = Header :: new (
@@ -856,10 +855,10 @@ mod tests {
856855 force_authoring : false ,
857856 backoff_authoring_blocks : Option :: < ( ) > :: None ,
858857 telemetry : None ,
859- _key_type : PhantomData :: < AuthorityPair > ,
860858 block_proposal_slot_portion : SlotProportion :: new ( 0.5 ) ,
861859 max_block_proposal_slot_portion : None ,
862860 compatibility_mode : Default :: default ( ) ,
861+ _phantom : PhantomData :: < fn ( ) -> AuthorityPair > ,
863862 } ;
864863
865864 let head = client. expect_header ( client. info ( ) . genesis_hash ) . unwrap ( ) ;
0 commit comments