diff --git a/examples/3l-node/cli.rs b/examples/3l-node/cli.rs index 7a13ae10..b347a1f8 100644 --- a/examples/3l-node/cli.rs +++ b/examples/3l-node/cli.rs @@ -662,19 +662,11 @@ fn list_payments(node: &LightningNode) -> Result<(), String> { let timezone = FixedOffset::east_opt(payment.created_at.timezone_utc_offset_secs).unwrap(); let created_at = created_at.with_timezone(&timezone); - let latest_change_at: DateTime = payment.latest_state_change_at.time.into(); - let timezone = - FixedOffset::east_opt(payment.latest_state_change_at.timezone_utc_offset_secs).unwrap(); - let latest_change_at = latest_change_at.with_timezone(&timezone); println!( "{} payment created at {created_at} {}", payment_type.bold(), payment.created_at.timezone_id ); - println!( - "and with latest state change at {latest_change_at} {}", - payment.latest_state_change_at.timezone_id - ); println!(" State: {:?}", payment.payment_state); if payment.payment_state == PaymentState::Failed { println!(" Fail reason: {:?}", payment.fail_reason); diff --git a/src/invoice_details.rs b/src/invoice_details.rs index 079a480f..2b05a89e 100644 --- a/src/invoice_details.rs +++ b/src/invoice_details.rs @@ -26,7 +26,7 @@ impl InvoiceDetails { amount: ln_invoice .amount_msat .map(|a| a.to_amount_down(exchange_rate)), - description: ln_invoice.description.unwrap_or(String::new()), + description: ln_invoice.description.unwrap_or_default(), payment_hash: ln_invoice.payment_hash, payee_pub_key: ln_invoice.payee_pubkey, creation_timestamp: unix_timestamp_to_system_time(ln_invoice.timestamp), diff --git a/src/lib.rs b/src/lib.rs index affce956..f1419002 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -135,7 +135,6 @@ pub struct Payment { pub amount: Amount, pub invoice_details: InvoiceDetails, pub created_at: TzTime, - pub latest_state_change_at: TzTime, pub description: String, pub preimage: Option, pub network_fees: Option, @@ -676,12 +675,11 @@ impl LightningNode { Ok(Payment { payment_type, payment_state, - fail_reason: None, // TODO: Request SDK to store and provide failed payment attempts + fail_reason: None, // TODO: Request SDK to store and provide reason for failed payments hash: payment_details.payment_hash, amount, invoice_details, created_at: time.clone(), - latest_state_change_at: time, // TODO: remove this field from interface description, preimage: Some(payment_details.payment_preimage), network_fees, diff --git a/src/lipalightninglib.udl b/src/lipalightninglib.udl index 9e0e33e0..afd9dd9e 100644 --- a/src/lipalightninglib.udl +++ b/src/lipalightninglib.udl @@ -358,12 +358,11 @@ interface MaxRoutingFeeMode { dictionary Payment { PaymentType payment_type; PaymentState payment_state; - PayErrorCode? fail_reason; + PayErrorCode? fail_reason; // For now, will always be empty string hash; // Hex representation of payment hash Amount amount; // Nominal amount specified in the invoice InvoiceDetails invoice_details; TzTime created_at; - TzTime latest_state_change_at; string description; // The description embedded in the invoice. Given the length limit of this data, // it is possible that a hex hash of the description is provided instead, but that is uncommon. string? preimage; // Hex representation of the preimage. Will only be present on successful payments.