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:
@@ -277,7 +277,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||
tx = CTransaction()
|
||||
tx.vin.append(CTxIn(COutPoint(int(txid2, 16), 0), b""))
|
||||
tx.vout.append(CTxOut(int(49.95 * COIN), CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE]))) # Huge fee
|
||||
tx.calc_sha256()
|
||||
txid3 = self.nodes[0].sendrawtransaction(hexstring=tx.serialize().hex(), maxfeerate=0)
|
||||
assert tx.wit.is_null()
|
||||
assert txid3 in self.nodes[0].getrawmempool()
|
||||
@@ -305,7 +304,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||
tx.vin.append(CTxIn(COutPoint(int('0x' + utxo['txid'], 0), utxo['vout'])))
|
||||
for i in script_list:
|
||||
tx.vout.append(CTxOut(10000000, i))
|
||||
tx.rehash()
|
||||
signresults = self.nodes[0].signrawtransactionwithwallet(tx.serialize_without_witness().hex())['hex']
|
||||
txid = self.nodes[0].sendrawtransaction(hexstring=signresults, maxfeerate=0)
|
||||
txs_mined[txid] = self.generate(self.nodes[0], 1)[0]
|
||||
@@ -354,7 +352,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||
for j in range(len(txtmp.vout)):
|
||||
tx.vin.append(CTxIn(COutPoint(int('0x' + i, 0), j)))
|
||||
tx.vout.append(CTxOut(0, CScript()))
|
||||
tx.rehash()
|
||||
signresults = self.nodes[0].signrawtransactionwithwallet(tx.serialize_without_witness().hex())['hex']
|
||||
self.nodes[0].sendrawtransaction(hexstring=signresults, maxfeerate=0)
|
||||
self.generate(self.nodes[0], 1)
|
||||
|
||||
Reference in New Issue
Block a user