@@ -252,7 +252,10 @@ def handle_pay_invoice(self):
252
252
cache = self .vasp_pubkey_cache ,
253
253
)
254
254
255
- verify_uma_invoice_signature (invoice , receiver_vasp_pubkey )
255
+ # Skip signature verification in testing mode to avoid needing to run 2 VASPs.
256
+ is_testing = current_app .config .get ("TESTING" , False )
257
+ if not is_testing :
258
+ verify_uma_invoice_signature (invoice , receiver_vasp_pubkey )
256
259
257
260
receiving_currency = CURRENCIES [invoice .receving_currency .code ]
258
261
@@ -472,7 +475,9 @@ def _handle_internal_uma_payreq(
472
475
)
473
476
474
477
print (f"payreq_response: { payreq_response .to_dict ()} " )
475
- if uma_version == 1 :
478
+ # Skip signature verification in testing mode to avoid needing to run 2 VASPs.
479
+ is_testing = current_app .config .get ("TESTING" , False )
480
+ if uma_version == 1 and not is_testing :
476
481
verify_pay_req_response_signature (
477
482
user .get_uma_address (self .config ),
478
483
receiver_uma ,
@@ -515,7 +520,8 @@ def _handle_internal_uma_payreq(
515
520
516
521
amount_receiving_currency = (
517
522
payreq_response .payment_info .amount
518
- if payreq_response .payment_info and payreq_response .payment_info .amount
523
+ if payreq_response .payment_info
524
+ and payreq_response .payment_info .amount is not None
519
525
else round (amount_as_msats (invoice_data .amount ) / 1000 )
520
526
)
521
527
@@ -634,7 +640,10 @@ def handle_request_pay_invoice(self, invoice: Invoice):
634
640
vasp_domain = receiving_domain ,
635
641
cache = self .vasp_pubkey_cache ,
636
642
)
637
- verify_uma_invoice_signature (invoice , receiver_vasp_pubkey )
643
+ # Skip signature verification in testing mode to avoid needing to run 2 VASPs.
644
+ is_testing = current_app .config .get ("TESTING" , False )
645
+ if not is_testing :
646
+ verify_uma_invoice_signature (invoice , receiver_vasp_pubkey )
638
647
receiving_currency = CURRENCIES [invoice .receving_currency .code ]
639
648
if not receiving_currency :
640
649
abort_with_error (
0 commit comments