File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments