From 36874e466f782f67193819402dfa8e53e1148534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thoralf=20M=C3=BCller?= Date: Thu, 26 Oct 2023 15:56:49 +0200 Subject: [PATCH] Resolve conflicts --- sdk/src/client/secret/mod.rs | 2 +- sdk/src/types/block/output/delegation.rs | 17 +++++------------ sdk/src/types/block/slot/epoch.rs | 2 +- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/sdk/src/client/secret/mod.rs b/sdk/src/client/secret/mod.rs index 682677e323..49504d7a74 100644 --- a/sdk/src/client/secret/mod.rs +++ b/sdk/src/client/secret/mod.rs @@ -47,7 +47,7 @@ use crate::{ api::{ input_selection::{is_account_transition, Error as InputSelectionError}, transaction::validate_signed_transaction_payload_length, - verify_semantic, PreparedTransactionData, PreparedTransactionData, + verify_semantic, PreparedTransactionData, }, Error, }, diff --git a/sdk/src/types/block/output/delegation.rs b/sdk/src/types/block/output/delegation.rs index 089bd89998..0355e605af 100644 --- a/sdk/src/types/block/output/delegation.rs +++ b/sdk/src/types/block/output/delegation.rs @@ -47,11 +47,7 @@ impl From<&OutputId> for DelegationId { impl DelegationId { pub fn or_from_output_id(self, output_id: &OutputId) -> Self { - if self.is_null() { - Self::from(output_id) - } else { - self - } + if self.is_null() { Self::from(output_id) } else { self } } } @@ -391,11 +387,8 @@ 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, - core::iter::once((EpochIndex::new(0), protocol_parameters.slots_per_epoch_exponent)), - ) - .unwrap(); + let future_bounded_epoch = + EpochIndex::from_slot_index(future_bounded_slot, protocol_parameters.slots_per_epoch_exponent); let registration_slot = future_bounded_epoch.registration_slot( protocol_parameters.slots_per_epoch_exponent, @@ -405,7 +398,7 @@ impl DelegationOutput { let expected_end_epoch = if future_bounded_slot <= registration_slot { future_bounded_epoch } else { - EpochIndex::new(*future_bounded_epoch + 1) + EpochIndex(*future_bounded_epoch + 1) }; if next_state.end_epoch != expected_end_epoch { @@ -441,7 +434,7 @@ impl StateTransitionVerifier for DelegationOutput { Self::transition_inner( current_state, next_state, - context.essence.context_inputs(), + context.transaction.context_inputs(), &context.protocol_parameters, ) } diff --git a/sdk/src/types/block/slot/epoch.rs b/sdk/src/types/block/slot/epoch.rs index dbbaf98e88..8f8c7f97c3 100644 --- a/sdk/src/types/block/slot/epoch.rs +++ b/sdk/src/types/block/slot/epoch.rs @@ -77,7 +77,7 @@ impl EpochIndex { /// Calculates the start slot of the given epoch. pub fn epoch_start(&self, slots_per_epoch_exponent: u8) -> SlotIndex { - SlotIndex::new(self.0 << slots_per_epoch_exponent) + SlotIndex(self.0 << slots_per_epoch_exponent) } /// Returns the slot for which to be eligible for the committee selection of epoch n, a potential validator must