@@ -3,7 +3,7 @@ use async_trait::async_trait;
3
3
use slog:: { Logger , debug, warn} ;
4
4
5
5
use mithril_common:: {
6
- StdResult ,
6
+ AggregateSignatureType , StdResult ,
7
7
crypto_helper:: { ProtocolAggregationError , ProtocolMultiSignature } ,
8
8
entities:: { self } ,
9
9
logging:: LoggerExtensions ,
@@ -40,16 +40,22 @@ pub trait MultiSigner: Sync + Send {
40
40
41
41
/// MultiSignerImpl is an implementation of the MultiSigner
42
42
pub struct MultiSignerImpl {
43
+ aggregate_signature_type : AggregateSignatureType ,
43
44
epoch_service : EpochServiceWrapper ,
44
45
logger : Logger ,
45
46
}
46
47
47
48
impl MultiSignerImpl {
48
49
/// 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 {
50
55
let logger = logger. new_with_component_name :: < Self > ( ) ;
51
56
debug ! ( logger, "New MultiSignerImpl created" ) ;
52
57
Self {
58
+ aggregate_signature_type,
53
59
epoch_service,
54
60
logger,
55
61
}
@@ -121,6 +127,7 @@ impl MultiSigner for MultiSignerImpl {
121
127
match protocol_multi_signer. aggregate_single_signatures (
122
128
& open_message. single_signatures ,
123
129
& open_message. protocol_message ,
130
+ self . aggregate_signature_type ,
124
131
) {
125
132
Ok ( multi_signature) => Ok ( Some ( multi_signature) ) ,
126
133
Err ( ProtocolAggregationError :: NotEnoughSignatures ( actual, expected) ) => {
@@ -183,6 +190,7 @@ mod tests {
183
190
let fixture = MithrilFixtureBuilder :: default ( ) . with_signers ( 5 ) . build ( ) ;
184
191
let next_fixture = MithrilFixtureBuilder :: default ( ) . with_signers ( 4 ) . build ( ) ;
185
192
let multi_signer = MultiSignerImpl :: new (
193
+ AggregateSignatureType :: default ( ) ,
186
194
Arc :: new ( RwLock :: new (
187
195
FakeEpochServiceBuilder {
188
196
current_epoch_settings : AggregatorEpochSettings {
@@ -243,6 +251,7 @@ mod tests {
243
251
let fixture = MithrilFixtureBuilder :: default ( ) . with_signers ( 5 ) . build ( ) ;
244
252
let protocol_parameters = fixture. protocol_parameters ( ) ;
245
253
let multi_signer = MultiSignerImpl :: new (
254
+ AggregateSignatureType :: default ( ) ,
246
255
Arc :: new ( RwLock :: new ( FakeEpochService :: from_fixture ( epoch, & fixture) ) ) ,
247
256
TestLogger :: stdout ( ) ,
248
257
) ;
0 commit comments