From: 志宇 Date: Wed, 31 Jan 2024 08:00:04 +0000 (+0800) Subject: Merge bitcoindevkit/bdk#1279: Filter duplicate coins before coin selection X-Git-Tag: v1.0.0-alpha.5~3 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/struct.CommandStringError.html?a=commitdiff_plain;h=070fffb95cddb9153f326d5662f206d25ecbcc7c;p=bdk Merge bitcoindevkit/bdk#1279: Filter duplicate coins before coin selection 5299db34cb9117ad1b66a6afcb51f6ca7e1f0d95 fix(wallet): filter duplicates before coin selection (志宇) d9501187ef3c4436b7baedb23a4d4f6b1f46a03d test(wallet): fix tests helpers to generate unique utxos (志宇) Pull request description: Fixes #1240 ### Description We now filter out duplicate coins before calling `CoinSelectionAlgorithm::coin_select`. If a UTXO exists in both `required_utxos` and `optional_utxos`, only the copy in `required_utxos` will be kept. Test helper methods are also updated to not create duplicate UTXOs. ### Changelog notice Fixed * Filter out duplicate UTXOs before calling `CoinSelectionAlgorithm::coin_select`. If a UTXO exists in both `required_utxos` and `optional_utxos`, only the copy in `required_utxos` will be kept. ### 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 * [x] I'm linking the issue being fixed by this PR ACKs for top commit: danielabrozzoni: utACK 5299db34cb9117ad1b66a6afcb51f6ca7e1f0d95 Tree-SHA512: 9cb5517b7f74f89c06172efc344766b16b3216a25b1ebdd6eb84767a9e103124cead9eb0a7f3b5feb562fbb925517a9bf0404399de74b4e898982a5b3795aa04 --- 070fffb95cddb9153f326d5662f206d25ecbcc7c