Skip to content

Commit eef3bfe

Browse files
daywalker90cdecker
authored andcommitted
cln-rpc: Implemented the From<u64> trait for ShortChannelId
Changelog-None
1 parent 8d54a82 commit eef3bfe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cln-rpc/src/primitives.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ impl FromStr for ShortChannelId {
237237
))
238238
}
239239
}
240+
impl From<u64> for ShortChannelId {
241+
fn from(scid: u64) -> Self {
242+
ShortChannelId(scid)
243+
}
244+
}
240245
impl Display for ShortChannelId {
241246
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
242247
write!(f, "{}x{}x{}", self.block(), self.txindex(), self.outnum())

0 commit comments

Comments
 (0)