Skip to content

Commit

Permalink
test: Fix test cache issue
Browse files Browse the repository at this point in the history
The documentation did not match the implementation, no coins
were mined to the OP_TRUE address.
  • Loading branch information
MarcoFalke committed Apr 23, 2021
1 parent fa085b4 commit fa29382
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/functional/feature_blockfilterindex_prune.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def run_test(self):

self.log.info("prune some blocks")
pruneheight = self.nodes[0].pruneblockchain(400)
assert_equal(pruneheight, 250)
assert_equal(pruneheight, 248)

self.log.info("check if we can access the tips blockfilter when we have pruned some blocks")
assert_greater_than(len(self.nodes[0].getblockfilter(self.nodes[0].getbestblockhash())['filter']), 0)
Expand Down
5 changes: 3 additions & 2 deletions test/functional/test_framework/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,11 +739,12 @@ def _initialize_chain(self):
# block in the cache does not age too much (have an old tip age).
# This is needed so that we are out of IBD when the test starts,
# see the tip age check in IsInitialBlockDownload().
gen_addresses = [k.address for k in TestNode.PRIV_KEYS] + [ADDRESS_BCRT1_P2WSH_OP_TRUE]
gen_addresses = [k.address for k in TestNode.PRIV_KEYS][:3] + [ADDRESS_BCRT1_P2WSH_OP_TRUE]
assert_equal(len(gen_addresses), 4)
for i in range(8):
cache_node.generatetoaddress(
nblocks=25 if i != 7 else 24,
address=gen_addresses[i % 4],
address=gen_addresses[i % len(gen_addresses)],
)

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

0 comments on commit fa29382

Please sign in to comment.