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-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=605633bd19f10ad97fc7a518dd692665cfc96627;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)