@@ -2,6 +2,8 @@ use std::collections::BTreeSet;
2
2
3
3
use serde:: { Deserialize , Serialize } ;
4
4
5
+ use mithril_stm:: AggregateSignatureType ;
6
+
5
7
use crate :: entities:: SignedEntityTypeDiscriminants ;
6
8
7
9
/// Message advertised by an Aggregator to inform about its features
@@ -23,6 +25,9 @@ pub struct AggregatorCapabilities {
23
25
/// Signed entity types that are signed by the aggregator
24
26
pub signed_entity_types : BTreeSet < SignedEntityTypeDiscriminants > ,
25
27
28
+ /// Aggregate signature type used by the aggregator
29
+ pub aggregate_signature_type : AggregateSignatureType ,
30
+
26
31
/// Cardano transactions prover capabilities
27
32
#[ serde( skip_serializing_if = "Option::is_none" ) ]
28
33
pub cardano_transactions_prover : Option < CardanoTransactionsProverCapabilities > ,
@@ -73,6 +78,38 @@ mod tests {
73
78
}
74
79
}
75
80
81
+ #[ derive( Debug , Serialize , Deserialize , PartialEq ) ]
82
+ struct AggregatorFeaturesMessageUntilV0_6_17 {
83
+ pub open_api_version : String ,
84
+ pub documentation_url : String ,
85
+ pub capabilities : AggregatorCapabilitiesUntilV0_6_17 ,
86
+ }
87
+
88
+ #[ derive( Debug , Serialize , Deserialize , PartialEq ) ]
89
+ struct AggregatorCapabilitiesUntilV0_6_17 {
90
+ pub signed_entity_types : BTreeSet < SignedEntityTypeDiscriminants > ,
91
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
92
+ pub cardano_transactions_prover : Option < CardanoTransactionsProverCapabilities > ,
93
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
94
+ pub cardano_transactions_signing_config : Option < CardanoTransactionsSigningConfig > ,
95
+ }
96
+
97
+ fn golden_message_until_open_api_0_6_17 ( ) -> AggregatorFeaturesMessageUntilV0_6_17 {
98
+ AggregatorFeaturesMessageUntilV0_6_17 {
99
+ open_api_version : "0.0.1" . to_string ( ) ,
100
+ documentation_url : "https://example.com" . to_string ( ) ,
101
+ capabilities : AggregatorCapabilitiesUntilV0_6_17 {
102
+ signed_entity_types : BTreeSet :: from ( [
103
+ SignedEntityTypeDiscriminants :: CardanoTransactions ,
104
+ ] ) ,
105
+ cardano_transactions_prover : Some ( CardanoTransactionsProverCapabilities {
106
+ max_hashes_allowed_by_request : 100 ,
107
+ } ) ,
108
+ cardano_transactions_signing_config : None ,
109
+ } ,
110
+ }
111
+ }
112
+
76
113
fn golden_message_current ( ) -> AggregatorFeaturesMessage {
77
114
AggregatorFeaturesMessage {
78
115
open_api_version : "0.0.1" . to_string ( ) ,
@@ -81,6 +118,7 @@ mod tests {
81
118
signed_entity_types : BTreeSet :: from ( [
82
119
SignedEntityTypeDiscriminants :: CardanoTransactions ,
83
120
] ) ,
121
+ aggregate_signature_type : AggregateSignatureType :: Concatenation ,
84
122
cardano_transactions_prover : Some ( CardanoTransactionsProverCapabilities {
85
123
max_hashes_allowed_by_request : 100 ,
86
124
} ) ,
@@ -93,6 +131,7 @@ mod tests {
93
131
"documentation_url": "https://example.com",
94
132
"capabilities": {
95
133
"signed_entity_types": ["CardanoTransactions"],
134
+ "aggregate_signature_type": "Concatenation",
96
135
"cardano_transactions_prover": {
97
136
"max_hashes_allowed_by_request": 100
98
137
}
@@ -107,6 +146,14 @@ mod tests {
107
146
assert_eq ! ( golden_message_until_open_api_0_1_45( ) , message) ;
108
147
}
109
148
149
+ #[ test]
150
+ fn test_current_json_deserialized_into_message_supported_until_open_api_0_6_17 ( ) {
151
+ let json = CURRENT_JSON ;
152
+ let message: AggregatorFeaturesMessageUntilV0_6_17 = serde_json:: from_str ( json) . unwrap ( ) ;
153
+
154
+ assert_eq ! ( golden_message_until_open_api_0_6_17( ) , message) ;
155
+ }
156
+
110
157
#[ test]
111
158
fn test_current_json_deserialized_into_current_message ( ) {
112
159
let json = CURRENT_JSON ;
0 commit comments