diff options
author | merge-script <90386131+bitcoin-core-merge-script@users.noreply.github.com> | 2021-09-09 14:02:45 +0200 |
---|---|---|
committer | merge-script <90386131+bitcoin-core-merge-script@users.noreply.github.com> | 2021-09-09 14:02:45 +0200 |
commit | a5d00d4baff27b4185ea086af571142af17c32e4 (patch) | |
tree | 70d2e453b03cb6c8883a8f2967abbd9c54f046a7 /test/functional/feature_pruning.py | |
parent | eb1f5706dfd51cb61491aba887b5b8b9dce396f6 (diff) | |
parent | fa0b916971e5bc23ad6396831940a2899ca05402 (diff) |
Merge bitcoin/bitcoin#22788: scripted-diff: Use generate* from TestFramework
fa0b916971e5bc23ad6396831940a2899ca05402 scripted-diff: Use generate* from TestFramework (MarcoFalke)
Pull request description:
This is needed for #22567.
By using the newly added `generate*` member functions of the test framework, it paves the way to make it easier to implicitly call `sync_all` after block generation to avoid intermittent issues.
ACKs for top commit:
jonatack:
ACK fa0b916971e5bc23ad6396831940a2899ca05402
Tree-SHA512: e74a324b60250a87c08847cdfd7b6ce3e1d89b891659fd168f6dd7dc0aa718d0edd28285374a613f462f34f4ef8e12c90ad44fb58721c91b2ea691406ad22c2a
Diffstat (limited to 'test/functional/feature_pruning.py')
-rwxr-xr-x | test/functional/feature_pruning.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/functional/feature_pruning.py b/test/functional/feature_pruning.py index 2f0868e733..c2463d0bcc 100755 --- a/test/functional/feature_pruning.py +++ b/test/functional/feature_pruning.py @@ -118,9 +118,9 @@ class PruneTest(BitcoinTestFramework): def create_big_chain(self): # Start by creating some coinbases we can spend later - self.nodes[1].generate(200) + self.generate(self.nodes[1], 200) self.sync_blocks(self.nodes[0:2]) - self.nodes[0].generate(150) + self.generate(self.nodes[0], 150) # Then mine enough full blocks to create more than 550MiB of data mine_large_blocks(self.nodes[0], 645) @@ -211,7 +211,7 @@ class PruneTest(BitcoinTestFramework): self.disconnect_nodes(1, 2) self.log.info("Generating new longer chain of 300 more blocks") - self.nodes[1].generate(300) + self.generate(self.nodes[1], 300) self.log.info("Reconnect nodes") self.connect_nodes(0, 1) @@ -263,7 +263,7 @@ class PruneTest(BitcoinTestFramework): self.nodes[0].invalidateblock(curchainhash) assert_equal(self.nodes[0].getblockcount(), self.mainchainheight) assert_equal(self.nodes[0].getbestblockhash(), self.mainchainhash2) - goalbesthash = self.nodes[0].generate(blocks_to_mine)[-1] + goalbesthash = self.generate(self.nodes[0], blocks_to_mine)[-1] goalbestheight = first_reorg_height + 1 self.log.info("Verify node 2 reorged back to the main chain, some blocks of which it had to redownload") @@ -306,7 +306,7 @@ class PruneTest(BitcoinTestFramework): assert_equal(block1_details["nTx"], len(block1_details["tx"])) # mine 6 blocks so we are at height 1001 (i.e., above PruneAfterHeight) - node.generate(6) + self.generate(node, 6) assert_equal(node.getblockchaininfo()["blocks"], 1001) # Pruned block should still know the number of transactions @@ -337,7 +337,7 @@ class PruneTest(BitcoinTestFramework): assert has_block(2), "blk00002.dat is still there, should be pruned by now" # advance the tip so blk00002.dat and blk00003.dat can be pruned (the last 288 blocks should now be in blk00004.dat) - node.generate(288) + self.generate(node, 288) prune(1000) assert not has_block(2), "blk00002.dat is still there, should be pruned by now" assert not has_block(3), "blk00003.dat is still there, should be pruned by now" |