Skip to content

Commit

Permalink
Merge bitcoindevkit#1605: fix(wallet): fix SingleRandomDraw to error …
Browse files Browse the repository at this point in the history
…if insufficient funds

22a2f83 fix(wallet): fix SingleRandomDraw to throw an error if insufficient funds (Steve Myers)

Pull request description:

  ### Description

  * fix SingleRandomDraw to error if insufficient funds
  * fixed spelling and clippy errors (see: bitcoindevkit#1581 (comment))
  * updated tests to check for error variant instead of a panic

  ### 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:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

  #### Bugfixes:

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

ACKs for top commit:
  ValuedMammal:
    ACK 22a2f83

Tree-SHA512: c434003ea6cec1423960a0c7d2f830324227f9f99d9d8f72bd7785368cf51c867036b80c300a97177a10998830ef4df924bdcad408730f9e5dddc92cda75dceb
  • Loading branch information
notmandatory committed Sep 12, 2024
2 parents 6d610bf + 22a2f83 commit 45f7508
Showing 1 changed file with 129 additions and 160 deletions.
Loading

0 comments on commit 45f7508

Please sign in to comment.