@@ -58,6 +58,8 @@ pub async fn bootstrap_aggregator(
5858 )
5959 . await ?;
6060
61+ restart_aggregator_and_move_one_epoch_forward ( & mut aggregator, current_epoch, args) . await ?;
62+
6163 info ! ( ">> Send the Signer Key Registrations payloads for the genesis signers" ) ;
6264 let errors = fake_signer:: register_signers_to_aggregator (
6365 & aggregator,
@@ -66,20 +68,8 @@ pub async fn bootstrap_aggregator(
6668 )
6769 . await ?;
6870 assert_eq ! ( 0 , errors) ;
69- aggregator. stop ( ) . await . unwrap ( ) ;
7071
71- info ! ( ">> Move one epoch forward in order to issue the genesis certificate" ) ;
72- * current_epoch += 1 ;
73- fake_chain:: set_epoch ( & args. mock_epoch_file_path ( ) , * current_epoch) ;
74-
75- info ! ( ">> Restarting the aggregator still with a large run interval" ) ;
76- aggregator. serve ( ) . unwrap ( ) ;
77- wait:: for_http_response (
78- & format ! ( "{}/epoch-settings" , aggregator. endpoint( ) ) ,
79- Duration :: from_secs ( 10 ) ,
80- "Waiting for the aggregator to start" ,
81- )
82- . await ?;
72+ restart_aggregator_and_move_one_epoch_forward ( & mut aggregator, current_epoch, args) . await ?;
8373
8474 info ! ( ">> Send the Signer Key Registrations payloads for next genesis signers" ) ;
8575 let errors = fake_signer:: register_signers_to_aggregator (
@@ -115,3 +105,26 @@ pub async fn bootstrap_aggregator(
115105
116106 Ok ( aggregator)
117107}
108+
109+ async fn restart_aggregator_and_move_one_epoch_forward (
110+ aggregator : & mut Aggregator ,
111+ current_epoch : & mut Epoch ,
112+ args : & AggregatorParameters ,
113+ ) -> StdResult < ( ) > {
114+ info ! ( ">> Stop the aggregator to move one epoch forward" ) ;
115+ aggregator. stop ( ) . await . unwrap ( ) ;
116+
117+ * current_epoch += 1 ;
118+ fake_chain:: set_epoch ( & args. mock_epoch_file_path ( ) , * current_epoch) ;
119+
120+ info ! ( ">> Restarting the aggregator with a large run interval" ) ;
121+ aggregator. serve ( ) . unwrap ( ) ;
122+ wait:: for_http_response (
123+ & format ! ( "{}/epoch-settings" , aggregator. endpoint( ) ) ,
124+ Duration :: from_secs ( 10 ) ,
125+ "Waiting for the aggregator to start" ,
126+ )
127+ . await ?;
128+
129+ Ok ( ( ) )
130+ }
0 commit comments