Skip to content

Commit 3302f25

Browse files
committed
Fix BOLT 12 invoice doctests to work with no-std
1 parent 8ecd7c3 commit 3302f25

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lightning/src/offers/invoice.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@
4545
//!
4646
//! // Invoice for the "offer to be paid" flow.
4747
//! InvoiceRequest::try_from(bytes)?
48-
//! .respond_with(payment_paths, payment_hash)?
48+
#![cfg_attr(feature = "std", doc = "
49+
.respond_with(payment_paths, payment_hash)?
50+
")]
51+
#![cfg_attr(not(feature = "std"), doc = "
52+
.respond_with(payment_paths, payment_hash, core::time::Duration::from_secs(0))?
53+
")]
4954
//! .relative_expiry(3600)
5055
//! .allow_mpp()
5156
//! .fallback_v0_p2wpkh(&wpubkey_hash)
@@ -69,7 +74,12 @@
6974
//! // Invoice for the "offer for money" flow.
7075
//! "lnr1qcp4256ypq"
7176
//! .parse::<Refund>()?
72-
//! .respond_with(payment_paths, payment_hash, pubkey)?
77+
#![cfg_attr(feature = "std", doc = "
78+
.respond_with(payment_paths, payment_hash, pubkey)?
79+
")]
80+
#![cfg_attr(not(feature = "std"), doc = "
81+
.respond_with(payment_paths, payment_hash, pubkey, core::time::Duration::from_secs(0))?
82+
")]
7383
//! .relative_expiry(3600)
7484
//! .allow_mpp()
7585
//! .fallback_v0_p2wpkh(&wpubkey_hash)

0 commit comments

Comments
 (0)