Skip to content

Commit fa29382

Browse files
author
MarcoFalke
committed
test: Fix test cache issue
The documentation did not match the implementation, no coins were mined to the OP_TRUE address.
1 parent fa085b4 commit fa29382

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

test/functional/feature_blockfilterindex_prune.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def run_test(self):
3333

3434
self.log.info("prune some blocks")
3535
pruneheight = self.nodes[0].pruneblockchain(400)
36-
assert_equal(pruneheight, 250)
36+
assert_equal(pruneheight, 248)
3737

3838
self.log.info("check if we can access the tips blockfilter when we have pruned some blocks")
3939
assert_greater_than(len(self.nodes[0].getblockfilter(self.nodes[0].getbestblockhash())['filter']), 0)

test/functional/test_framework/test_framework.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,11 +739,12 @@ def _initialize_chain(self):
739739
# block in the cache does not age too much (have an old tip age).
740740
# This is needed so that we are out of IBD when the test starts,
741741
# see the tip age check in IsInitialBlockDownload().
742-
gen_addresses = [k.address for k in TestNode.PRIV_KEYS] + [ADDRESS_BCRT1_P2WSH_OP_TRUE]
742+
gen_addresses = [k.address for k in TestNode.PRIV_KEYS][:3] + [ADDRESS_BCRT1_P2WSH_OP_TRUE]
743+
assert_equal(len(gen_addresses), 4)
743744
for i in range(8):
744745
cache_node.generatetoaddress(
745746
nblocks=25 if i != 7 else 24,
746-
address=gen_addresses[i % 4],
747+
address=gen_addresses[i % len(gen_addresses)],
747748
)
748749

749750
assert_equal(cache_node.getblockchaininfo()["blocks"], 199)

0 commit comments

Comments
 (0)