From: Jeffrey Czyz Date: Tue, 31 Jan 2023 18:52:08 +0000 (-0600) Subject: Fix BOLT 12 invoice doctests to work with no-std X-Git-Tag: v0.0.114-beta~6^2~14 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=3302f25e9fceb7b79632710cd13a789e6d0daee5;p=rust-lightning Fix BOLT 12 invoice doctests to work with no-std --- diff --git a/lightning/src/offers/invoice.rs b/lightning/src/offers/invoice.rs index f423677fb..f82544913 100644 --- a/lightning/src/offers/invoice.rs +++ b/lightning/src/offers/invoice.rs @@ -45,7 +45,12 @@ //! //! // Invoice for the "offer to be paid" flow. //! InvoiceRequest::try_from(bytes)? -//! .respond_with(payment_paths, payment_hash)? +#![cfg_attr(feature = "std", doc = " + .respond_with(payment_paths, payment_hash)? +")] +#![cfg_attr(not(feature = "std"), doc = " + .respond_with(payment_paths, payment_hash, core::time::Duration::from_secs(0))? +")] //! .relative_expiry(3600) //! .allow_mpp() //! .fallback_v0_p2wpkh(&wpubkey_hash) @@ -69,7 +74,12 @@ //! // Invoice for the "offer for money" flow. //! "lnr1qcp4256ypq" //! .parse::()? -//! .respond_with(payment_paths, payment_hash, pubkey)? +#![cfg_attr(feature = "std", doc = " + .respond_with(payment_paths, payment_hash, pubkey)? +")] +#![cfg_attr(not(feature = "std"), doc = " + .respond_with(payment_paths, payment_hash, pubkey, core::time::Duration::from_secs(0))? +")] //! .relative_expiry(3600) //! .allow_mpp() //! .fallback_v0_p2wpkh(&wpubkey_hash)