From af7044d09d627a3336a24e89cd15bd0e7590f9c0 Mon Sep 17 00:00:00 2001 From: Simon Vrouwe Date: Tue, 23 Jul 2019 17:14:23 +0300 Subject: [PATCH] pytest: test_fee_limits, add case where opening channel is denied when feerate is too low --- tests/test_connection.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_connection.py b/tests/test_connection.py index a511d7a1f..be3ac450f 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -1166,7 +1166,6 @@ def test_update_fee(node_factory, bitcoind): @unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1") def test_fee_limits(node_factory): - # FIXME: Test case where opening denied. l1, l2 = node_factory.line_graph(2, opts={'dev-max-fee-multiplier': 5, 'may_reconnect': True}, fundchannel=True) # L1 asks for stupid low fee (will actually hit the floor of 253) @@ -1180,6 +1179,12 @@ def test_fee_limits(node_factory): # bitcoind feels! l1.daemon.wait_for_log('sendrawtx exit') + # Trying to open a channel with too low a fee-rate is denied + l4 = node_factory.get_node() + l1.rpc.connect(l4.info['id'], 'localhost', l4.port) + with pytest.raises(RpcError, match='They sent error .* feerate_per_kw 253 below minimum'): + l1.fund_channel(l4, 10**6) + # Restore to normal. l1.stop() l1.set_feerates((15000, 7500, 3750), False)