From 0f25b7b37fb2eb814e3e14d0539b1e5034f838f1 Mon Sep 17 00:00:00 2001 From: Michael Schmoock Date: Thu, 31 Mar 2022 14:26:55 +0200 Subject: [PATCH] pytest: test custom config options for fees and htlc limits --- tests/test_pay.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/test_pay.py b/tests/test_pay.py index 1a4c23f50419..56def1c0caec 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -2376,6 +2376,29 @@ def test_setchannel_all(node_factory, bitcoind): assert result['channels'][1]['maximum_htlc_out_msat'] == 0xCAFE +@pytest.mark.developer("updates are delayed without --dev-fast-gossip") +def test_setchannel_startup_opts(node_factory, bitcoind): + """Tests that custom config/cmdline options are applied correctly when set + """ + opts = { + 'fee-base': 2, + 'fee-per-satoshi': 3, + 'htlc-minimum-msat': '4msat', + 'htlc-maximum-msat': '5msat' + } + l1, l2 = node_factory.line_graph(2, opts=opts, wait_for_announce=True) + + result = l2.rpc.listchannels()['channels'] + assert result[0]['base_fee_millisatoshi'] == 2 + assert result[0]['fee_per_millionth'] == 3 + assert result[0]['htlc_minimum_msat'] == Millisatoshi(4) + assert result[0]['htlc_maximum_msat'] == Millisatoshi(5) + assert result[1]['base_fee_millisatoshi'] == 2 + assert result[1]['fee_per_millionth'] == 3 + assert result[1]['htlc_minimum_msat'] == Millisatoshi(4) + assert result[1]['htlc_maximum_msat'] == Millisatoshi(5) + + @pytest.mark.developer("gossip without DEVELOPER=1 is slow") def test_channel_spendable(node_factory, bitcoind): """Test that spendable_msat is accurate"""