diff options
author | fanquake <fanquake@gmail.com> | 2023-05-03 09:31:14 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-05-03 09:47:19 +0100 |
commit | 067a835adba9d7b3db848573f6153b0a827eac09 (patch) | |
tree | 8e48c5b99ce1629e9d133c6eca6802e35575aa71 /test/functional | |
parent | da9f62f912294de07a595df0b4898aba4be6b69c (diff) | |
parent | fa17767154e21e9ed00782a9e4cf9a3d1d66f5d1 (diff) | |
download | bitcoin-067a835adba9d7b3db848573f6153b0a827eac09.tar.xz |
Merge bitcoin/bitcoin#27553: test: Simplify feature_fastprune.py
fa17767154e21e9ed00782a9e4cf9a3d1d66f5d1 test: Simplify feature_fastprune.py (MarcoFalke)
Pull request description:
The goal of the test is a single regression check to see if a RPC times out. It shouldn't do more than calling the RPC (and the minimum work needed to get there).
Fix that by removing all blocktools imports and a `for` loop.
ACKs for top commit:
pinheadmz:
ACK fa17767154e21e9ed00782a9e4cf9a3d1d66f5d1
theStack:
ACK fa17767154e21e9ed00782a9e4cf9a3d1d66f5d1
Tree-SHA512: c9c0154102199b250015ece53005a14d52d857dfa986f3b02a2cb899f16ac8e040d24eb826f35ba15e5ee22ee6a59bf8f74bb8d576b9a12ac6e888beeaaf81cc
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/feature_fastprune.py | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/test/functional/feature_fastprune.py b/test/functional/feature_fastprune.py index 825de63e3d..c913c4f93a 100755 --- a/test/functional/feature_fastprune.py +++ b/test/functional/feature_fastprune.py @@ -7,11 +7,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal ) -from test_framework.blocktools import ( - create_block, - create_coinbase, - add_witness_commitment -) from test_framework.wallet import MiniWallet @@ -24,18 +19,10 @@ class FeatureFastpruneTest(BitcoinTestFramework): self.log.info("ensure that large blocks don't crash or freeze in -fastprune") wallet = MiniWallet(self.nodes[0]) tx = wallet.create_self_transfer()['tx'] - annex = [0x50] - for _ in range(0x10000): - annex.append(0xff) - tx.wit.vtxinwit[0].scriptWitness.stack.append(bytes(annex)) - tip = int(self.nodes[0].getbestblockhash(), 16) - time = self.nodes[0].getblock(self.nodes[0].getbestblockhash())['time'] + 1 - height = self.nodes[0].getblockcount() + 1 - block = create_block(hashprev=tip, ntime=time, txlist=[tx], coinbase=create_coinbase(height=height)) - add_witness_commitment(block) - block.solve() - self.nodes[0].submitblock(block.serialize().hex()) - assert_equal(int(self.nodes[0].getbestblockhash(), 16), block.sha256) + annex = b"\x50" + b"\xff" * 0x10000 + tx.wit.vtxinwit[0].scriptWitness.stack.append(annex) + self.generateblock(self.nodes[0], output="raw(55)", transactions=[tx.serialize().hex()]) + assert_equal(self.nodes[0].getblockcount(), 201) if __name__ == '__main__': |