@@ -58,6 +58,8 @@ pub async fn bootstrap_aggregator(
58
58
)
59
59
. await ?;
60
60
61
+ restart_aggregator_and_move_one_epoch_forward ( & mut aggregator, current_epoch, args) . await ?;
62
+
61
63
info ! ( ">> Send the Signer Key Registrations payloads for the genesis signers" ) ;
62
64
let errors = fake_signer:: register_signers_to_aggregator (
63
65
& aggregator,
@@ -66,20 +68,8 @@ pub async fn bootstrap_aggregator(
66
68
)
67
69
. await ?;
68
70
assert_eq ! ( 0 , errors) ;
69
- aggregator. stop ( ) . await . unwrap ( ) ;
70
71
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 ?;
83
73
84
74
info ! ( ">> Send the Signer Key Registrations payloads for next genesis signers" ) ;
85
75
let errors = fake_signer:: register_signers_to_aggregator (
@@ -115,3 +105,26 @@ pub async fn bootstrap_aggregator(
115
105
116
106
Ok ( aggregator)
117
107
}
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