From 13f14ad2d5e61f612a9d3ceb63d6230e150beffe Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Tue, 19 May 2020 11:46:27 +0200 Subject: [PATCH] pytest: add sanity check for --commit-fee Signed-off-by: Antoine Poinsot --- tests/test_misc.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_misc.py b/tests/test_misc.py index 378ebc447b24..427a9c9f6c7e 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -2375,3 +2375,16 @@ def test_getsharedsecret(node_factory): # knowing only the public key of the other. assert (l1.rpc.getsharedsecret(l2.info["id"])["shared_secret"] == l2.rpc.getsharedsecret(l1.info["id"])["shared_secret"]) + + +def test_commitfee_option(node_factory): + """Sanity check for the --commit-fee startup option.""" + l1, l2 = node_factory.get_nodes(2, opts=[{"commit-fee": "200"}, {}]) + + mock_wu = 5000 + for l in [l1, l2]: + l.set_feerates((mock_wu, 0, 0, 0), True) + l1_commit_fees = l1.rpc.call("estimatefees")["unilateral_close"] + l2_commit_fees = l2.rpc.call("estimatefees")["unilateral_close"] + + assert l1_commit_fees == 2 * l2_commit_fees == 2 * 4 * mock_wu # WU->VB