|
15 | 15 | import copy
|
16 | 16 | import time
|
17 | 17 |
|
18 |
| -from test_framework.blocktools import create_block, create_coinbase, create_tx_with_script |
| 18 | +from test_framework.blocktools import ( |
| 19 | + create_block, |
| 20 | + create_coinbase, |
| 21 | + create_tx_with_script, |
| 22 | +) |
19 | 23 | from test_framework.messages import COIN
|
20 | 24 | from test_framework.p2p import P2PDataStore
|
| 25 | +from test_framework.script import OP_TRUE |
21 | 26 | from test_framework.test_framework import BitcoinTestFramework
|
22 | 27 | from test_framework.util import assert_equal
|
23 | 28 |
|
@@ -66,9 +71,8 @@ def run_test(self):
|
66 | 71 | # For more information on merkle-root malleability see src/consensus/merkle.cpp.
|
67 | 72 | self.log.info("Test merkle root malleability.")
|
68 | 73 |
|
69 |
| - # b'0x51' is OP_TRUE |
70 |
| - tx1 = create_tx_with_script(block1.vtx[0], 0, script_sig=b'\x51', amount=50 * COIN) |
71 |
| - tx2 = create_tx_with_script(tx1, 0, script_sig=b'\x51', amount=50 * COIN) |
| 74 | + tx1 = create_tx_with_script(block1.vtx[0], 0, script_sig=bytes([OP_TRUE]), amount=50 * COIN) |
| 75 | + tx2 = create_tx_with_script(tx1, 0, script_sig=bytes([OP_TRUE]), amount=50 * COIN) |
72 | 76 | block2 = create_block(tip, create_coinbase(height), block_time, txlist=[tx1, tx2])
|
73 | 77 | block_time += 1
|
74 | 78 | block2.solve()
|
@@ -115,7 +119,7 @@ def run_test(self):
|
115 | 119 |
|
116 | 120 | # Complete testing of CVE-2018-17144, by checking for the inflation bug.
|
117 | 121 | # Create a block that spends the output of a tx in a previous block.
|
118 |
| - tx3 = create_tx_with_script(tx2, 0, script_sig=b'\x51', amount=50 * COIN) |
| 122 | + tx3 = create_tx_with_script(tx2, 0, script_sig=bytes([OP_TRUE]), amount=50 * COIN) |
119 | 123 | tx3.vin.append(tx3.vin[0]) # Duplicates input
|
120 | 124 | tx3.rehash()
|
121 | 125 | block4 = create_block(tip, create_coinbase(height), block_time, txlist=[tx3])
|
|
0 commit comments