8181}
8282
8383/// Params required to start the instant sealing authorship task.
84- pub struct ManualSealParams < B : BlockT , BI , E , C : ProvideRuntimeApi < B > , TP , SC , CS , CIDP > {
84+ pub struct ManualSealParams < B : BlockT , BI , E , C : ProvideRuntimeApi < B > , TP , SC , CS , CIDP , P > {
8585 /// Block import instance for well. importing blocks.
8686 pub block_import : BI ,
8787
@@ -103,14 +103,14 @@ pub struct ManualSealParams<B: BlockT, BI, E, C: ProvideRuntimeApi<B>, TP, SC, C
103103
104104 /// Digest provider for inclusion in blocks.
105105 pub consensus_data_provider :
106- Option < Box < dyn ConsensusDataProvider < B , Transaction = TransactionFor < C , B > > > > ,
106+ Option < Box < dyn ConsensusDataProvider < B , Proof = P , Transaction = TransactionFor < C , B > > > > ,
107107
108108 /// Something that can create the inherent data providers.
109109 pub create_inherent_data_providers : CIDP ,
110110}
111111
112112/// Params required to start the manual sealing authorship task.
113- pub struct InstantSealParams < B : BlockT , BI , E , C : ProvideRuntimeApi < B > , TP , SC , CIDP > {
113+ pub struct InstantSealParams < B : BlockT , BI , E , C : ProvideRuntimeApi < B > , TP , SC , CIDP , P > {
114114 /// Block import instance for well. importing blocks.
115115 pub block_import : BI ,
116116
@@ -128,14 +128,14 @@ pub struct InstantSealParams<B: BlockT, BI, E, C: ProvideRuntimeApi<B>, TP, SC,
128128
129129 /// Digest provider for inclusion in blocks.
130130 pub consensus_data_provider :
131- Option < Box < dyn ConsensusDataProvider < B , Transaction = TransactionFor < C , B > > > > ,
131+ Option < Box < dyn ConsensusDataProvider < B , Proof = P , Transaction = TransactionFor < C , B > > > > ,
132132
133133 /// Something that can create the inherent data providers.
134134 pub create_inherent_data_providers : CIDP ,
135135}
136136
137137/// Creates the background authorship task for the manual seal engine.
138- pub async fn run_manual_seal < B , BI , CB , E , C , TP , SC , CS , CIDP > (
138+ pub async fn run_manual_seal < B , BI , CB , E , C , TP , SC , CS , CIDP , P > (
139139 ManualSealParams {
140140 mut block_import,
141141 mut env,
@@ -145,7 +145,7 @@ pub async fn run_manual_seal<B, BI, CB, E, C, TP, SC, CS, CIDP>(
145145 select_chain,
146146 consensus_data_provider,
147147 create_inherent_data_providers,
148- } : ManualSealParams < B , BI , E , C , TP , SC , CS , CIDP > ,
148+ } : ManualSealParams < B , BI , E , C , TP , SC , CS , CIDP , P > ,
149149) where
150150 B : BlockT + ' static ,
151151 BI : BlockImport < B , Error = sp_consensus:: Error , Transaction = sp_api:: TransactionFor < C , B > >
@@ -155,12 +155,13 @@ pub async fn run_manual_seal<B, BI, CB, E, C, TP, SC, CS, CIDP>(
155155 C : HeaderBackend < B > + Finalizer < B , CB > + ProvideRuntimeApi < B > + ' static ,
156156 CB : ClientBackend < B > + ' static ,
157157 E : Environment < B > + ' static ,
158- E :: Proposer : Proposer < B , Transaction = TransactionFor < C , B > > ,
158+ E :: Proposer : Proposer < B , Proof = P , Transaction = TransactionFor < C , B > > ,
159159 CS : Stream < Item = EngineCommand < <B as BlockT >:: Hash > > + Unpin + ' static ,
160160 SC : SelectChain < B > + ' static ,
161161 TransactionFor < C , B > : ' static ,
162162 TP : TransactionPool < Block = B > ,
163163 CIDP : CreateInherentDataProviders < B , ( ) > ,
164+ P : Send + Sync + ' static ,
164165{
165166 while let Some ( command) = commands_stream. next ( ) . await {
166167 match command {
@@ -198,7 +199,7 @@ pub async fn run_manual_seal<B, BI, CB, E, C, TP, SC, CS, CIDP>(
198199/// runs the background authorship task for the instant seal engine.
199200/// instant-seal creates a new block for every transaction imported into
200201/// the transaction pool.
201- pub async fn run_instant_seal < B , BI , CB , E , C , TP , SC , CIDP > (
202+ pub async fn run_instant_seal < B , BI , CB , E , C , TP , SC , CIDP , P > (
202203 InstantSealParams {
203204 block_import,
204205 env,
@@ -207,7 +208,7 @@ pub async fn run_instant_seal<B, BI, CB, E, C, TP, SC, CIDP>(
207208 select_chain,
208209 consensus_data_provider,
209210 create_inherent_data_providers,
210- } : InstantSealParams < B , BI , E , C , TP , SC , CIDP > ,
211+ } : InstantSealParams < B , BI , E , C , TP , SC , CIDP , P > ,
211212) where
212213 B : BlockT + ' static ,
213214 BI : BlockImport < B , Error = sp_consensus:: Error , Transaction = sp_api:: TransactionFor < C , B > >
@@ -217,11 +218,12 @@ pub async fn run_instant_seal<B, BI, CB, E, C, TP, SC, CIDP>(
217218 C : HeaderBackend < B > + Finalizer < B , CB > + ProvideRuntimeApi < B > + ' static ,
218219 CB : ClientBackend < B > + ' static ,
219220 E : Environment < B > + ' static ,
220- E :: Proposer : Proposer < B , Transaction = TransactionFor < C , B > > ,
221+ E :: Proposer : Proposer < B , Proof = P , Transaction = TransactionFor < C , B > > ,
221222 SC : SelectChain < B > + ' static ,
222223 TransactionFor < C , B > : ' static ,
223224 TP : TransactionPool < Block = B > ,
224225 CIDP : CreateInherentDataProviders < B , ( ) > ,
226+ P : Send + Sync + ' static ,
225227{
226228 // instant-seal creates blocks as soon as transactions are imported
227229 // into the transaction pool.
@@ -275,6 +277,7 @@ mod tests {
275277 C : ProvideRuntimeApi < B > + Send + Sync ,
276278 {
277279 type Transaction = TransactionFor < C , B > ;
280+ type Proof = ( ) ;
278281
279282 fn create_digest (
280283 & self ,
@@ -289,6 +292,7 @@ mod tests {
289292 _parent : & B :: Header ,
290293 params : & mut BlockImportParams < B , Self :: Transaction > ,
291294 _inherents : & InherentData ,
295+ _proof : Self :: Proof ,
292296 ) -> Result < ( ) , Error > {
293297 params. post_digests . push ( DigestItem :: Other ( vec ! [ 1 ] ) ) ;
294298 Ok ( ( ) )
0 commit comments