mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-30 02:31:05 +02:00
Dump transaction version as an unsigned integer in RPC/TxToUniv
Consensus-wise we already treat it as an unsigned integer (the only rules around it are in CSV/locktime handling), but changing the underlying data type means touching consensus code for a simple cleanup change, which isn't really worth it. See-also, https://github.com/rust-bitcoin/rust-bitcoin/pull/299
This commit is contained in:
@ -417,11 +417,12 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||
####################################
|
||||
|
||||
# Test the minimum transaction version number that fits in a signed 32-bit integer.
|
||||
# As transaction version is unsigned, this should convert to its unsigned equivalent.
|
||||
tx = CTransaction()
|
||||
tx.nVersion = -0x80000000
|
||||
rawtx = ToHex(tx)
|
||||
decrawtx = self.nodes[0].decoderawtransaction(rawtx)
|
||||
assert_equal(decrawtx['version'], -0x80000000)
|
||||
assert_equal(decrawtx['version'], 0x80000000)
|
||||
|
||||
# Test the maximum transaction version number that fits in a signed 32-bit integer.
|
||||
tx = CTransaction()
|
||||
|
Reference in New Issue
Block a user