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 commented at 12:51 pm on January 9, 2021: member

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

    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.

  8. adamjonas commented at 5:56 pm on July 19, 2021: member
    @MarcoFalke mind addressing laanwj’s question?
  9. DrahtBot added the label Needs rebase on Sep 1, 2021
  10. DrahtBot commented at 5:50 pm on September 1, 2021: member

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

    Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a “draft”.

  11. DrahtBot commented at 12:29 pm on December 22, 2021: member
    • 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.
  12. test: Check that decoderawtransaction heuristic may fail 57c0363223
  13. MarcoFalke force-pushed on Dec 24, 2021
  14. MarcoFalke commented at 12:45 pm on December 24, 2021: member
    Fixed by #20595
  15. MarcoFalke closed this on Dec 24, 2021

  16. MarcoFalke deleted the branch on Dec 24, 2021
  17. DrahtBot 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: 2024-06-02 01:13 UTC

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