From 1a893e72a8f949c1ec6f57c745ecd5e4c7e623de Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Mon, 19 Feb 2024 10:11:13 +0100 Subject: [PATCH] f Rename `SweeperBalance` and `sweeper_balances` --- bindings/ldk_node.udl | 4 ++-- src/balance.rs | 6 +++--- src/lib.rs | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bindings/ldk_node.udl b/bindings/ldk_node.udl index 1c02a31c8..c7ae4bfbb 100644 --- a/bindings/ldk_node.udl +++ b/bindings/ldk_node.udl @@ -237,7 +237,7 @@ interface LightningBalance { }; [Enum] -interface SweeperBalance { +interface PendingSweepBalance { PendingBroadcast ( ChannelId? channel_id, u64 amount_satoshis ); BroadcastAwaitingConfirmation ( ChannelId? channel_id, u32 latest_broadcast_height, Txid latest_spending_txid, u64 amount_satoshis ); AwaitingThresholdConfirmations ( ChannelId? channel_id, Txid latest_spending_txid, BlockHash confirmation_hash, u32 confirmation_height, u64 amount_satoshis); @@ -248,7 +248,7 @@ dictionary BalanceDetails { u64 spendable_onchain_balance_sats; u64 total_lightning_balance_sats; sequence lightning_balances; - sequence sweeper_balances; + sequence pending_balances_from_channel_closures; }; interface ChannelConfig { diff --git a/src/balance.rs b/src/balance.rs index 164788eb8..99f174688 100644 --- a/src/balance.rs +++ b/src/balance.rs @@ -36,7 +36,7 @@ pub struct BalanceDetails { /// /// Note that, depending on the sync status of the wallets, swept balances listed here might or /// might not already be accounted for in [`Self::total_onchain_balance_sats`]. - pub sweeper_balances: Vec, + pub pending_balances_from_channel_closures: Vec, } /// Details about the status of a known Lightning balance. @@ -206,7 +206,7 @@ impl LightningBalance { /// Details about the status of a known balance currently being swept to our on-chain wallet. #[derive(Debug, Clone)] -pub enum SweeperBalance { +pub enum PendingSweepBalance { /// The spendable output is about to be swept, but a spending transaction has yet to be generated and /// broadcast. PendingBroadcast { @@ -246,7 +246,7 @@ pub enum SweeperBalance { }, } -impl SweeperBalance { +impl PendingSweepBalance { pub(crate) fn from_tracked_spendable_output(output_info: SpendableOutputInfo) -> Self { if let Some(confirmation_hash) = output_info.confirmation_hash { debug_assert!(output_info.confirmation_height.is_some()); diff --git a/src/lib.rs b/src/lib.rs index f9e84fb8a..6dbcb881a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -98,7 +98,7 @@ pub use bitcoin; pub use lightning; pub use lightning_invoice; -pub use balance::{BalanceDetails, LightningBalance, SweeperBalance}; +pub use balance::{BalanceDetails, LightningBalance, PendingSweepBalance}; pub use error::Error as NodeError; use error::Error; @@ -1591,11 +1591,11 @@ impl Node { } } - let sweeper_balances = self + let pending_balances_from_channel_closures = self .output_sweeper .tracked_spendable_outputs() .into_iter() - .map(|o| SweeperBalance::from_tracked_spendable_output(o)) + .map(|o| PendingSweepBalance::from_tracked_spendable_output(o)) .collect(); BalanceDetails { @@ -1603,7 +1603,7 @@ impl Node { spendable_onchain_balance_sats, total_lightning_balance_sats, lightning_balances, - sweeper_balances, + pending_balances_from_channel_closures, } }