From e9ee9e6b2bfe12373ae129b0e532e17ac83b520d Mon Sep 17 00:00:00 2001 From: Thoralf-M Date: Tue, 31 Oct 2023 20:32:27 +0100 Subject: [PATCH] Review suggestions --- sdk/src/types/block/output/delegation.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sdk/src/types/block/output/delegation.rs b/sdk/src/types/block/output/delegation.rs index 979a68c738..f3a2a0f2c4 100644 --- a/sdk/src/types/block/output/delegation.rs +++ b/sdk/src/types/block/output/delegation.rs @@ -352,8 +352,7 @@ impl DelegationOutput { .ok_or(StateTransitionError::MissingCommitmentContextInput)?; let future_bounded_slot: SlotIndex = slot_commitment_id.slot_index() + protocol_parameters.min_committable_age; - let future_bounded_epoch = - EpochIndex::from_slot_index(future_bounded_slot, protocol_parameters.slots_per_epoch_exponent); + let future_bounded_epoch = future_bounded_slot.to_epoch_index(protocol_parameters.slots_per_epoch_exponent); let registration_slot = future_bounded_epoch.registration_slot( protocol_parameters.slots_per_epoch_exponent, @@ -363,7 +362,7 @@ impl DelegationOutput { let expected_end_epoch = if future_bounded_slot <= registration_slot { future_bounded_epoch } else { - EpochIndex(*future_bounded_epoch + 1) + future_bounded_epoch + 1 }; if next_state.end_epoch != expected_end_epoch {