Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions payday_node_lnd/src/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ use bitcoin::{hex::DisplayHex, Address, Amount, Network, PublicKey};
use fedimint_tonic_lnd::{
lnrpc::{
payment::PaymentStatus, ChannelBalanceRequest, ChannelBalanceResponse, GetInfoRequest,
GetTransactionsRequest, Invoice, ListInvoiceRequest, ListInvoiceResponse, SendCoinsRequest,
SendManyRequest, Transaction, WalletBalanceRequest, WalletBalanceResponse,
GetTransactionsRequest, Invoice, ListChannelsRequest, ListChannelsResponse,
ListInvoiceRequest, ListInvoiceResponse, SendCoinsRequest, SendManyRequest, Transaction,
WalletBalanceRequest, WalletBalanceResponse,
},
Client,
};
Expand Down Expand Up @@ -47,6 +48,9 @@ pub trait LndApi: Send + Sync {
/// Get the current balances (onchain and lightning) of the wallet.
async fn get_balances(&self) -> Result<(WalletBalanceResponse, ChannelBalanceResponse)>;

/// List channels of this node.
async fn list_channels(&self, request: ListChannelsRequest) -> Result<ListChannelsResponse>;

/// Get a new onchain address for the wallet. Address is parsed and
/// validated for the configure network.
async fn new_address(&self) -> Result<Address>;
Expand Down Expand Up @@ -191,6 +195,17 @@ impl LndApi for LndRpcWrapper {
Ok((on_chain, lightning))
}

/// List channels of this node filtered by given parameters.
async fn list_channels(&self, request: ListChannelsRequest) -> Result<ListChannelsResponse> {
let mut lnd = self.client().await;
Ok(lnd
.lightning()
.list_channels(request)
.await
.map_err(|e| Error::NodeApi(e.to_string()))?
.into_inner())
}

/// Get a new onchain address for the wallet. Address is parsed and
/// validated for the configure network.
async fn new_address(&self) -> Result<Address> {
Expand Down
2 changes: 2 additions & 0 deletions payday_postgres/src/offset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ mod tests {
use crate::test_utils::get_postgres_pool;

#[tokio::test]
#[ignore = "integration test"]
async fn test_get_set_offset_non_existant() {
let db = get_postgres_pool().await;
let store = OffsetStore::new(db, None, None);
Expand All @@ -133,6 +134,7 @@ mod tests {
}

#[tokio::test]
#[ignore = "integration test"]
async fn test_get_set_offset() {
let id = "test_get_set_offset";
let db = get_postgres_pool().await;
Expand Down