@@ -3,7 +3,7 @@ use async_trait::async_trait;
33use slog:: { Logger , debug, warn} ;
44
55use mithril_common:: {
6- StdResult ,
6+ AggregateSignatureType , StdResult ,
77 crypto_helper:: { ProtocolAggregationError , ProtocolMultiSignature } ,
88 entities:: { self } ,
99 logging:: LoggerExtensions ,
@@ -40,16 +40,22 @@ pub trait MultiSigner: Sync + Send {
4040
4141/// MultiSignerImpl is an implementation of the MultiSigner
4242pub struct MultiSignerImpl {
43+ aggregate_signature_type : AggregateSignatureType ,
4344 epoch_service : EpochServiceWrapper ,
4445 logger : Logger ,
4546}
4647
4748impl MultiSignerImpl {
4849 /// MultiSignerImpl factory
49- pub fn new ( epoch_service : EpochServiceWrapper , logger : Logger ) -> Self {
50+ pub fn new (
51+ aggregate_signature_type : AggregateSignatureType ,
52+ epoch_service : EpochServiceWrapper ,
53+ logger : Logger ,
54+ ) -> Self {
5055 let logger = logger. new_with_component_name :: < Self > ( ) ;
5156 debug ! ( logger, "New MultiSignerImpl created" ) ;
5257 Self {
58+ aggregate_signature_type,
5359 epoch_service,
5460 logger,
5561 }
@@ -121,6 +127,7 @@ impl MultiSigner for MultiSignerImpl {
121127 match protocol_multi_signer. aggregate_single_signatures (
122128 & open_message. single_signatures ,
123129 & open_message. protocol_message ,
130+ self . aggregate_signature_type ,
124131 ) {
125132 Ok ( multi_signature) => Ok ( Some ( multi_signature) ) ,
126133 Err ( ProtocolAggregationError :: NotEnoughSignatures ( actual, expected) ) => {
@@ -183,6 +190,7 @@ mod tests {
183190 let fixture = MithrilFixtureBuilder :: default ( ) . with_signers ( 5 ) . build ( ) ;
184191 let next_fixture = MithrilFixtureBuilder :: default ( ) . with_signers ( 4 ) . build ( ) ;
185192 let multi_signer = MultiSignerImpl :: new (
193+ AggregateSignatureType :: default ( ) ,
186194 Arc :: new ( RwLock :: new (
187195 FakeEpochServiceBuilder {
188196 current_epoch_settings : AggregatorEpochSettings {
@@ -243,6 +251,7 @@ mod tests {
243251 let fixture = MithrilFixtureBuilder :: default ( ) . with_signers ( 5 ) . build ( ) ;
244252 let protocol_parameters = fixture. protocol_parameters ( ) ;
245253 let multi_signer = MultiSignerImpl :: new (
254+ AggregateSignatureType :: default ( ) ,
246255 Arc :: new ( RwLock :: new ( FakeEpochService :: from_fixture ( epoch, & fixture) ) ) ,
247256 TestLogger :: stdout ( ) ,
248257 ) ;
0 commit comments