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

Function test_closing_negotiation_step_100pct

tests/test_closing.py:432–448  ·  view source on GitHub ↗

Test that the closing fee negotiation step works, 100%

(node_factory, bitcoind, chainparams)

Source from the content-addressed store, hash-verified

430@unittest.skipIf(EXPERIMENTAL_FEATURES, "anchors uses quick-close, not negotiation")
431@unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "Different closing fees")
432def test_closing_negotiation_step_100pct(node_factory, bitcoind, chainparams):
433 """Test that the closing fee negotiation step works, 100%"""
434 opts = {}
435 opts['fee_negotiation_step'] = '100%'
436
437 opts['close_initiated_by'] = 'opener'
438 opts['expected_close_fee'] = 20001
439 closing_negotiation_step(node_factory, bitcoind, chainparams, opts)
440
441 # The close fee of 20499 looks strange in this case - one would expect
442 # to have a number close to 21000. This is because
443 # * the range is initially set to [20000 (peer), 21000 (opener)]
444 # * the opener is always first to propose, he uses 50% step, so he proposes 20500
445 # * the range is narrowed to [20001, 20499] and the peer proposes 20499
446 opts['close_initiated_by'] = 'peer'
447 opts['expected_close_fee'] = 20499
448 closing_negotiation_step(node_factory, bitcoind, chainparams, opts)
449
450
451@unittest.skipIf(EXPERIMENTAL_FEATURES, "anchors uses quick-close, not negotiation")

Callers

nothing calls this directly

Calls 1

closing_negotiation_stepFunction · 0.85

Tested by

no test coverage detected