Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: add pay test over unannounced channels #7844

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -6745,3 +6745,26 @@ def test_fetchinvoice_with_payer_metadata(node_factory, bitcoind):
inv3 = l1.rpc.call('fetchinvoice', {'offer': offer['bolt12'], 'amount_msat': '1sat', 'payer_note': 'Payment For vincenzopalazzo', 'payer_metadata': b'macros'.hex()})['invoice']
decode3 = l1.rpc.call('decode', {'string': inv3})
assert decode1['invreq_payer_id'] == decode3['invreq_payer_id']


def test_pay_unannounced_routehint(node_factory, bitcoind):
"""Tests whether sender can pay recipient through unannounced channels with
2 hops where the second hop uses a route hint."""

l1, l2, l3 = node_factory.get_nodes(3)

# l1 and l3 are connected with unannounced channels to l2
node_factory.join_nodes([l1, l2], announce_channels=False)
node_factory.join_nodes([l2, l3], announce_channels=False)
scid23 = l3.rpc.listpeerchannels(l2.info['id'])['channels'][0]['alias']['remote']
routel2l3 = [{'id': l2.info['id'],
'short_channel_id': scid23,
'fee_base_msat': 1000,
'fee_proportional_millionths': 10,
'cltv_expiry_delta': 6}]
inv = l3.dev_invoice(amount_msat=2100000,
label='test_pay_unannounced_routehint',
description='desc',
dev_routes=[routel2l3])
result = l1.rpc.pay(inv['bolt11'])
assert result["status"] == "complete", f"pay result is {result}"
Loading