@@ -6210,6 +6210,8 @@ def test_injectpaymentonion_3hop(node_factory, executor):
62106210 assert lsp ['payment_hash' ] == inv3 ['payment_hash' ]
62116211 assert lsp ['status' ] == 'complete'
62126212 assert lsp ['amount_msat' ] == 1000
6213+ # We didn't give it an invstring, so it doesn't know destination
6214+ assert 'destination' not in lsp
62136215
62146216
62156217def test_injectpaymentonion_selfpay (node_factory , executor ):
@@ -6227,6 +6229,7 @@ def test_injectpaymentonion_selfpay(node_factory, executor):
62276229
62286230 ret = l1 .rpc .injectpaymentonion (onion = onion ['onion' ],
62296231 payment_hash = inv4 ['payment_hash' ],
6232+ invstring = inv4 ['bolt11' ],
62306233 amount_msat = 1000 ,
62316234 cltv_expiry = blockheight + 18 ,
62326235 partid = 1 ,
@@ -6238,6 +6241,7 @@ def test_injectpaymentonion_selfpay(node_factory, executor):
62386241 assert lsp ['partid' ] == 1
62396242 assert lsp ['payment_hash' ] == inv4 ['payment_hash' ]
62406243 assert lsp ['status' ] == 'complete'
6244+ assert lsp ['destination' ] == l1 .info ['id' ]
62416245
62426246 # Test self-pay with MPP.
62436247 inv5 = l1 .rpc .invoice (1000 , "test_injectpaymentonion5" , "test_injectpaymentonion5" )
@@ -6278,6 +6282,7 @@ def test_injectpaymentonion_selfpay(node_factory, executor):
62786282 assert lsp ['partid' ] == 1 or lsp ['partid' ] == 2
62796283 assert lsp ['payment_hash' ] == inv5 ['payment_hash' ]
62806284 assert lsp ['status' ] == 'complete'
6285+ assert 'destination' not in lsp
62816286 assert len (lsps ) == 2
62826287
62836288 # Check listpays gives a reasonable result!
@@ -6362,7 +6367,8 @@ def test_injectpaymentonion_selfpay(node_factory, executor):
63626367 amount_msat = 1000 ,
63636368 cltv_expiry = blockheight + 18 ,
63646369 partid = 1 ,
6365- groupid = 0 )
6370+ groupid = 0 ,
6371+ invstring = inv10 ['invoice' ])
63666372 assert sha256 (bytes .fromhex (ret ['payment_preimage' ])).hexdigest () == decoded ['invoice_payment_hash' ]
63676373 # The label for the invoice is deterministic.
63686374 label = f"{ decoded ['offer_id' ]} -{ decoded ['invreq_payer_id' ]} -0"
@@ -6372,6 +6378,7 @@ def test_injectpaymentonion_selfpay(node_factory, executor):
63726378 assert lsp ['partid' ] == 1
63736379 assert lsp ['payment_hash' ] == inv4 ['payment_hash' ]
63746380 assert lsp ['status' ] == 'complete'
6381+ assert lsp ['destination' ] == l1 .info ['id' ]
63756382
63766383
63776384def test_injectpaymentonion_blindedpath (node_factory , executor ):
@@ -6440,7 +6447,8 @@ def test_injectpaymentonion_blindedpath(node_factory, executor):
64406447 amount_msat = 1000 ,
64416448 cltv_expiry = blockheight + 18 + 6 ,
64426449 partid = 1 ,
6443- groupid = 0 )
6450+ groupid = 0 ,
6451+ invstring = inv7 ['invoice' ])
64446452 assert sha256 (bytes .fromhex (ret ['payment_preimage' ])).hexdigest () == decoded ['invoice_payment_hash' ]
64456453 # The label for l2's invoice is deterministic.
64466454 label = f"{ decoded ['offer_id' ]} -{ decoded ['invreq_payer_id' ]} -0"
@@ -6492,7 +6500,8 @@ def test_injectpaymentonion_blindedpath(node_factory, executor):
64926500 amount_msat = 1001 ,
64936501 cltv_expiry = blockheight + 18 + 6 ,
64946502 partid = 1 ,
6495- groupid = 0 )
6503+ groupid = 0 ,
6504+ invstring = inv8 ['invoice' ])
64966505 assert sha256 (bytes .fromhex (ret ['payment_preimage' ])).hexdigest () == decoded ['invoice_payment_hash' ]
64976506 # The label for l4's invoice is deterministic.
64986507 label = f"{ decoded ['offer_id' ]} -{ decoded ['invreq_payer_id' ]} -0"
@@ -6502,6 +6511,7 @@ def test_injectpaymentonion_blindedpath(node_factory, executor):
65026511 assert lsp ['partid' ] == 1
65036512 assert lsp ['payment_hash' ] == decoded ['invoice_payment_hash' ]
65046513 assert lsp ['status' ] == 'complete'
6514+ assert lsp ['destination' ] == decoded ['invoice_node_id' ]
65056515
65066516 # Finally, with blinded path which starts with us.
65076517 offer = l4 .rpc .offer ('any' )
@@ -6535,7 +6545,8 @@ def test_injectpaymentonion_blindedpath(node_factory, executor):
65356545 amount_msat = 1001 ,
65366546 cltv_expiry = blockheight + 18 + 6 ,
65376547 partid = 1 ,
6538- groupid = 0 )
6548+ groupid = 0 ,
6549+ invstring = inv9 ['invoice' ])
65396550 assert sha256 (bytes .fromhex (ret ['payment_preimage' ])).hexdigest () == decoded ['invoice_payment_hash' ]
65406551 # The label for the invoice is deterministic.
65416552 label = f"{ decoded ['offer_id' ]} -{ decoded ['invreq_payer_id' ]} -0"
@@ -6545,6 +6556,7 @@ def test_injectpaymentonion_blindedpath(node_factory, executor):
65456556 assert lsp ['partid' ] == 1
65466557 assert lsp ['payment_hash' ] == decoded ['invoice_payment_hash' ]
65476558 assert lsp ['status' ] == 'complete'
6559+ assert lsp ['destination' ] == decoded ['invoice_node_id' ]
65486560
65496561
65506562def test_injectpaymentonion_failures (node_factory , executor ):
0 commit comments