Skip to content

Commit 4c7c5f9

Browse files
committed
Add Display to PaymentId & PaymentPreimage
1 parent 9748c04 commit 4c7c5f9

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@ impl Readable for PaymentId {
240240
}
241241
}
242242

243+
impl core::fmt::Display for PaymentId {
244+
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
245+
crate::util::logger::DebugBytes(&self.0).fmt(f)
246+
}
247+
}
248+
243249
/// An identifier used to uniquely identify an intercepted HTLC to LDK.
244250
///
245251
/// This is not exported to bindings users as we just use [u8; 32] directly

lightning/src/ln/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ impl core::fmt::Display for PaymentHash {
8686
/// This is not exported to bindings users as we just use [u8; 32] directly
8787
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug, Ord, PartialOrd)]
8888
pub struct PaymentPreimage(pub [u8; 32]);
89+
90+
impl core::fmt::Display for PaymentPreimage {
91+
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
92+
crate::util::logger::DebugBytes(&self.0).fmt(f)
93+
}
94+
}
95+
8996
/// payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together
9097
///
9198
/// This is not exported to bindings users as we just use [u8; 32] directly

0 commit comments

Comments
 (0)