7
7
from test_framework .util import (
8
8
assert_equal
9
9
)
10
- from test_framework .blocktools import (
11
- create_block ,
12
- create_coinbase ,
13
- add_witness_commitment
14
- )
15
10
from test_framework .wallet import MiniWallet
16
11
17
12
@@ -24,18 +19,10 @@ def run_test(self):
24
19
self .log .info ("ensure that large blocks don't crash or freeze in -fastprune" )
25
20
wallet = MiniWallet (self .nodes [0 ])
26
21
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 )
39
26
40
27
41
28
if __name__ == '__main__' :
0 commit comments