mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
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.
This commit is contained in:
@@ -465,28 +465,28 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||
# Test the minimum transaction version number that fits in a signed 32-bit integer.
|
||||
# As transaction version is serialized unsigned, this should convert to its unsigned equivalent.
|
||||
tx = CTransaction()
|
||||
tx.nVersion = 0x80000000
|
||||
tx.version = 0x80000000
|
||||
rawtx = tx.serialize().hex()
|
||||
decrawtx = self.nodes[0].decoderawtransaction(rawtx)
|
||||
assert_equal(decrawtx['version'], 0x80000000)
|
||||
|
||||
# Test the maximum transaction version number that fits in a signed 32-bit integer.
|
||||
tx = CTransaction()
|
||||
tx.nVersion = 0x7fffffff
|
||||
tx.version = 0x7fffffff
|
||||
rawtx = tx.serialize().hex()
|
||||
decrawtx = self.nodes[0].decoderawtransaction(rawtx)
|
||||
assert_equal(decrawtx['version'], 0x7fffffff)
|
||||
|
||||
# Test the minimum transaction version number that fits in an unsigned 32-bit integer.
|
||||
tx = CTransaction()
|
||||
tx.nVersion = 0
|
||||
tx.version = 0
|
||||
rawtx = tx.serialize().hex()
|
||||
decrawtx = self.nodes[0].decoderawtransaction(rawtx)
|
||||
assert_equal(decrawtx['version'], 0)
|
||||
|
||||
# Test the maximum transaction version number that fits in an unsigned 32-bit integer.
|
||||
tx = CTransaction()
|
||||
tx.nVersion = 0xffffffff
|
||||
tx.version = 0xffffffff
|
||||
rawtx = tx.serialize().hex()
|
||||
decrawtx = self.nodes[0].decoderawtransaction(rawtx)
|
||||
assert_equal(decrawtx['version'], 0xffffffff)
|
||||
|
||||
Reference in New Issue
Block a user