aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_taproot.py
diff options
context:
space:
mode:
authorAva Chow <github@achow101.com>2024-01-26 15:27:13 -0500
committerAva Chow <github@achow101.com>2024-06-07 13:55:23 -0400
commit429ec1aaaaafab150f11e27fcf132a99b57c4fc7 (patch)
treee09999b341f124bf12712f5111d563a9003f1872 /test/functional/feature_taproot.py
parent27e70f1f5be1f536f2314cd2ea42b4f80d927fbd (diff)
downloadbitcoin-429ec1aaaaafab150f11e27fcf132a99b57c4fc7.tar.xz
refactor: Rename CTransaction::nVersion to version
In order to ensure that the change of nVersion to a uint32_t in the previous commit has no effect, rename nVersion to version in this commit so that reviewers can easily spot if a spot was missed or if there is a check somewhere whose semantics have changed.
Diffstat (limited to 'test/functional/feature_taproot.py')
-rwxr-xr-xtest/functional/feature_taproot.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/functional/feature_taproot.py b/test/functional/feature_taproot.py
index 210ec54329..1a0844d240 100755
--- a/test/functional/feature_taproot.py
+++ b/test/functional/feature_taproot.py
@@ -1408,10 +1408,10 @@ class TaprootTest(BitcoinTestFramework):
left = done
while left:
- # Construct CTransaction with random nVersion, nLocktime
+ # Construct CTransaction with random version, nLocktime
tx = CTransaction()
- tx.nVersion = random.choice([1, 2, random.getrandbits(32)])
- min_sequence = (tx.nVersion != 1 and tx.nVersion != 0) * 0x80000000 # The minimum sequence number to disable relative locktime
+ tx.version = random.choice([1, 2, random.getrandbits(32)])
+ min_sequence = (tx.version != 1 and tx.version != 0) * 0x80000000 # The minimum sequence number to disable relative locktime
if random.choice([True, False]):
tx.nLockTime = random.randrange(LOCKTIME_THRESHOLD, self.lastblocktime - 7200) # all absolute locktimes in the past
else:
@@ -1502,8 +1502,8 @@ class TaprootTest(BitcoinTestFramework):
is_standard_tx = (
fail_input is None # Must be valid to be standard
and (all(utxo.spender.is_standard for utxo in input_utxos)) # All inputs must be standard
- and tx.nVersion >= 1 # The tx version must be standard
- and tx.nVersion <= 2)
+ and tx.version >= 1 # The tx version must be standard
+ and tx.version <= 2)
tx.rehash()
msg = ','.join(utxo.spender.comment + ("*" if n == fail_input else "") for n, utxo in enumerate(input_utxos))
if is_standard_tx:
@@ -1530,7 +1530,7 @@ class TaprootTest(BitcoinTestFramework):
# Deterministically mine coins to OP_TRUE in block 1
assert_equal(self.nodes[0].getblockcount(), 0)
coinbase = CTransaction()
- coinbase.nVersion = 1
+ coinbase.version = 1
coinbase.vin = [CTxIn(COutPoint(0, 0xffffffff), CScript([OP_1, OP_1]), SEQUENCE_FINAL)]
coinbase.vout = [CTxOut(5000000000, CScript([OP_1]))]
coinbase.nLockTime = 0
@@ -1622,7 +1622,7 @@ class TaprootTest(BitcoinTestFramework):
for i, spk in enumerate(old_spks + tap_spks):
val = 42000000 * (i + 7)
tx = CTransaction()
- tx.nVersion = 1
+ tx.version = 1
tx.vin = [CTxIn(COutPoint(lasttxid, i & 1), CScript([]), SEQUENCE_FINAL)]
tx.vout = [CTxOut(val, spk), CTxOut(amount - val, CScript([OP_1]))]
if i & 1:
@@ -1679,7 +1679,7 @@ class TaprootTest(BitcoinTestFramework):
# Construct a deterministic transaction spending all outputs created above.
tx = CTransaction()
- tx.nVersion = 2
+ tx.version = 2
tx.vin = []
inputs = []
input_spks = [tap_spks[0], tap_spks[1], old_spks[0], tap_spks[2], tap_spks[5], old_spks[2], tap_spks[6], tap_spks[3], tap_spks[4]]