@@ -17,8 +17,8 @@ use mithril_aggregator::{
17
17
use mithril_common:: crypto_helper:: { key_encode_hex, ProtocolClerk , ProtocolGenesisSigner } ;
18
18
use mithril_common:: digesters:: DumbImmutableFileObserver ;
19
19
use mithril_common:: entities:: {
20
- Certificate , Epoch , ImmutableFileNumber , SignerWithStake , SingleSignatures , Snapshot ,
21
- StakeDistribution ,
20
+ Certificate , Epoch , ImmutableFileNumber , SignedEntityType , SignerWithStake , SingleSignatures ,
21
+ Snapshot , StakeDistribution ,
22
22
} ;
23
23
use mithril_common:: { chain_observer:: FakeObserver , digesters:: DumbImmutableDigester } ;
24
24
@@ -148,6 +148,13 @@ impl RuntimeTester {
148
148
. get_current_beacon ( )
149
149
. await
150
150
. map_err ( |e| format ! ( "Querying the current beacon should not fail: {e:?}" ) ) ?;
151
+ self . deps_builder
152
+ . get_certifier_service ( )
153
+ . await
154
+ . unwrap ( )
155
+ . inform_epoch ( beacon. epoch )
156
+ . await
157
+ . expect ( "inform_epoch should not fail" ) ;
151
158
let protocol_parameters = self
152
159
. deps_builder
153
160
. get_protocol_parameters_store ( )
@@ -221,6 +228,13 @@ impl RuntimeTester {
221
228
. await
222
229
. ok_or ( "a new epoch should have been issued" ) ?;
223
230
self . update_digester_digest ( ) . await ?;
231
+ self . deps_builder
232
+ . get_certifier_service ( )
233
+ . await
234
+ . unwrap ( )
235
+ . inform_epoch ( new_epoch)
236
+ . await
237
+ . expect ( "inform_epoch should not fail" ) ;
224
238
225
239
Ok ( new_epoch)
226
240
}
@@ -243,8 +257,10 @@ impl RuntimeTester {
243
257
/// "Send", actually register, the given single signatures in the multi-signers
244
258
pub async fn send_single_signatures (
245
259
& mut self ,
260
+ signed_entity_type : & SignedEntityType ,
246
261
signers : & [ SignerFixture ] ,
247
262
) -> Result < ( ) , String > {
263
+ let certifier_service = self . deps_builder . get_certifier_service ( ) . await . unwrap ( ) ;
248
264
let lock = self . deps_builder . get_multi_signer ( ) . await . unwrap ( ) ;
249
265
let multisigner = lock. read ( ) . await ;
250
266
let message = multisigner
@@ -263,8 +279,8 @@ impl RuntimeTester {
263
279
signature. indexes ,
264
280
) ;
265
281
266
- multisigner
267
- . register_single_signature ( & message , & single_signatures)
282
+ certifier_service
283
+ . register_single_signature ( signed_entity_type , & single_signatures)
268
284
. await
269
285
. map_err ( |e| {
270
286
format ! ( "registering a winning lottery signature should not fail: {e:?}" )
@@ -349,7 +365,7 @@ impl RuntimeTester {
349
365
Ok ( fixture. signers_fixture ( ) )
350
366
}
351
367
352
- // Update the digester result using the current beacon
368
+ /// Update the digester result using the current beacon
353
369
pub async fn update_digester_digest ( & mut self ) -> Result < ( ) , String > {
354
370
let beacon = self
355
371
. deps_builder
@@ -370,8 +386,30 @@ impl RuntimeTester {
370
386
Ok ( ( ) )
371
387
}
372
388
373
- // update the Era markers
389
+ /// Update the Era markers
374
390
pub async fn set_era_markers ( & self , markers : Vec < EraMarker > ) {
375
391
self . era_reader_adapter . set_markers ( markers)
376
392
}
393
+
394
+ /// Retrieve signed entity type
395
+ pub async fn retrieve_signed_entity_type ( & mut self ) -> SignedEntityType {
396
+ let signer_entity_type_default = SignedEntityType :: CardanoImmutableFilesFull (
397
+ self . deps_builder
398
+ . get_beacon_provider ( )
399
+ . await
400
+ . unwrap ( )
401
+ . get_current_beacon ( )
402
+ . await
403
+ . unwrap ( ) ,
404
+ ) ;
405
+ self . deps_builder
406
+ . get_certifier_service ( )
407
+ . await
408
+ . unwrap ( )
409
+ . get_open_message ( & signer_entity_type_default)
410
+ . await
411
+ . unwrap ( )
412
+ . map ( |om| om. signed_entity_type )
413
+ . unwrap ( )
414
+ }
377
415
}
0 commit comments