mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: Fix tests broken by the pay and paystatus changes
This commit collects the changes required to the tests caused by the changes to the `pay` and `paystatus` commands. They are also rather good hints as to what these changes entail.
This commit is contained in:
@@ -1365,7 +1365,7 @@ def test_reserve_enforcement(node_factory, executor):
|
||||
|
||||
|
||||
@unittest.skipIf(not DEVELOPER, "needs dev_disconnect")
|
||||
def test_htlc_send_timeout(node_factory, bitcoind):
|
||||
def test_htlc_send_timeout(node_factory, bitcoind, compat):
|
||||
"""Test that we don't commit an HTLC to an unreachable node."""
|
||||
# Feerates identical so we don't get gratuitous commit to update them
|
||||
l1 = node_factory.get_node(options={'log-level': 'io'},
|
||||
@@ -1395,13 +1395,13 @@ def test_htlc_send_timeout(node_factory, bitcoind):
|
||||
timedout = True
|
||||
|
||||
inv = l3.rpc.invoice(123000, 'test_htlc_send_timeout', 'description')
|
||||
with pytest.raises(RpcError, match=r'Ran out of routes to try after 1 attempt: see paystatus') as excinfo:
|
||||
with pytest.raises(RpcError, match=r'Ran out of routes to try after 1 attempt') as excinfo:
|
||||
l1.rpc.pay(inv['bolt11'])
|
||||
|
||||
err = excinfo.value
|
||||
# Complains it stopped after several attempts.
|
||||
# FIXME: include in pylightning
|
||||
PAY_STOPPED_RETRYING = 210
|
||||
PAY_STOPPED_RETRYING = 210 if compat('090') else 205
|
||||
assert err.error['code'] == PAY_STOPPED_RETRYING
|
||||
|
||||
status = only_one(l1.rpc.call('paystatus')['pay'])
|
||||
|
||||
Reference in New Issue
Block a user