Skip to content

Commit 77172d2

Browse files
committed
Rename LSPFeeLimits to LSPS2Parameters
The values describe the `LSPS2` parameters negotiated for JIT-channel receives, not a fee-limit concept owned by the payment store. Rename the public type and internal references while preserving the existing fields, TLV encoding, and `PaymentKind::Bolt11Jit` storage shape for the follow-up refactor. Co-Authored-By: HAL 9000
1 parent f7d6cf1 commit 77172d2

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/payment/bolt11.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use crate::ffi::{maybe_deref, maybe_try_convert_enum, maybe_wrap};
3131
use crate::liquidity::LiquiditySource;
3232
use crate::logger::{log_error, log_info, LdkLogger, Logger};
3333
use crate::payment::store::{
34-
LSPFeeLimits, PaymentDetails, PaymentDetailsUpdate, PaymentDirection, PaymentKind,
34+
LSPS2Parameters, PaymentDetails, PaymentDetailsUpdate, PaymentDirection, PaymentKind,
3535
PaymentStatus,
3636
};
3737
use crate::peer_store::{PeerInfo, PeerStore};
@@ -201,7 +201,7 @@ impl Bolt11Payment {
201201
// Register payment in payment store.
202202
let payment_hash = invoice.payment_hash();
203203
let payment_secret = invoice.payment_secret();
204-
let lsp_fee_limits = LSPFeeLimits {
204+
let lsp_fee_limits = LSPS2Parameters {
205205
max_total_opening_fee_msat: lsp_total_opening_fee,
206206
max_proportional_opening_fee_ppm_msat: lsp_prop_opening_fee,
207207
};

src/payment/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub use onchain::OnchainPayment;
2222
pub use pending_payment_store::PendingPaymentDetails;
2323
pub use spontaneous::SpontaneousPayment;
2424
pub use store::{
25-
ConfirmationStatus, LSPFeeLimits, PaymentDetails, PaymentDirection, PaymentKind, PaymentStatus,
25+
ConfirmationStatus, LSPS2Parameters, PaymentDetails, PaymentDirection, PaymentKind,
26+
PaymentStatus,
2627
};
2728
pub use unified::{UnifiedPayment, UnifiedPaymentResult};

src/payment/store.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ pub enum PaymentKind {
401401
/// See [`LdkChannelConfig::accept_underpaying_htlcs`] for more information.
402402
///
403403
/// [`LdkChannelConfig::accept_underpaying_htlcs`]: lightning::util::config::ChannelConfig::accept_underpaying_htlcs
404-
lsp_fee_limits: LSPFeeLimits,
404+
lsp_fee_limits: LSPS2Parameters,
405405
},
406406
/// A [BOLT 12] 'offer' payment, i.e., a payment for an [`Offer`].
407407
///
@@ -529,7 +529,7 @@ impl_writeable_tlv_based_enum!(ConfirmationStatus,
529529
/// [`LdkChannelConfig::accept_underpaying_htlcs`]: lightning::util::config::ChannelConfig::accept_underpaying_htlcs
530530
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
531531
#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
532-
pub struct LSPFeeLimits {
532+
pub struct LSPS2Parameters {
533533
/// The maximal total amount we allow any configured LSP withhold from us when forwarding the
534534
/// payment.
535535
pub max_total_opening_fee_msat: Option<u64>,
@@ -538,7 +538,7 @@ pub struct LSPFeeLimits {
538538
pub max_proportional_opening_fee_ppm_msat: Option<u64>,
539539
}
540540

541-
impl_writeable_tlv_based!(LSPFeeLimits, {
541+
impl_writeable_tlv_based!(LSPS2Parameters, {
542542
(0, max_total_opening_fee_msat, option),
543543
(2, max_proportional_opening_fee_ppm_msat, option),
544544
});
@@ -637,7 +637,7 @@ mod tests {
637637
pub amount_msat: Option<u64>,
638638
pub direction: PaymentDirection,
639639
pub status: PaymentStatus,
640-
pub lsp_fee_limits: Option<LSPFeeLimits>,
640+
pub lsp_fee_limits: Option<LSPS2Parameters>,
641641
}
642642

643643
impl_writeable_tlv_based!(OldPaymentDetails, {
@@ -695,7 +695,7 @@ mod tests {
695695

696696
// Test `Bolt11Jit` de/ser
697697
{
698-
let lsp_fee_limits = Some(LSPFeeLimits {
698+
let lsp_fee_limits = Some(LSPS2Parameters {
699699
max_total_opening_fee_msat: Some(46_000),
700700
max_proportional_opening_fee_ppm_msat: Some(47_000),
701701
});

0 commit comments

Comments
 (0)