File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change 14
14
15
15
from collections import OrderedDict
16
16
from io import BytesIO
17
+ from test_framework .messages import CTransaction , ToHex
17
18
from test_framework .test_framework import BitcoinTestFramework
18
- from test_framework .messages import (
19
- CTransaction ,
20
- )
21
19
from test_framework .util import *
22
20
23
-
24
21
class multidict (dict ):
25
22
"""Dictionary that allows duplicate keys.
26
23
@@ -363,5 +360,23 @@ def run_test(self):
363
360
decrawtx = self .nodes [0 ].decoderawtransaction (rawtx )
364
361
assert_equal (decrawtx ['vin' ][0 ]['sequence' ], 4294967294 )
365
362
363
+ ####################################
364
+ # TRANSACTION VERSION NUMBER TESTS #
365
+ ####################################
366
+
367
+ # Test the minimum transaction version number that fits in a signed 32-bit integer.
368
+ tx = CTransaction ()
369
+ tx .nVersion = - 0x80000000
370
+ rawtx = ToHex (tx )
371
+ decrawtx = self .nodes [0 ].decoderawtransaction (rawtx )
372
+ assert_equal (decrawtx ['version' ], - 0x80000000 )
373
+
374
+ # Test the maximum transaction version number that fits in a signed 32-bit integer.
375
+ tx = CTransaction ()
376
+ tx .nVersion = 0x7fffffff
377
+ rawtx = ToHex (tx )
378
+ decrawtx = self .nodes [0 ].decoderawtransaction (rawtx )
379
+ assert_equal (decrawtx ['version' ], 0x7fffffff )
380
+
366
381
if __name__ == '__main__' :
367
382
RawTransactionsTest ().main ()
You can’t perform that action at this time.
0 commit comments