Skip to content

Commit 7bd5017

Browse files
committed
refactor(signer): rename epoch variable comming from aggregator to avoid ambiguity
1 parent 85d6921 commit 7bd5017

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

mithril-signer/src/runtime/runner.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub trait Runner: Send + Sync {
4646
/// Register epoch information
4747
async fn inform_epoch_settings(
4848
&self,
49-
signer_epoch: Epoch,
49+
aggregator_signer_registration_epoch: Epoch,
5050
mithril_network_configuration: MithrilNetworkConfiguration,
5151
current_signer: Vec<Signer>,
5252
next_signer: Vec<Signer>,
@@ -265,22 +265,22 @@ impl Runner for SignerRunner {
265265

266266
async fn inform_epoch_settings(
267267
&self,
268-
signer_epoch: Epoch,
268+
aggregator_signer_registration_epoch: Epoch,
269269
mithril_network_configuration: MithrilNetworkConfiguration,
270270
current_signer: Vec<Signer>,
271271
next_signer: Vec<Signer>,
272272
) -> StdResult<()> {
273273
debug!(
274274
self.logger,
275-
">> inform_epoch_settings(epoch:{})", signer_epoch
275+
">> inform_epoch_settings(epoch:{})", aggregator_signer_registration_epoch
276276
);
277277

278278
self.services
279279
.epoch_service
280280
.write()
281281
.await
282282
.inform_epoch_settings(
283-
signer_epoch,
283+
aggregator_signer_registration_epoch,
284284
mithril_network_configuration,
285285
current_signer,
286286
next_signer,

mithril-signer/src/runtime/state_machine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ impl StateMachine {
298298
/// Launch the transition process from the `Unregistered` to `ReadyToSign` or `RegisteredNotAbleToSign` state.
299299
async fn transition_from_unregistered_to_one_of_registered_states(
300300
&self,
301-
signer_epoch: Epoch,
301+
aggregator_signer_registration_epoch: Epoch,
302302
mithril_network_configuration: MithrilNetworkConfiguration,
303303
current_signer: Vec<Signer>,
304304
next_signer: Vec<Signer>,
@@ -317,7 +317,7 @@ impl StateMachine {
317317
})?;
318318

319319
self.runner
320-
.inform_epoch_settings(signer_epoch, mithril_network_configuration, current_signer, next_signer)
320+
.inform_epoch_settings(aggregator_signer_registration_epoch, mithril_network_configuration, current_signer, next_signer)
321321
.await
322322
.map_err(|e| RuntimeError::KeepState {
323323
message: format!(

mithril-signer/src/services/epoch_service.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub trait EpochService: Sync + Send {
3636
/// internal state for the new epoch.
3737
async fn inform_epoch_settings(
3838
&mut self,
39-
signer_epoch: Epoch,
39+
aggregator_signer_registration_epoch: Epoch,
4040
mithril_network_configuration: MithrilNetworkConfiguration,
4141
current_signers: Vec<Signer>,
4242
next_signers: Vec<Signer>,
@@ -170,20 +170,22 @@ impl MithrilEpochService {
170170
impl EpochService for MithrilEpochService {
171171
async fn inform_epoch_settings(
172172
&mut self,
173-
signer_epoch: Epoch,
173+
aggregator_signer_registration_epoch: Epoch,
174174
mithril_network_configuration: MithrilNetworkConfiguration,
175175
current_signers: Vec<Signer>,
176176
next_signers: Vec<Signer>,
177177
) -> StdResult<()> {
178-
debug!(self.logger, ">> inform_epoch_settings"; "signer_epoch" => ?signer_epoch, "mithril_network_configuration" => ?mithril_network_configuration, "current_signers" => ?current_signers, "next_signers" => ?next_signers);
178+
debug!(self.logger, ">> inform_epoch_settings"; "aggregator_signer_registration_epoch" => ?aggregator_signer_registration_epoch, "mithril_network_configuration" => ?mithril_network_configuration, "current_signers" => ?current_signers, "next_signers" => ?next_signers);
179179

180180
let registration_protocol_parameters = mithril_network_configuration
181181
.signer_registration_protocol_parameters
182182
.clone();
183183

184184
let protocol_initializer = self
185185
.protocol_initializer_store
186-
.get_protocol_initializer(signer_epoch.offset_to_signer_retrieval_epoch()?)
186+
.get_protocol_initializer(
187+
aggregator_signer_registration_epoch.offset_to_signer_retrieval_epoch()?,
188+
)
187189
.await?;
188190

189191
let allowed_discriminants =
@@ -194,7 +196,7 @@ impl EpochService for MithrilEpochService {
194196
.clone();
195197

196198
self.epoch_data = Some(EpochData {
197-
epoch: signer_epoch,
199+
epoch: aggregator_signer_registration_epoch,
198200
registration_protocol_parameters,
199201
protocol_initializer,
200202
current_signers,
@@ -377,7 +379,7 @@ pub(crate) mod mock_epoch_service {
377379
impl EpochService for EpochServiceImpl {
378380
async fn inform_epoch_settings(
379381
&mut self,
380-
signer_epoch: Epoch,
382+
aggregator_signer_registration_epoch: Epoch,
381383
mithril_network_configuration: MithrilNetworkConfiguration,
382384
current_signers: Vec<Signer>,
383385
next_signers: Vec<Signer>,

0 commit comments

Comments
 (0)