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:
Matt Corallo committed 2019-08-02 15:37:13 -04:00
1 parent e653eeff76
commit 970de70bdd
3 files changed
+12 -2

No files matched your search

+2 -1
View File
@@ -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()