Skip to content

Commit 440af9b

Browse files
committed
fixup! Add end-to-end test for HRN resolution
1 parent a942927 commit 440af9b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/payment/unified.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ impl UnifiedPayment {
272272
PaymentMethod::LightningBolt12(_offer) => {
273273
#[cfg(not(hrn_tests))]
274274
let offer = maybe_wrap(_offer.clone());
275-
275+
276276
#[cfg(hrn_tests)]
277277
let offer = {
278278
let guard = self.test_offer.lock().unwrap();
@@ -337,10 +337,14 @@ impl UnifiedPayment {
337337
/// Sets a test offer to be used in the `send` method when the `hrn_tests` config flag is enabled.
338338
/// This is necessary to test sending Bolt12 payments via the unified payment handler in HRN tests,
339339
/// as we cannot rely on the offer being present in the parsed URI.
340-
#[cfg(hrn_tests)]
341340
pub fn set_test_offer(&self, offer: Offer) {
342-
let mut guard = self.test_offer.lock().unwrap();
343-
*guard = Some(offer);
341+
#[cfg(hrn_tests)]
342+
{
343+
let mut guard = self.test_offer.lock().unwrap();
344+
*guard = Some(offer);
345+
}
346+
#[cfg(not(hrn_tests))]
347+
let _ = offer;
344348
}
345349
}
346350

0 commit comments

Comments
 (0)