Minor cleanups.

1. connect convenience variable for improved readabilty.
2. a comment explaining that timer is on channel, not HTLC.
3. use modern python style in test_htlc_send_timeout

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-08-10 11:01:40 +09:30
committed by Christian Decker
parent 63e4ea17af
commit 65c882ca3a
3 changed files with 14 additions and 12 deletions

View File

@@ -807,15 +807,16 @@ def test_htlc_send_timeout(node_factory, bitcoind):
# tries to ping before sending WIRE_COMMITMENT_SIGNED.
time.sleep(30)
inv = l3.rpc.invoice(123000, 'test_htlc_send_timeout', 'description')
try:
with pytest.raises(RpcError) as excinfo:
l1.rpc.pay(inv['bolt11'])
except RpcError as err:
# Complaints it couldn't find route.
assert err.error['code'] == 205
# Temporary channel failure
assert only_one(err.error['data']['failures'])['failcode'] == 0x1007
assert only_one(err.error['data']['failures'])['erring_node'] == l2.info['id']
assert only_one(err.error['data']['failures'])['erring_channel'] == chanid2
err = excinfo.value
# Complaints it couldn't find route.
assert err.error['code'] == 205
# Temporary channel failure
assert only_one(err.error['data']['failures'])['failcode'] == 0x1007
assert only_one(err.error['data']['failures'])['erring_node'] == l2.info['id']
assert only_one(err.error['data']['failures'])['erring_channel'] == chanid2
# L1 should send a ping beforehand, and get reply, then send commitment.
l1.daemon.wait_for_log('channeld.*:\[OUT\] 0012')