Skip to content

Commit

Permalink
feat(models): add missing conversions for RelaxedMessage stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexagon committed Feb 13, 2025
1 parent adada6e commit cdc0fa5
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/models/message/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,50 @@ impl RelaxedMsgInfo {
}
}

impl From<RelaxedIntMsgInfo> for RelaxedMsgInfo {
#[inline]
fn from(info: RelaxedIntMsgInfo) -> Self {
Self::Int(info)
}
}

impl From<RelaxedExtOutMsgInfo> for RelaxedMsgInfo {
#[inline]
fn from(info: RelaxedExtOutMsgInfo) -> Self {
Self::ExtOut(info)
}
}

impl From<IntMsgInfo> for RelaxedMsgInfo {
#[inline]
fn from(info: IntMsgInfo) -> Self {
Self::Int(RelaxedIntMsgInfo {
ihr_disabled: info.ihr_disabled,
bounce: info.bounce,
bounced: info.bounced,
src: Some(info.src),
dst: info.dst,
value: info.value,
ihr_fee: info.ihr_fee,
fwd_fee: info.fwd_fee,
created_lt: info.created_lt,
created_at: info.created_at,
})
}
}

impl From<ExtOutMsgInfo> for RelaxedMsgInfo {
#[inline]
fn from(info: ExtOutMsgInfo) -> Self {
Self::ExtOut(RelaxedExtOutMsgInfo {
src: Some(info.src),
dst: info.dst,
created_lt: info.created_lt,
created_at: info.created_at,
})
}
}

impl ExactSize for RelaxedMsgInfo {
#[inline]
fn exact_size(&self) -> Size {
Expand Down

0 comments on commit cdc0fa5

Please sign in to comment.