MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_update_fee

Function test_update_fee

tests/test_connection.py:2344–2378  ·  view source on GitHub ↗
(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

2342
2343@pytest.mark.developer
2344def test_update_fee(node_factory, bitcoind):
2345 l1, l2 = node_factory.line_graph(2, fundchannel=True)
2346 chanid = l1.get_channel_scid(l2)
2347
2348 # Make l1 send out feechange.
2349 l1.set_feerates((14000, 11000, 7500, 3750))
2350
2351 # Now make sure an HTLC works.
2352 # (First wait for route propagation.)
2353 l1.wait_channel_active(chanid)
2354 sync_blockheight(bitcoind, [l1, l2])
2355
2356 # Make payments.
2357 l1.pay(l2, 200000000)
2358 # First payment causes fee update.
2359 l2.daemon.wait_for_log('peer updated fee to 11000')
2360 l2.pay(l1, 100000000)
2361
2362 # Now shutdown cleanly.
2363 l1.rpc.close(chanid)
2364
2365 l1.daemon.wait_for_log(' to CLOSINGD_COMPLETE')
2366 l2.daemon.wait_for_log(' to CLOSINGD_COMPLETE')
2367
2368 # And should put closing into mempool.
2369 l1.wait_for_channel_onchain(l2.info['id'])
2370 l2.wait_for_channel_onchain(l1.info['id'])
2371
2372 bitcoind.generate_block(1)
2373 l1.daemon.wait_for_log(' to ONCHAIN')
2374 l2.daemon.wait_for_log(' to ONCHAIN')
2375
2376 bitcoind.generate_block(99)
2377 l1.daemon.wait_for_log('onchaind complete, forgetting peer')
2378 l2.daemon.wait_for_log('onchaind complete, forgetting peer')
2379
2380
2381@pytest.mark.developer

Callers

nothing calls this directly

Calls 10

sync_blockheightFunction · 0.90
line_graphMethod · 0.80
get_channel_scidMethod · 0.80
set_feeratesMethod · 0.80
wait_channel_activeMethod · 0.80
wait_for_logMethod · 0.80
generate_blockMethod · 0.80
payMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected