test: simplify feature_init

pull/28612/head
Fabian Jahr 1 year ago committed by L0la L33tz
parent d2b8c5e123
commit 64b80d5c5b

@ -133,15 +133,12 @@ class InitStressTest(BitcoinTestFramework):
for target_file in target_files:
self.log.info(f"Perturbing file to ensure failure {target_file}")
with open(target_file, "rb") as tf_read:
contents = tf_read.read()
tweaked_contents = bytearray(contents)
with open(target_file, "r+b") as tf:
# Since the genesis block is not checked by -checkblocks, the
# perturbation window must be chosen such that a higher block
# in blk*.dat is affected.
tweaked_contents[150:350] = b'1' * 200
with open(target_file, "wb") as tf_write:
tf_write.write(bytes(tweaked_contents))
tf.seek(150)
tf.write(b'1' * 200)
start_expecting_error(err_fragment)

Loading…
Cancel
Save