bdk icon indicating copy to clipboard operation
bdk copied to clipboard

Remove generic `D: Database` from `CoinSelectionAlgorithm`

Open evanlinjin opened this issue 3 years ago • 1 comments

Fixes #281

Description

Since CoinSelectionAlgorithm is a trait, if the database is really needed, one can create a struct that contains a database field which implements the CoinSelectionAlgorithm trait.

Most CoinSelectionAlgorithm implementations do not require a database.

Changelog notice

The CoinSelectionAlgorithm trait no longer depends on a database.

Checklists

All Submissions:

  • [x] I've signed all my commits
  • [x] I followed the contribution guidelines
  • [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] This pull request breaks the existing API (it removes a single input from a trait's method)

evanlinjin avatar Sep 29 '22 09:09 evanlinjin

To do

  • [ ] LargestFirstCoinSelection should use Ref<D> as a field (otherwise it will be inconvenient/confusing to use). I've converted this to draft again.
  • [ ] Write an example of using LargestFirstCoinSelection with Wallet.

evanlinjin avatar Sep 30 '22 06:09 evanlinjin