Skip to content

Commit 1e87f3e

Browse files
fixup: Use display instead of debug on WebhookNotification
1 parent f764f10 commit 1e87f3e

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

lightning-liquidity/src/lsps5/msgs.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ pub enum WebhookNotificationMethod {
461461
}
462462

463463
/// Webhook notification payload.
464-
#[derive(Clone, PartialEq, Eq)]
464+
#[derive(Debug, Clone, PartialEq, Eq)]
465465
pub struct WebhookNotification {
466466
/// Notification method with parameters.
467467
pub method: WebhookNotificationMethod,
@@ -499,13 +499,11 @@ impl WebhookNotification {
499499
}
500500
}
501501

502-
impl fmt::Debug for WebhookNotification {
502+
impl fmt::Display for WebhookNotification {
503503
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
504504
match serde_json::to_string(self) {
505505
Ok(json) => f.write_str(&json),
506-
// WebhookNotification is well defined and does not contain arbitrary data, so
507-
// this case should never happen.
508-
Err(_) => f.write_str("<failed-to-serialize>"),
506+
Err(_) => Err(fmt::Error),
509507
}
510508
}
511509
}

lightning-liquidity/src/lsps5/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ where
435435

436436
fn sign_notification(&self, body: &WebhookNotification, timestamp: &LSPSDateTime) -> String {
437437
let message = format!(
438-
"LSPS5: DO NOT SIGN THIS MESSAGE MANUALLY: LSP: At {} I notify {:?}",
438+
"LSPS5: DO NOT SIGN THIS MESSAGE MANUALLY: LSP: At {} I notify {}",
439439
timestamp.to_rfc3339(),
440440
body
441441
);

lightning-liquidity/src/lsps5/validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ where
101101
}
102102

103103
let message = format!(
104-
"LSPS5: DO NOT SIGN THIS MESSAGE MANUALLY: LSP: At {} I notify {:?}",
104+
"LSPS5: DO NOT SIGN THIS MESSAGE MANUALLY: LSP: At {} I notify {}",
105105
signature_timestamp.to_rfc3339(),
106106
notification
107107
);

0 commit comments

Comments
 (0)