//! Convenient utilities for paying Lightning invoices.
use crate::Bolt11Invoice;
-
-use bitcoin_hashes::Hash;
+use bitcoin::hashes::Hash;
use lightning::ln::PaymentHash;
use lightning::ln::channelmanager::RecipientOnionFields;
fn params_from_invoice(invoice: &Bolt11Invoice, amount_msat: u64)
-> (PaymentHash, RecipientOnionFields, RouteParameters) {
- let payment_hash = PaymentHash((*invoice.payment_hash()).into_inner());
+ let payment_hash = PaymentHash((*invoice.payment_hash()).to_byte_array());
let mut recipient_onion = RecipientOnionFields::secret_only(*invoice.payment_secret());
recipient_onion.payment_metadata = invoice.payment_metadata().map(|v| v.clone());
mod tests {
use super::*;
use crate::{InvoiceBuilder, Currency};
- use bitcoin_hashes::sha256::Hash as Sha256;
+ use bitcoin::hashes::sha256::Hash as Sha256;
use lightning::events::Event;
use lightning::ln::channelmanager::{Retry, PaymentId};
use lightning::ln::msgs::ChannelMessageHandler;