[rpc] Adds a functional test to validate the transaction version number in the RPC output #12436

pull l2a5b1 wants to merge 1 commits into bitcoin:master from l2a5b1:issue/11561/test-negative-transaction-version-numbers changing 1 files +19 −4
  1. l2a5b1 commented at 1:04 AM on February 15, 2018: contributor

    This PR attempts to resolve #11561 by addressing the feedback from @MarcoFalke; and @gmaxwell in #12430.

    Commit 30e9d24 adds a functional test to rpc_rawtransaction.py to assert that the transaction version number in the RPC output is a signed 32-bit integer.

    The functional test uses the raw transaction data from Mainnet transaction c659729a7fea5071361c2c1a68551ca2bf77679b27086cc415adeeb03852e369.

  2. fanquake added the label Tests on Feb 15, 2018
  3. promag commented at 10:47 AM on February 16, 2018: member

    utACK 30e9d24. Can you create the transaction programatically instead?

  4. l2a5b1 force-pushed on Mar 7, 2018
  5. l2a5b1 force-pushed on Mar 8, 2018
  6. l2a5b1 commented at 12:20 AM on March 9, 2018: contributor

    Thanks @promag! I have added two additional tests, which create the transaction programmatically per your request, to assert that the minimum and maximum transaction version number in the RPC output are a signed 32-bit integer. I have kept the utACKed test vector, because it is part of the issue that we are trying to resolve.

  7. in test/functional/rpc_rawtransaction.py:17 in afed502b6f outdated
      13 | @@ -14,6 +14,7 @@
      14 |  
      15 |  from test_framework.test_framework import BitcoinTestFramework
      16 |  from test_framework.util import *
      17 | +from test_framework.mininode import CTransaction, ToHex
    


    jnewbery commented at 9:29 PM on April 2, 2018:

    CTransaction is imported but unused ToHex is defined in test_framwork.messages and should be imported from there.

    Please sort imports alphabetically.

  8. in test/functional/rpc_rawtransaction.py:331 in afed502b6f outdated
     323 | @@ -323,5 +324,29 @@ def run_test(self):
     324 |          decrawtx= self.nodes[0].decoderawtransaction(rawtx)
     325 |          assert_equal(decrawtx['vin'][0]['sequence'], 4294967294)
     326 |  
     327 | +        ####################################
     328 | +        # TRANSACTION VERSION NUMBER TESTS #
     329 | +        ####################################
     330 | +
     331 | +        # Use Mainnet transaction c659729a7fea5071361c2c1a68551ca2bf77679b27086cc415adeeb03852e369
    


    jnewbery commented at 9:29 PM on April 2, 2018:

    I don't see the reason for using this particular transaction. The max and min versions below seem sufficient to me.

  9. l2a5b1 force-pushed on Apr 6, 2018
  10. l2a5b1 force-pushed on Apr 6, 2018
  11. l2a5b1 force-pushed on Apr 6, 2018
  12. Asserts that the tx version number is a signed 32-bit integer. 09b30db2b0
  13. l2a5b1 force-pushed on Apr 6, 2018
  14. l2a5b1 commented at 7:58 PM on April 6, 2018: contributor

    Thanks @jnewbery! I have addressed your feedback and rebased the feature branch onto master in 09b30db.

  15. jnewbery commented at 7:36 PM on April 9, 2018: member

    utACK 09b30db2b02aef03d15c2def9181bce93db400bb

  16. MarcoFalke commented at 2:13 AM on April 10, 2018: member

    utACK 09b30db2b02aef03d15c2def9181bce93db400bb

  17. laanwj merged this on Apr 24, 2018
  18. laanwj closed this on Apr 24, 2018

  19. laanwj referenced this in commit 6e67754e48 on Apr 24, 2018
  20. jasonbcox referenced this in commit d2b5b96439 on Aug 16, 2019
  21. PastaPastaPasta referenced this in commit d771f38538 on Nov 10, 2020
  22. PastaPastaPasta referenced this in commit 4fef156283 on Dec 11, 2020
  23. PastaPastaPasta referenced this in commit 28c66ee89b on Dec 12, 2020
  24. PastaPastaPasta referenced this in commit f3ff2e55bf on Dec 12, 2020
  25. PastaPastaPasta referenced this in commit e80c73ae16 on Dec 15, 2020
  26. PastaPastaPasta referenced this in commit 4d1c3e340b on Dec 15, 2020
  27. PastaPastaPasta referenced this in commit 6f37eab266 on Dec 15, 2020
  28. PastaPastaPasta referenced this in commit 335303ad26 on Dec 15, 2020
  29. PastaPastaPasta referenced this in commit a6e332134a on Dec 18, 2020
  30. PastaPastaPasta referenced this in commit 097ee4e5d5 on Dec 18, 2020
  31. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me