X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Foffers%2Frefund.rs;h=16014cd3c0b7ac6080a31b1c198b7bb669798219;hb=bdbb177469c137b958b7dde4f306e1c81b2e7f63;hp=42177960868ab553ee1385f2569146dc8209e2bf;hpb=670b41ae4ec1b45fad97ed813a4296410839ecaf;p=rust-lightning diff --git a/lightning/src/offers/refund.rs b/lightning/src/offers/refund.rs index 42177960..16014cd3 100644 --- a/lightning/src/offers/refund.rs +++ b/lightning/src/offers/refund.rs @@ -84,7 +84,6 @@ use bitcoin::blockdata::constants::ChainHash; use bitcoin::network::constants::Network; use bitcoin::secp256k1::{PublicKey, Secp256k1, self}; -use core::convert::TryFrom; use core::hash::{Hash, Hasher}; use core::ops::Deref; use core::str::FromStr; @@ -115,6 +114,7 @@ use { crate::offers::invoice::{InvoiceWithDerivedSigningPubkeyBuilder, InvoiceWithExplicitSigningPubkeyBuilder}, }; +#[allow(unused_imports)] use crate::prelude::*; #[cfg(feature = "std")] @@ -375,6 +375,16 @@ for RefundMaybeWithDerivedMetadataBuilder<'a> { } } +#[cfg(c_bindings)] +impl<'a> From> +for RefundBuilder<'a, secp256k1::All> { + fn from(builder: RefundMaybeWithDerivedMetadataBuilder<'a>) -> Self { + let RefundMaybeWithDerivedMetadataBuilder { refund, secp_ctx } = builder; + + Self { refund, secp_ctx } + } +} + /// A `Refund` is a request to send an [`Bolt12Invoice`] without a preceding [`Offer`]. /// /// Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to @@ -894,8 +904,9 @@ mod tests { use bitcoin::blockdata::constants::ChainHash; use bitcoin::network::constants::Network; use bitcoin::secp256k1::{KeyPair, Secp256k1, SecretKey}; - use core::convert::TryFrom; + use core::time::Duration; + use crate::blinded_path::{BlindedHop, BlindedPath}; use crate::sign::KeyMaterial; use crate::ln::channelmanager::PaymentId; @@ -909,6 +920,7 @@ mod tests { use crate::offers::test_utils::*; use crate::util::ser::{BigSize, Writeable}; use crate::util::string::PrintableString; + use crate::prelude::*; trait ToBytes { fn to_bytes(&self) -> Vec;