RPC: improve SFFO arg parsing, error catching and coverage #30844

pull furszy wants to merge 2 commits into bitcoin:master from furszy:2024_rpc_wallet_sffo_duplicates changing 2 files +38 −28
  1. furszy commented at 4:37 pm on September 7, 2024: member

    Following changes were made:

    1. Catch and signal error for duplicate string destinations.
    2. Catch and signal error for invalid value type.
    3. Catch and signal error for string destination not found in tx outputs.
    4. Improved InterpretSubtractFeeFromOutputInstructions() code organization.
    5. Added test coverage for all possible error failures.

    Also, fixed two PEP 8 warnings at the ‘wallet_sendmany.py’ file:

    • PEP 8: E302 expected 2 blank lines, found 1 at the SendmanyTest class declaration.
    • PEP 8: E303 too many blank lines (2) at skip_test_if_missing_module() and set_test_params()
  2. rpc: decouple sendtoaddress 'subtractfeefromamount' boolean parsing
    The 'subtractfeefromamount' arg is only boolean for sendtoaddress().
    Other commands should never provide it as a boolean.
    4f4cd35319
  3. RPC: improve SFFO arg parsing, error catching and coverage
    Following changes were made:
    
    1) Catch and signal error for duplicate string destinations.
    2) Catch and signal error for invalid value type.
    3) Catch and signal error for string destination not found in tx outputs.
    4) Improved 'InterpretSubtractFeeFromOutputInstructions()' code organization.
    5) Added test coverage for all possible error failures.
    
    Also, fixed two PEP 8 warnings at the 'wallet_sendmany.py' file:
    - PEP 8: E302 expected 2 blank lines, found 1 at the SendmanyTest class declaration.
    - PEP 8: E303 too many blank lines (2) at skip_test_if_missing_module() and set_test_params()
    cddcbaf81e
  4. DrahtBot commented at 4:37 pm on September 7, 2024: contributor

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

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK murchandamus, naiyoma

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #31250 (wallet: Disable creating and loading legacy wallets by achow101)
    • #28710 (Remove the legacy wallet and BDB dependency by achow101)

    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.

  5. DrahtBot added the label RPC/REST/ZMQ on Sep 7, 2024
  6. DrahtBot added the label CI failed on Sep 7, 2024
  7. furszy commented at 2:24 pm on September 8, 2024: member
  8. murchandamus commented at 4:22 pm on September 12, 2024: contributor

    Awesome, thanks for picking this up.

    crACK cddcbaf81e8e3d107cd321ee2c9a7fd786a8917e

  9. DrahtBot removed the label CI failed on Sep 15, 2024
  10. naiyoma commented at 7:39 pm on September 27, 2024: contributor
    TACK https://github.com/bitcoin/bitcoin/pull/30844/commits/cddcbaf81e8e3d107cd321ee2c9a7fd786a8917e Nice clean-up, as well as adding more assertions to cover additional edge cases.
  11. DrahtBot added the label CI failed on Oct 13, 2024
  12. DrahtBot removed the label CI failed on Oct 18, 2024
  13. DrahtBot added the label CI failed on Oct 22, 2024
  14. DrahtBot removed the label CI failed on Oct 25, 2024

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-12-23 09:12 UTC

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