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

Function test_bitcoin_bad_estimatefee

tests/test_plugin.py:2167–2190  ·  view source on GitHub ↗

This tests that we don't crash if bitcoind backend gives bad estimatefees.

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

2165
2166
2167def test_bitcoin_bad_estimatefee(node_factory, bitcoind):
2168 """
2169 This tests that we don't crash if bitcoind backend gives bad estimatefees.
2170 """
2171 plugin = os.path.join(os.getcwd(), "tests/plugins/badestimate.py")
2172 l1 = node_factory.get_node(options={"disable-plugin": "bcli",
2173 "plugin": plugin,
2174 "badestimate-badorder": True},
2175 start=False,
2176 may_fail=True)
2177 l1.daemon.start(wait_for_initialized=False, stderr_redir=True)
2178 assert l1.daemon.wait() == 1
2179 l1.daemon.is_in_stderr(r"badestimate.py error: bad response to estimatefees.feerates \(Blocks must be ascending order: 2 <= 100!\)")
2180
2181 del l1.daemon.opts["badestimate-badorder"]
2182 l1.start()
2183
2184 l2 = node_factory.get_node(options={"disable-plugin": "bcli",
2185 "plugin": plugin})
2186 # Give me some funds.
2187 bitcoind.generate_block(5)
2188 l1.fundwallet(100 * 10**8)
2189 l1.connect(l2)
2190 l1.rpc.fundchannel(l2.info["id"], 50 * 10**8)
2191
2192
2193def test_bcli(node_factory, bitcoind, chainparams):

Callers

nothing calls this directly

Calls 9

joinMethod · 0.80
is_in_stderrMethod · 0.80
generate_blockMethod · 0.80
fundwalletMethod · 0.80
get_nodeMethod · 0.45
startMethod · 0.45
waitMethod · 0.45
connectMethod · 0.45
fundchannelMethod · 0.45

Tested by

no test coverage detected