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

Function test_update_fee

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

Source from the content-addressed store, hash-verified

2455
2456
2457def test_update_fee(node_factory, bitcoind):
2458 l1, l2 = node_factory.line_graph(2, fundchannel=True)
2459 chanid = l1.get_channel_scid(l2)
2460
2461 # Make l1 send out feechange.
2462 l1.set_feerates((14000, 11000, 7500, 3750))
2463
2464 # Make payments.
2465 l1.pay(l2, 200000000)
2466 # First payment causes fee update.
2467 if 'anchors/even' in only_one(l2.rpc.listpeerchannels()['channels'])['channel_type']['names']:
2468 l2.daemon.wait_for_log('peer updated fee to 3755')
2469 else:
2470 l2.daemon.wait_for_log('peer updated fee to 11005')
2471 l2.pay(l1, 100000000)
2472
2473 # Now shutdown cleanly.
2474 l1.rpc.close(chanid)
2475
2476 l1.daemon.wait_for_log(' to CLOSINGD_COMPLETE')
2477 l2.daemon.wait_for_log(' to CLOSINGD_COMPLETE')
2478
2479 # And should put closing into mempool.
2480 l1.wait_for_channel_onchain(l2.info['id'])
2481 l2.wait_for_channel_onchain(l1.info['id'])
2482
2483 bitcoind.generate_block(1)
2484 l1.daemon.wait_for_log(' to ONCHAIN')
2485 l2.daemon.wait_for_log(' to ONCHAIN')
2486
2487 bitcoind.generate_block(99)
2488 l1.daemon.wait_for_log('onchaind complete, forgetting peer')
2489 l2.daemon.wait_for_log('onchaind complete, forgetting peer')
2490
2491
2492def test_fee_limits(node_factory, bitcoind):

Callers

nothing calls this directly

Calls 10

only_oneFunction · 0.90
line_graphMethod · 0.80
get_channel_scidMethod · 0.80
set_feeratesMethod · 0.80
listpeerchannelsMethod · 0.80
wait_for_logMethod · 0.80
generate_blockMethod · 0.80
payMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected