Skip to content

fix(wallet): fix SingleRandomDraw to error if insufficient funds#1605

Merged
notmandatory merged 1 commit intobitcoindevkit:masterfrom
notmandatory:fix/coinselection_tests
Sep 12, 2024
Merged

fix(wallet): fix SingleRandomDraw to error if insufficient funds#1605
notmandatory merged 1 commit intobitcoindevkit:masterfrom
notmandatory:fix/coinselection_tests

Conversation

@notmandatory
Copy link
Copy Markdown
Member

Description

Notes to the reviewers

Since the single random draw algo can be used on its own it needs to be able to return an insufficient funds error. I think the reason we didn't catch this before is that single random draw already check for sufficient required + optional utxo amounts and returns the insufficient funds error.

Changelog notice

  • fix SingleRandomDraw coin selection to error if there are insufficient funds for a requested payment amount.

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

…unds

* fixed spelling and clippy errors
* updated tests to check for error variant instead of a panic
@notmandatory notmandatory self-assigned this Sep 12, 2024
@notmandatory notmandatory added the bug Something isn't working label Sep 12, 2024
@notmandatory notmandatory added this to the 1.0.0-beta milestone Sep 12, 2024
Copy link
Copy Markdown
Collaborator

@ValuedMammal ValuedMammal left a comment

Choose a reason for hiding this comment

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

ACK 22a2f83

@notmandatory notmandatory merged commit 45f7508 into bitcoindevkit:master Sep 12, 2024
This was referenced Sep 13, 2024
@notmandatory notmandatory deleted the fix/coinselection_tests branch May 26, 2025 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants