mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-15 16:38:23 +01:00
test: remove bare CTransaction .rehash()/.calc_sha256() calls
Since the previous commit, CTransaction object calls to the methods `.rehash()` and `.calc_sha256()` are effectively no-ops if the returned value is not used, so we can just remove them.
This commit is contained in:
@@ -93,7 +93,6 @@ class InvalidBlockRequestTest(BitcoinTestFramework):
|
||||
|
||||
block2_dup = copy.deepcopy(block2_orig)
|
||||
block2_dup.vtx[2].vin.append(block2_dup.vtx[2].vin[0])
|
||||
block2_dup.vtx[2].rehash()
|
||||
block2_dup.hashMerkleRoot = block2_dup.calc_merkle_root()
|
||||
block2_dup.solve()
|
||||
peer.send_blocks_and_test([block2_dup], node, success=False, reject_reason='bad-txns-inputs-duplicate')
|
||||
@@ -122,7 +121,6 @@ class InvalidBlockRequestTest(BitcoinTestFramework):
|
||||
# Create a block that spends the output of a tx in a previous block.
|
||||
tx3 = create_tx_with_script(tx2, 0, script_sig=bytes([OP_TRUE]), amount=50 * COIN)
|
||||
tx3.vin.append(tx3.vin[0]) # Duplicates input
|
||||
tx3.rehash()
|
||||
block4 = create_block(tip, create_coinbase(height), block_time, txlist=[tx3])
|
||||
block4.solve()
|
||||
self.log.info("Test inflation by duplicating input")
|
||||
|
||||
Reference in New Issue
Block a user