MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / test_pruning

Method test_pruning

test/functional/mining_basic.py:255–268  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

253 node.submitheader(hexdata=CBlockHeader(bad_block).serialize().hex())
254
255 def test_pruning(self):
256 self.log.info("Test that submitblock stores previously pruned block")
257 prune_node = self.nodes[2]
258 self.generate(prune_node, 400, sync_fun=self.no_op)
259 pruned_block = prune_node.getblock(prune_node.getblockhash(2), verbosity=0)
260 pruned_height = prune_node.pruneblockchain(400)
261 assert_greater_than_or_equal(pruned_height, 2)
262 pruned_blockhash = prune_node.getblockhash(2)
263
264 assert_raises_rpc_error(-1, 'Block not available (pruned data)', prune_node.getblock, pruned_blockhash)
265
266 result = prune_node.submitblock(pruned_block)
267 assert_equal(result, "inconclusive")
268 assert_equal(prune_node.getblock(pruned_blockhash, verbosity=0), pruned_block)
269
270
271 def send_transactions(self, utxos, fee_rate, target_vsize):

Callers 1

run_testMethod · 0.95

Calls 5

assert_raises_rpc_errorFunction · 0.90
assert_equalFunction · 0.90
infoMethod · 0.80
generateMethod · 0.45

Tested by

no test coverage detected