@@ -24,6 +24,7 @@ use sp_consensus::{
24
24
} ;
25
25
use sp_inherents:: InherentDataProviders ;
26
26
use sp_runtime:: traits:: { Block as BlockT , Header as HeaderT } ;
27
+ use sc_cli;
27
28
28
29
use polkadot_collator:: {
29
30
BuildParachainContext , InvalidHead , Network as CollatorNetwork , ParachainContext ,
@@ -43,7 +44,9 @@ use log::{error, trace};
43
44
44
45
use futures:: { task:: Spawn , Future , future} ;
45
46
46
- use std:: { fmt:: Debug , marker:: PhantomData , sync:: Arc , time:: Duration , pin:: Pin } ;
47
+ use std:: {
48
+ fmt:: Debug , marker:: PhantomData , sync:: Arc , time:: Duration , pin:: Pin , collections:: HashMap ,
49
+ } ;
47
50
48
51
use parking_lot:: Mutex ;
49
52
@@ -207,11 +210,12 @@ where
207
210
post_digests : vec ! [ ] ,
208
211
body : Some ( b. extrinsics ( ) . to_vec ( ) ) ,
209
212
finalized : false ,
213
+ intermediates : HashMap :: new ( ) ,
210
214
auxiliary : vec ! [ ] , // block-weight is written in block import.
211
215
// TODO: block-import handles fork choice and this shouldn't even have the
212
216
// option to specify one.
213
217
// https://github.com/paritytech/substrate/issues/3623
214
- fork_choice : ForkChoiceStrategy :: LongestChain ,
218
+ fork_choice : Some ( ForkChoiceStrategy :: LongestChain ) ,
215
219
allow_missing_state : false ,
216
220
import_existing : false ,
217
221
storage_changes : Some ( storage_changes) ,
@@ -342,20 +346,19 @@ pub trait SetupParachain<Block: BlockT>: Send {
342
346
}
343
347
344
348
/// Run a collator with the given proposer factory.
345
- pub fn run_collator < Block , SP , E > (
349
+ pub fn run_collator < Block , SP > (
346
350
setup_parachain : SP ,
347
351
para_id : ParaId ,
348
- exit : E ,
349
352
key : Arc < CollatorPair > ,
350
353
configuration : polkadot_collator:: Configuration ,
351
354
) -> Result < ( ) , sc_cli:: error:: Error >
352
355
where
353
356
Block : BlockT ,
354
357
SP : SetupParachain < Block > + Send + ' static ,
355
358
<<SP as SetupParachain < Block > >:: ProposerFactory as Environment < Block > >:: Proposer : Send ,
356
- E : Future < Output = ( ) > + Unpin + Send + Clone + Sync + ' static ,
357
359
{
358
360
let builder = CollatorBuilder :: new ( setup_parachain) ;
361
+ let exit = future:: pending ( ) ; // TODO to delete
359
362
polkadot_collator:: run_collator ( builder, para_id, exit, key, configuration)
360
363
}
361
364
@@ -518,7 +521,7 @@ mod tests {
518
521
let context = builder
519
522
. build :: < _ , _ , polkadot_service:: polkadot_runtime:: RuntimeApi , _ , _ > (
520
523
Arc :: new (
521
- substrate_test_client:: TestClientBuilder :: < _ , _ , ( ) > :: default ( )
524
+ substrate_test_client:: TestClientBuilder :: < _ , _ , _ , ( ) > :: default ( )
522
525
. build_with_native_executor ( Some ( NativeExecutor :: <
523
526
polkadot_service:: PolkadotExecutor ,
524
527
> :: new ( Interpreted , None ) ) )
0 commit comments