Skip to content

Commit

Permalink
expiration slot_index -> slot
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Jan 17, 2024
1 parent 76ba15d commit 2a0d1a3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sdk/src/types/block/output/unlock_condition/expiration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ pub(crate) mod dto {
#[serde(rename = "type")]
kind: u8,
return_address: Address,
slot_index: SlotIndex,
slot: SlotIndex,
}

impl From<&ExpirationUnlockCondition> for ExpirationUnlockConditionDto {
fn from(value: &ExpirationUnlockCondition) -> Self {
Self {
kind: ExpirationUnlockCondition::KIND,
return_address: value.return_address().clone(),
slot_index: value.slot_index(),
slot: value.slot_index(),
}
}
}
Expand All @@ -142,8 +142,7 @@ pub(crate) mod dto {
type Error = Error;

fn try_from(value: ExpirationUnlockConditionDto) -> Result<Self, Error> {
Self::new(value.return_address, value.slot_index)
.map_err(|_| Error::InvalidField("expirationUnlockCondition"))
Self::new(value.return_address, value.slot).map_err(|_| Error::InvalidField("expirationUnlockCondition"))
}
}

Expand Down

0 comments on commit 2a0d1a3

Please sign in to comment.