test: Check that decoderawtransaction heuristic may fail #19831

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2008-testDecodeRawT changing 1 files +6 −2
  1. MarcoFalke commented at 1:54 PM on August 29, 2020: member

    Adds an example where the heuristic fails

  2. DrahtBot added the label Tests on Aug 29, 2020
  3. robot-dreams commented at 7:17 AM on September 1, 2020: contributor

    Concept ACK

    Would it make sense to be more explicit about what could go wrong (since it'll always be the case that the heuristic matches either iswitness=False or iswitness=True)?

    For example:

        # The heuristic produces an absurd result with a negative output value
        heuristic = self.nodes[0].decoderawtransaction(hexstring=TX_HEURISTIC) 
        assert heuristic['vout'][0]['value'] < 0
    
        # The heuristic produces the same absurd result as iswitness=False
        non_witness = self.nodes[0].decoderawtransaction(hexstring=TX_HEURISTIC, iswitness=False)
        assert_equal(heuristic['txid'], non_witness['txid'])
    
        # Specifying iswitness=True produces a reasonable result
        witness = self.nodes[0].decoderawtransaction(hexstring=TX_HEURISTIC, iswitness=True)
        assert witness['vout'][0]['value'] > 0
  4. MarcoFalke force-pushed on Oct 13, 2020
  5. MarcoFalke commented at 12:19 PM on October 13, 2020: member
    `assert heuristic['vout'][0]['value'] < 0`

    The amount doesn't have to be negative. I've modified the tx, so that the amount is positive.

  6. laanwj commented at 3:31 PM on November 23, 2020: member

    I'm a bit confused by this. Is this something that should be able to fail, or a bug that needs to be corrected in the heuristic?

  7. DrahtBot cross-referenced this on Jan 9, 2021 from issue tests: Run both descriptor and legacy tests within a single test invocation by achow101
  8. DrahtBot commented at 12:51 PM on January 9, 2021: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #22437 (test, refactor: add GetTransaction() coverage, improve rpc_rawtransaction by jonatack)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  9. DrahtBot cross-referenced this on Jul 13, 2021 from issue test, refactor: add GetTransaction() coverage, improve rpc_rawtransaction by jonatack
  10. adamjonas commented at 5:56 PM on July 19, 2021: member

    @MarcoFalke mind addressing laanwj's question?

  11. DrahtBot added the label Needs rebase on Sep 1, 2021
  12. DrahtBot commented at 5:50 PM on September 1, 2021: contributor

    <!--cf906140f33d8803c4a75a2196329ecb-->

    🐙 This pull request conflicts with the target branch and needs rebase.

    <sub>Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".</sub>

  13. DrahtBot commented at 12:29 PM on December 22, 2021: contributor

    <!--13523179cfe9479db18ec6c5d236f789-->There hasn't been much activity lately and the patch still needs rebase. What is the status here?

    • Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
    • Is it no longer relevant? ➡️ Please close.
    • Did the author lose interest or time to work on this? ➡️ Please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.
  14. test: Check that decoderawtransaction heuristic may fail 57c0363223
  15. MarcoFalke force-pushed on Dec 24, 2021
  16. MarcoFalke commented at 12:45 PM on December 24, 2021: member

    Fixed by #20595

  17. MarcoFalke closed this on Dec 24, 2021

  18. MarcoFalke deleted the branch on Dec 24, 2021
  19. bitcoin locked this on Dec 24, 2022

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-05-20 06:54 UTC