bdk
bdk copied to clipboard
Remove generic `D: Database` from `CoinSelectionAlgorithm`
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 fmtandcargo clippybefore 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)
To do
- [ ]
LargestFirstCoinSelectionshould useRef<D>as a field (otherwise it will be inconvenient/confusing to use). I've converted this to draft again. - [ ] Write an example of using
LargestFirstCoinSelectionwithWallet.