Commit 44abb68
committed
Merge #390: fix(coin_selection):
8a5e763 test(tx_builder): Add `test_add_utxo_final_outpoint_retained` (valued mammal)
0b5d927 test(wallet): Add `test_tx_ordering_untouched_preserves_insertion_ordering_bnb_success` (valued mammal)
e020391 fix(coin_selection): `calculate_cs_result` returns the required UTXOs first (valued mammal)
Pull request description:
### Description
Follow-up to #262 that addresses transaction input ordering when BnB finds a solution.
Previously `calculate_cs_result` produced a CoinSelectionResult by appending the required UTXOs onto the selected ones, which changed the expected order of transaction inputs.
`calculate_cs_result` now returns the required UTXOs before the newly selected ones. This behavior aligns with the expectation that the order of manually selected inputs should be preserved in the final transaction whenever `TxOrdering::Untouched` is specified.
For related discussion refer to #244 (comment).
### Changelog notice
Fixed
- wallet: Fixed order of selected UTXOs for `BranchAndBoundCoinSelection`, required UTXOs come first
### Checklists
#### All Submissions:
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
#### Bugfixes:
* [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:
110CodingP:
ACK [`8a5e763`](8a5e763).
Tree-SHA512: 4ebf33f7d1fe6e6dcfff89e218aeefcec92ae8ae78c2589d7f496b433991122f48100be38ffa52b8fc2d67feb679d567a707dea8681810167eac1a6a04f9dcc0calculate_cs_result returns the required UTXOs first3 files changed
Lines changed: 107 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
707 | | - | |
708 | | - | |
| 707 | + | |
| 708 | + | |
709 | 709 | | |
710 | 710 | | |
711 | | - | |
712 | | - | |
713 | | - | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
714 | 715 | | |
715 | | - | |
716 | | - | |
| 716 | + | |
| 717 | + | |
717 | 718 | | |
718 | 719 | | |
719 | 720 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
| 934 | + | |
934 | 935 | | |
935 | 936 | | |
936 | 937 | | |
| |||
1156 | 1157 | | |
1157 | 1158 | | |
1158 | 1159 | | |
1159 | | - | |
1160 | 1160 | | |
1161 | 1161 | | |
1162 | 1162 | | |
| |||
1246 | 1246 | | |
1247 | 1247 | | |
1248 | 1248 | | |
1249 | | - | |
1250 | 1249 | | |
1251 | 1250 | | |
1252 | 1251 | | |
| |||
1292 | 1291 | | |
1293 | 1292 | | |
1294 | 1293 | | |
1295 | | - | |
1296 | | - | |
1297 | 1294 | | |
1298 | 1295 | | |
1299 | 1296 | | |
| |||
1306 | 1303 | | |
1307 | 1304 | | |
1308 | 1305 | | |
1309 | | - | |
1310 | 1306 | | |
1311 | 1307 | | |
1312 | 1308 | | |
| |||
1321 | 1317 | | |
1322 | 1318 | | |
1323 | 1319 | | |
| 1320 | + | |
1324 | 1321 | | |
1325 | | - | |
1326 | | - | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
1327 | 1365 | | |
| 1366 | + | |
| 1367 | + | |
1328 | 1368 | | |
1329 | 1369 | | |
1330 | 1370 | | |
| |||
1380 | 1420 | | |
1381 | 1421 | | |
1382 | 1422 | | |
1383 | | - | |
1384 | 1423 | | |
1385 | 1424 | | |
1386 | 1425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2961 | 2961 | | |
2962 | 2962 | | |
2963 | 2963 | | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
0 commit comments