]> Untitled Git - bdk/commit
Merge bitcoindevkit/bdk#662: Consolidate `fee_amount` and `amount_needed`
authorAlekos Filini <alekos.filini@gmail.com>
Wed, 3 Aug 2022 10:32:30 +0000 (12:32 +0200)
committerAlekos Filini <alekos.filini@gmail.com>
Wed, 3 Aug 2022 10:32:44 +0000 (12:32 +0200)
commit9c0a7696759cecdf86165c38be914018d7bd016c
tree779ab65819616bf3b0bfd19813527f0a3a6bb1b6
parent11865fddff1f690e54ca7e54551ceed64277bbbe
parente8df3d2d91927edb9a339c664f0603c47622e4b0
Merge bitcoindevkit/bdk#662: Consolidate `fee_amount` and `amount_needed`

e8df3d2d91927edb9a339c664f0603c47622e4b0 Consolidate `fee_amount` and `amount_needed` (Cesar Alvarez Vallero)

Pull request description:

  ### Description

  Before this commit `fee_amount` and `amount_needed` were passed as independent
  parameters. From the perspective of coin selection algorithms, they are always
  used jointly for the same purpose, to create a coin selection with a total
  effective value greater than it's summed values.

  This commit removes the abstraction that the use of the two parameter
  introduced by consolidating both into a single parameter, `target_amount`, who
  carries their values added up.

  Resolves: #641

  ### Notes to the reviewers

  I just updated old tests and didn't create new ones because almost all changes
  are renames and "logic changes" (like the addition of the selection fee) are
  tested in the modified tests.

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

  #### New Features:

  * [ ] I've added tests for the new feature
  * [x] I've added docs for the new feature
  * [x] I've updated `CHANGELOG.md`

  #### Bugfixes:

  * [x] This pull request breaks the existing API
  * [x] I'm linking the issue being fixed by this PR

ACKs for top commit:
  danielabrozzoni:
    re-ACK e8df3d2d91927edb9a339c664f0603c47622e4b0 - I tested with the fuzzer, run it for 13,000,000 iterations, couldn't find any crash :)

Tree-SHA512: 64b46473799352c06cc554659e4b159a33812b3d3793c9d436bd1e46b65edd085d71b219f6a0474f6836979ca608aa019a72bdc6915a2cc2d744a76e2a28b889