From 605633bd19f10ad97fc7a518dd692665cfc96627 Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Tue, 31 Jan 2023 12:52:08 -0600 Subject: [PATCH] Fix BOLT 12 invoice doctests to work with no-std --- lightning/src/offers/invoice.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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) -- 2.39.5