@@ -9,16 +9,15 @@ use mithril_aggregator::{
9
9
AggregatorRuntime , Configuration , DependencyContainer , DumbSnapshotUploader , DumbSnapshotter ,
10
10
SignerRegistrationError ,
11
11
} ;
12
- use mithril_common:: entities:: ProtocolMessagePartKey ;
13
12
use mithril_common:: {
14
13
cardano_block_scanner:: { DumbBlockScanner , ScannedBlock } ,
15
14
chain_observer:: { ChainObserver , FakeObserver } ,
16
15
crypto_helper:: ProtocolGenesisSigner ,
17
16
digesters:: { DumbImmutableDigester , DumbImmutableFileObserver } ,
18
17
entities:: {
19
18
BlockNumber , Certificate , CertificateSignature , ChainPoint , Epoch , ImmutableFileNumber ,
20
- SignedEntityType , SignedEntityTypeDiscriminants , SlotNumber , Snapshot , StakeDistribution ,
21
- TimePoint ,
19
+ ProtocolMessagePartKey , SignedEntityType , SignedEntityTypeDiscriminants ,
20
+ SingleSignatureAuthenticationStatus , SlotNumber , Snapshot , StakeDistribution , TimePoint ,
22
21
} ,
23
22
era:: { adapters:: EraReaderDummyAdapter , EraMarker , EraReader , SupportedEra } ,
24
23
test_utils:: {
@@ -380,11 +379,37 @@ impl RuntimeTester {
380
379
Ok ( ( ) )
381
380
}
382
381
383
- /// "Send", actually register, the given single signatures in the multi-signers
382
+ pub async fn send_authenticated_single_signatures (
383
+ & mut self ,
384
+ discriminant : SignedEntityTypeDiscriminants ,
385
+ signers : & [ SignerFixture ] ,
386
+ ) -> StdResult < ( ) > {
387
+ self . send_single_signatures_with_auth_status (
388
+ discriminant,
389
+ signers,
390
+ SingleSignatureAuthenticationStatus :: Authenticated ,
391
+ )
392
+ . await
393
+ }
394
+
384
395
pub async fn send_single_signatures (
385
396
& mut self ,
386
397
discriminant : SignedEntityTypeDiscriminants ,
387
398
signers : & [ SignerFixture ] ,
399
+ ) -> StdResult < ( ) > {
400
+ self . send_single_signatures_with_auth_status (
401
+ discriminant,
402
+ signers,
403
+ SingleSignatureAuthenticationStatus :: Unauthenticated ,
404
+ )
405
+ . await
406
+ }
407
+
408
+ async fn send_single_signatures_with_auth_status (
409
+ & mut self ,
410
+ discriminant : SignedEntityTypeDiscriminants ,
411
+ signers : & [ SignerFixture ] ,
412
+ authentication_status : SingleSignatureAuthenticationStatus ,
388
413
) -> StdResult < ( ) > {
389
414
let certifier_service = self . dependencies . certifier_service . clone ( ) ;
390
415
let signed_entity_type = self
@@ -411,7 +436,12 @@ impl RuntimeTester {
411
436
) ;
412
437
413
438
for signer_fixture in signers {
414
- if let Some ( single_signatures) = signer_fixture. sign ( & message) {
439
+ if let Some ( mut single_signatures) = signer_fixture. sign ( & message) {
440
+ if authentication_status == SingleSignatureAuthenticationStatus :: Authenticated {
441
+ single_signatures. authentication_status =
442
+ SingleSignatureAuthenticationStatus :: Authenticated ;
443
+ }
444
+
415
445
certifier_service
416
446
. register_single_signature ( & signed_entity_type, & single_signatures)
417
447
. await
0 commit comments