Skip to content

Commit b35b8cf

Browse files
committed
Add Display to PaymentId & PaymentPreimage
1 parent 513c2b4 commit b35b8cf

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
@@ -252,6 +252,12 @@ impl Readable for PaymentId {
252252
}
253253
}
254254

255+
impl core::fmt::Display for PaymentId {
256+
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
257+
crate::util::logger::DebugBytes(&self.0).fmt(f)
258+
}
259+
}
260+
255261
/// An identifier used to uniquely identify an intercepted HTLC to LDK.
256262
///
257263
/// 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)