Drop `WebhookNotification::new` in favor of explicit construction
What changed, and why it matters
This commit removes a redundant internal constructor method from a Rust struct used for webhook notifications in a Lightning liquidity protocol. It is a routine code cleanup with no security implications.
No security action needed. Treat as normal refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit drops WebhookNotification::new because the struct already has all public fields and the manually-written new conflicted with an auto-generated new constructor in language bindings. The helper methods (webhook_registered, payment_incoming, etc.) are updated to use explicit struct literal construction instead. No logic, validation, or API behavior changes.
Changed components
lightning-liquidity/src/lsps5/msgs.rsInspect captured patch +5 / −10
diff --git a/lightning-liquidity/src/lsps5/msgs.rs b/lightning-liquidity/src/lsps5/msgs.rs
index 341dfcd..e457c29 100644
--- a/lightning-liquidity/src/lsps5/msgs.rs
+++ b/lightning-liquidity/src/lsps5/msgs.rs
@@ -541,34 +541,29 @@ pub struct WebhookNotification {
}
impl WebhookNotification {
- /// Create a new webhook notification.
- pub fn new(method: WebhookNotificationMethod) -> Self {
- Self { method }
- }
-
/// Create a webhook_registered notification.
pub fn webhook_registered() -> Self {
- Self::new(WebhookNotificationMethod::LSPS5WebhookRegistered)
+ Self { method: WebhookNotificationMethod::LSPS5WebhookRegistered }
}
/// Create a payment_incoming notification.
pub fn payment_incoming() -> Self {
- Self::new(WebhookNotificationMethod::LSPS5PaymentIncoming)
+ Self { method: WebhookNotificationMethod::LSPS5PaymentIncoming }
}
/// Create an expiry_soon notification.
pub fn expiry_soon(timeout: u32) -> Self {
- Self::new(WebhookNotificationMethod::LSPS5ExpirySoon { timeout })
+ Self { method: WebhookNotificationMethod::LSPS5ExpirySoon { timeout } }
}
/// Create a liquidity_management_request notification.
pub fn liquidity_management_request() -> Self {
- Self::new(WebhookNotificationMethod::LSPS5LiquidityManagementRequest)
+ Self { method: WebhookNotificationMethod::LSPS5LiquidityManagementRequest }
}
/// Create an onion_message_incoming notification.
pub fn onion_message_incoming() -> Self {
- Self::new(WebhookNotificationMethod::LSPS5OnionMessageIncoming)
+ Self { method: WebhookNotificationMethod::LSPS5OnionMessageIncoming }
}
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.