Skip to content

Commit

Permalink
Update Breez SDK to 0.2.9 (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-21 authored Nov 10, 2023
1 parent 3ba3cd9 commit 504b4d4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 76 deletions.
89 changes: 18 additions & 71 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ honey-badger = { git = "https://github.com/getlipa/wild", tag = "v1.14.0" }
graphql = { git = "https://github.com/getlipa/wild", tag = "v1.14.0" }
perro = { git = "https://github.com/getlipa/perro", tag = "v1.1.0" }

breez-sdk-core = { git = "https://github.com/breez/breez-sdk", tag = "0.2.7" }
breez-sdk-core = { git = "https://github.com/breez/breez-sdk", tag = "0.2.9" }

bip39 = "2.0.0"
bitcoin = "0.29.2"
Expand Down
9 changes: 5 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,9 @@ impl LightningNode {
"Failed to get an invoice from the LNURL-pay service",
));
}
LnUrlPayResult::PayError { .. } => {
runtime_error!(RuntimeErrorCode::NodeUnavailable, "Pay error")
}
}

let final_latest_payments = self.get_latest_payments(1)?;
Expand Down Expand Up @@ -840,11 +843,11 @@ impl LightningNode {
/// * `number_of_payments` - the maximum number of payments that will be returned
pub fn get_latest_payments(&self, number_of_payments: u32) -> Result<Vec<Payment>> {
let list_payments_request = ListPaymentsRequest {
filter: PaymentTypeFilter::All,
filters: Some(vec![PaymentTypeFilter::Sent, PaymentTypeFilter::Received]),
from_timestamp: None,
to_timestamp: None,
include_failures: Some(true),
limit: None,
limit: Some(number_of_payments),
offset: None,
};
let breez_payments = self
Expand All @@ -853,8 +856,6 @@ impl LightningNode {
.block_on(self.sdk.list_payments(list_payments_request))
.map_to_runtime_error(RuntimeErrorCode::NodeUnavailable, "Failed to list payments")?
.into_iter()
.filter(|p| p.payment_type != breez_sdk_core::PaymentType::ClosedChannel)
.take(number_of_payments as usize)
.map(|p| self.payment_from_breez_payment(p))
.collect::<Result<Vec<Payment>>>()?;

Expand Down

0 comments on commit 504b4d4

Please sign in to comment.