Skip to content

Commit 4bed243

Browse files
committed
f Account for Invoice being renamed to Bolt11Invoice
1 parent 23a64aa commit 4bed243

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
//!
2828
//! ```no_run
2929
//! use ldk_node::{Builder, NetAddress};
30-
//! use ldk_node::lightning_invoice::Invoice;
30+
//! use ldk_node::lightning_invoice::Bolt11Invoice;
3131
//! use ldk_node::bitcoin::secp256k1::PublicKey;
3232
//! use ldk_node::bitcoin::Network;
3333
//! use std::str::FromStr;
@@ -54,7 +54,7 @@
5454
//! println!("EVENT: {:?}", event);
5555
//! node.event_handled();
5656
//!
57-
//! let invoice = Invoice::from_str("INVOICE_STR").unwrap();
57+
//! let invoice = Bolt11Invoice::from_str("INVOICE_STR").unwrap();
5858
//! node.send_payment(&invoice).unwrap();
5959
//!
6060
//! node.stop().unwrap();
@@ -137,7 +137,7 @@ use lightning_background_processor::process_events_async;
137137
use lightning_transaction_sync::EsploraSyncClient;
138138

139139
use lightning::routing::router::{PaymentParameters, RouteParameters};
140-
use lightning_invoice::{payment, Currency, Invoice};
140+
use lightning_invoice::{payment, Bolt11Invoice, Currency};
141141

142142
use bitcoin::hashes::sha256::Hash as Sha256;
143143
use bitcoin::hashes::Hash;
@@ -1036,7 +1036,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
10361036
}
10371037

10381038
/// Send a payement given an invoice.
1039-
pub fn send_payment(&self, invoice: &Invoice) -> Result<PaymentHash, Error> {
1039+
pub fn send_payment(&self, invoice: &Bolt11Invoice) -> Result<PaymentHash, Error> {
10401040
let rt_lock = self.runtime.read().unwrap();
10411041
if rt_lock.is_none() {
10421042
return Err(Error::NotRunning);
@@ -1112,7 +1112,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
11121112
/// This can be used to pay a so-called "zero-amount" invoice, i.e., an invoice that leaves the
11131113
/// amount paid to be determined by the user.
11141114
pub fn send_payment_using_amount(
1115-
&self, invoice: &Invoice, amount_msat: u64,
1115+
&self, invoice: &Bolt11Invoice, amount_msat: u64,
11161116
) -> Result<PaymentHash, Error> {
11171117
let rt_lock = self.runtime.read().unwrap();
11181118
if rt_lock.is_none() {
@@ -1294,21 +1294,21 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
12941294
/// given.
12951295
pub fn receive_payment(
12961296
&self, amount_msat: u64, description: &str, expiry_secs: u32,
1297-
) -> Result<Invoice, Error> {
1297+
) -> Result<Bolt11Invoice, Error> {
12981298
self.receive_payment_inner(Some(amount_msat), description, expiry_secs)
12991299
}
13001300

13011301
/// Returns a payable invoice that can be used to request and receive a payment for which the
13021302
/// amount is to be determined by the user, also known as a "zero-amount" invoice.
13031303
pub fn receive_variable_amount_payment(
13041304
&self, description: &str, expiry_secs: u32,
1305-
) -> Result<Invoice, Error> {
1305+
) -> Result<Bolt11Invoice, Error> {
13061306
self.receive_payment_inner(None, description, expiry_secs)
13071307
}
13081308

13091309
fn receive_payment_inner(
13101310
&self, amount_msat: Option<u64>, description: &str, expiry_secs: u32,
1311-
) -> Result<Invoice, Error> {
1311+
) -> Result<Bolt11Invoice, Error> {
13121312
let currency = Currency::from(self.config.network);
13131313
let keys_manager = Arc::clone(&self.keys_manager);
13141314
let invoice = match lightning_invoice::utils::create_invoice_from_channelmanager(

0 commit comments

Comments
 (0)