Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

furszy
Copy link
Member

@furszy furszy commented Sep 7, 2024

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()

The 'subtractfeefromamount' arg is only boolean for sendtoaddress().
Other commands should never provide it as a boolean.
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()
@DrahtBot
Copy link
Contributor

DrahtBot commented Sep 7, 2024

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.

@furszy
Copy link
Member Author

furszy commented Sep 8, 2024

@murchandamus

Copy link
Contributor

@murchandamus murchandamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for picking this up.

crACK cddcbaf

Copy link
Contributor

@naiyoma naiyoma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TACK cddcbaf
Nice clean-up, as well as adding more assertions to cover additional edge cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants