@@ -1036,3 +1036,41 @@ def test_xpay_bip353(node_factory):
1036
1036
# Now with a payer_note:
1037
1037
l2 .
rpc .
xpay (
invstring = '[email protected] ' ,
amount_msat = 123 ,
payer_note = "Eat at Joes!" )
1038
1038
assert l1 .rpc .decode (l1 .rpc .listinvoices ()['invoices' ][1 ]['bolt12' ])['invreq_payer_note' ] == "Eat at Joes!"
1039
+
1040
+
1041
+ def test_xpay_forward_askrene_notifications (node_factory ):
1042
+ l1 , l2 , l3 = node_factory .line_graph (3 , wait_for_announce = True )
1043
+
1044
+ scid12 = first_scid (l1 , l2 )
1045
+ scid23 = first_scid (l3 , l2 )
1046
+ offer = l3 .rpc .offer ("1000sat" , 'test_xpay_forward_askrene_notifications' )['bolt12' ]
1047
+ out = subprocess .check_output (['cli/lightning-cli' ,
1048
+ '--network={}' .format (TEST_NETWORK ),
1049
+ '--lightning-dir={}'
1050
+ .format (l1 .daemon .lightning_dir ),
1051
+ 'xpay' ,
1052
+ offer ]).decode ('utf-8' ).splitlines ()
1053
+ preimage = only_one (l3 .rpc .listinvoices ()['invoices' ])['payment_preimage' ]
1054
+ assert out == ['# Fetching invoice for offer' ,
1055
+ f'# getroutes: Flow 0/1: 1000011msat/11 { scid12 } /1 -> 1000011msat/11 { scid23 } /0 -> 1000000msat/5 0x0x0/1 -> 1000000msat/0' ,
1056
+ f'# ->{ l2 .info ["id" ]} ->{ l3 .info ["id" ]} ->020000000000000000000000000000000000000000000000000000000000000001: Success: preimage={ preimage } ' ,
1057
+ '{' ,
1058
+ f' "payment_preimage": "{ preimage } ",' ,
1059
+ ' "amount_msat": 1000000,' ,
1060
+ ' "amount_sent_msat": 1000011,' ,
1061
+ ' "failed_parts": 0,' ,
1062
+ ' "successful_parts": 1' ,
1063
+ '}' ]
1064
+
1065
+ out2 = subprocess .check_output (['cli/lightning-cli' ,
1066
+ '--network={}' .format (TEST_NETWORK ),
1067
+ # Now with debugging level notifications
1068
+ '--notifications=debug' ,
1069
+ '--lightning-dir={}'
1070
+ .format (l1 .daemon .lightning_dir ),
1071
+ 'xpay' ,
1072
+ offer ]).decode ('utf-8' ).splitlines ()
1073
+ assert out2 [:3 ] == ['# Fetching invoice for offer' ,
1074
+ f'# offer is { offer } ' ,
1075
+ f'# Invoice gave route { l3 .info ["id" ]} ->020000000000000000000000000000000000000000000000000000000000000001 (0x0x0/1)' ]
1076
+ assert len (out2 ) > len (out )
0 commit comments