@@ -24,7 +24,11 @@ pub struct EpochSettingsMessage {
24
24
25
25
/// Cardano transactions signing configuration for the current epoch
26
26
#[ serde( skip_serializing_if = "Option::is_none" ) ]
27
- pub current_cardano_transactions_signing_config : Option < CardanoTransactionsSigningConfig > ,
27
+ pub cardano_transactions_signing_config : Option < CardanoTransactionsSigningConfig > ,
28
+
29
+ /// Cardano transactions signing configuration for the next epoch
30
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
31
+ pub next_cardano_transactions_signing_config : Option < CardanoTransactionsSigningConfig > ,
28
32
}
29
33
30
34
impl EpochSettingsMessage {
@@ -45,7 +49,8 @@ impl EpochSettingsMessage {
45
49
} ,
46
50
current_signers: [ SignerMessagePart :: dummy( ) ] . to_vec( ) ,
47
51
next_signers: [ SignerMessagePart :: dummy( ) ] . to_vec( ) ,
48
- current_cardano_transactions_signing_config: Some ( CardanoTransactionsSigningConfig :: dummy( ) ) ,
52
+ cardano_transactions_signing_config: Some ( CardanoTransactionsSigningConfig :: dummy( ) ) ,
53
+ next_cardano_transactions_signing_config: Some ( CardanoTransactionsSigningConfig :: dummy( ) ) ,
49
54
}
50
55
}
51
56
}
@@ -76,15 +81,20 @@ mod tests {
76
81
"operational_certificate":"certificate_456",
77
82
"kes_period":45
78
83
}],
79
- "current_cardano_transactions_signing_config ": {
84
+ "cardano_transactions_signing_config ": {
80
85
"security_parameter": 70,
81
86
"step": 20
87
+ },
88
+ "next_cardano_transactions_signing_config": {
89
+ "security_parameter": 50,
90
+ "step": 10
82
91
}
83
92
84
93
}"# ;
85
94
95
+ // Supported structure until OpenAPI version 0.1.28.
86
96
#[ derive( Clone , Debug , PartialEq , Default , Serialize , Deserialize ) ]
87
- pub struct EpochSettingsMessageLegacyVersion {
97
+ pub struct EpochSettingsMessageUntilV0_1_28 {
88
98
/// Current Epoch
89
99
pub epoch : Epoch ,
90
100
@@ -97,8 +107,9 @@ mod tests {
97
107
pub next_protocol_parameters : ProtocolParameters ,
98
108
}
99
109
110
+ // Supported structure until OpenAPI version 0.1.29.
100
111
#[ derive( Clone , Debug , PartialEq , Default , Serialize , Deserialize ) ]
101
- pub struct EpochSettingsMessagePreviousVersion {
112
+ pub struct EpochSettingsMessageUntilV0_1_29 {
102
113
/// Current Epoch
103
114
pub epoch : Epoch ,
104
115
@@ -117,8 +128,8 @@ mod tests {
117
128
pub next_signers : Vec < SignerMessagePart > ,
118
129
}
119
130
120
- fn golden_legacy_message ( ) -> EpochSettingsMessageLegacyVersion {
121
- EpochSettingsMessageLegacyVersion {
131
+ fn golden_message_until_open_api_0_1_28 ( ) -> EpochSettingsMessageUntilV0_1_28 {
132
+ EpochSettingsMessageUntilV0_1_28 {
122
133
epoch : Epoch ( 10 ) ,
123
134
protocol_parameters : ProtocolParameters {
124
135
k : 5 ,
@@ -133,8 +144,8 @@ mod tests {
133
144
}
134
145
}
135
146
136
- fn golden_previous_message ( ) -> EpochSettingsMessagePreviousVersion {
137
- EpochSettingsMessagePreviousVersion {
147
+ fn golden_message_until_open_api_0_1_29 ( ) -> EpochSettingsMessageUntilV0_1_29 {
148
+ EpochSettingsMessageUntilV0_1_29 {
138
149
epoch : Epoch ( 10 ) ,
139
150
protocol_parameters : ProtocolParameters {
140
151
k : 5 ,
@@ -190,33 +201,37 @@ mod tests {
190
201
operational_certificate: Some ( "certificate_456" . to_string( ) ) ,
191
202
kes_period: Some ( 45 ) ,
192
203
} ] ,
193
- current_cardano_transactions_signing_config : Some ( CardanoTransactionsSigningConfig {
204
+ cardano_transactions_signing_config : Some ( CardanoTransactionsSigningConfig {
194
205
security_parameter : BlockNumber ( 70 ) ,
195
206
step : BlockNumber ( 20 ) ,
196
207
} ) ,
208
+ next_cardano_transactions_signing_config : Some ( CardanoTransactionsSigningConfig {
209
+ security_parameter : BlockNumber ( 50 ) ,
210
+ step : BlockNumber ( 10 ) ,
211
+ } ) ,
197
212
}
198
213
}
199
214
200
- // Test the backward compatibility with legacy structure.
215
+ // Test the backward compatibility with the structure supported until OpenAPI version 0.1.28 .
201
216
#[ test]
202
- fn test_actual_json_deserialized_into_legacy_message ( ) {
217
+ fn test_actual_json_deserialized_into_message_supported_until_open_api_0_1_28 ( ) {
203
218
let json = ACTUAL_JSON ;
204
- let message: EpochSettingsMessageLegacyVersion = serde_json:: from_str ( json) . expect (
205
- "This JSON is expected to be successfully parsed into a EpochSettingsMessageLegacyVersion instance." ,
219
+ let message: EpochSettingsMessageUntilV0_1_28 = serde_json:: from_str ( json) . expect (
220
+ "This JSON is expected to be successfully parsed into a EpochSettingsMessageUntilVersion0_1_28 instance." ,
206
221
) ;
207
222
208
- assert_eq ! ( golden_legacy_message ( ) , message) ;
223
+ assert_eq ! ( golden_message_until_open_api_0_1_28 ( ) , message) ;
209
224
}
210
225
211
- // Test the backward compatibility with previous structure.
226
+ // Test the backward compatibility with the structure supported until OpenAPI version 0.1.29 .
212
227
#[ test]
213
- fn test_actual_json_deserialized_into_previous_message ( ) {
228
+ fn test_actual_json_deserialized_into_message_supported_until_open_api_0_1_29 ( ) {
214
229
let json = ACTUAL_JSON ;
215
- let message: EpochSettingsMessagePreviousVersion = serde_json:: from_str ( json) . expect (
216
- "This JSON is expected to be successfully parsed into a EpochSettingsMessagePreviousVersion instance." ,
230
+ let message: EpochSettingsMessageUntilV0_1_29 = serde_json:: from_str ( json) . expect (
231
+ "This JSON is expected to be successfully parsed into a EpochSettingsMessageUntilVersion0_1_29 instance." ,
217
232
) ;
218
233
219
- assert_eq ! ( golden_previous_message ( ) , message) ;
234
+ assert_eq ! ( golden_message_until_open_api_0_1_29 ( ) , message) ;
220
235
}
221
236
222
237
// Test the compatibility with current structure.
0 commit comments