mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-04 04:32:20 +02:00
Merge #16525: Dump transaction version as an unsigned integer in RPC/TxToUniv
e80259f197
Additionally treat Tx.nVersion as unsigned in joinpsbts (Matt Corallo)970de70bdd
Dump transaction version as an unsigned integer in RPC/TxToUniv (Matt Corallo) Pull request description: 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 ACKs for top commit: sipa: ACKe80259f197
practicalswift: ACKe80259f197
ajtowns: ACKe80259f197
code review -- checked all other uses of tx.nVersion treat it as unsigned (except for policy.cpp:IsStandard anyway), so looks good. naumenkogs: ACKe80259f
Tree-SHA512: 6760a2c77e24e9e1f79a336ca925f9bbca3a827ce02003c71d7f214b82ed3dea13fa7d9f87df9b9445cd58dff8b44a15571d821c876f22f8e5a372a014c9976b
This commit is contained in:
@ -424,11 +424,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