@@ -2,6 +2,7 @@ use std::sync::Arc;
2
2
3
3
use async_trait:: async_trait;
4
4
use mithril_common:: crypto_helper:: ProtocolInitializer ;
5
+ use mithril_common:: entities:: CardanoTransactionsSigningConfig ;
5
6
use mithril_common:: entities:: Epoch ;
6
7
use mithril_common:: entities:: PartyId ;
7
8
use mithril_common:: entities:: ProtocolParameters ;
@@ -49,6 +50,11 @@ pub trait EpochService: Sync + Send {
49
50
/// Get signers with stake for the next epoch
50
51
async fn next_signers_with_stake ( & self ) -> StdResult < Vec < SignerWithStake > > ;
51
52
53
+ /// Get the cardano transactions signing configuration for the current epoch
54
+ fn current_cardano_transactions_signing_config (
55
+ & self ,
56
+ ) -> StdResult < & Option < CardanoTransactionsSigningConfig > > ;
57
+
52
58
/// Check if a signer is included in the current stake distribution
53
59
fn is_signer_included_in_current_stake_distribution (
54
60
& self ,
@@ -62,6 +68,7 @@ struct EpochData {
62
68
next_protocol_parameters : ProtocolParameters ,
63
69
current_signers : Vec < Signer > ,
64
70
next_signers : Vec < Signer > ,
71
+ current_cardano_transactions_signing_config : Option < CardanoTransactionsSigningConfig > ,
65
72
}
66
73
67
74
/// Implementation of the [epoch service][EpochService].
@@ -138,6 +145,8 @@ impl EpochService for MithrilEpochService {
138
145
next_protocol_parameters : epoch_settings. next_protocol_parameters ,
139
146
current_signers : epoch_settings. current_signers ,
140
147
next_signers : epoch_settings. next_signers ,
148
+ current_cardano_transactions_signing_config : epoch_settings
149
+ . current_cardano_transactions_signing_config ,
141
150
} ) ;
142
151
143
152
Ok ( ( ) )
@@ -177,6 +186,14 @@ impl EpochService for MithrilEpochService {
177
186
. await
178
187
}
179
188
189
+ fn current_cardano_transactions_signing_config (
190
+ & self ,
191
+ ) -> StdResult < & Option < CardanoTransactionsSigningConfig > > {
192
+ Ok ( & self
193
+ . unwrap_data ( ) ?
194
+ . current_cardano_transactions_signing_config )
195
+ }
196
+
180
197
fn is_signer_included_in_current_stake_distribution (
181
198
& self ,
182
199
party_id : PartyId ,
@@ -302,6 +319,9 @@ mod tests {
302
319
assert ! ( service. next_signers( ) . is_err( ) ) ;
303
320
assert ! ( service. current_signers_with_stake( ) . await . is_err( ) ) ;
304
321
assert ! ( service. next_signers_with_stake( ) . await . is_err( ) ) ;
322
+ assert ! ( service
323
+ . current_cardano_transactions_signing_config( )
324
+ . is_err( ) ) ;
305
325
}
306
326
307
327
#[ test]
@@ -350,6 +370,14 @@ mod tests {
350
370
epoch_settings. next_protocol_parameters,
351
371
* service. next_protocol_parameters( ) . unwrap( )
352
372
) ;
373
+
374
+ // Check current_cardano_transactions_signing_config
375
+ assert_eq ! (
376
+ epoch_settings. current_cardano_transactions_signing_config,
377
+ * service
378
+ . current_cardano_transactions_signing_config( )
379
+ . unwrap( )
380
+ )
353
381
}
354
382
355
383
#[ tokio:: test]
0 commit comments