Skip to content

Commit fa17767

Browse files
author
MarcoFalke
committed
test: Simplify feature_fastprune.py
1 parent 8a373a5 commit fa17767

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

test/functional/feature_fastprune.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
from test_framework.util import (
88
assert_equal
99
)
10-
from test_framework.blocktools import (
11-
create_block,
12-
create_coinbase,
13-
add_witness_commitment
14-
)
1510
from test_framework.wallet import MiniWallet
1611

1712

@@ -24,18 +19,10 @@ def run_test(self):
2419
self.log.info("ensure that large blocks don't crash or freeze in -fastprune")
2520
wallet = MiniWallet(self.nodes[0])
2621
tx = wallet.create_self_transfer()['tx']
27-
annex = [0x50]
28-
for _ in range(0x10000):
29-
annex.append(0xff)
30-
tx.wit.vtxinwit[0].scriptWitness.stack.append(bytes(annex))
31-
tip = int(self.nodes[0].getbestblockhash(), 16)
32-
time = self.nodes[0].getblock(self.nodes[0].getbestblockhash())['time'] + 1
33-
height = self.nodes[0].getblockcount() + 1
34-
block = create_block(hashprev=tip, ntime=time, txlist=[tx], coinbase=create_coinbase(height=height))
35-
add_witness_commitment(block)
36-
block.solve()
37-
self.nodes[0].submitblock(block.serialize().hex())
38-
assert_equal(int(self.nodes[0].getbestblockhash(), 16), block.sha256)
22+
annex = b"\x50" + b"\xff" * 0x10000
23+
tx.wit.vtxinwit[0].scriptWitness.stack.append(annex)
24+
self.generateblock(self.nodes[0], output="raw(55)", transactions=[tx.serialize().hex()])
25+
assert_equal(self.nodes[0].getblockcount(), 201)
3926

4027

4128
if __name__ == '__main__':

0 commit comments

Comments
 (0)