|
Repo Added
|
Files
28
|
Badge
README BADGES
|
push
github
Merge bitcoindevkit/bdk#2027: feat(chain): add new `list_ordered_canonical_txs` method 12c107637 feat(chain): introduce new `list_ordered_canonical_txs` (Leonardo Lima) f34117b78 test(chain): add `test_list_ordered_canonical_txs` (Leonardo Lima) a201be0b9 chore(test): rename `txid_to_name` to proper `tx_name_to_txid` (Leonardo Lima) 6cf720e48 chore(docs): fix typo in docs (Leonardo Lima) Pull request description: ### Description It introduces a new method for topological ordering canonical transactions, `list_ordered_canonical_txs`. It now ensures the dependency-based transaction processing, guaranteeing that parent transactions always appears before their children transaction. The existing `list_canonical_txs` and `try_list_canonical_txs` methods have been deprecated in favor of the new ordered version. ### Notes to the reviewers "[...] For those reviewing, and wondering why we don't have a fallible try version of this method, it's because we don't have a fallible ChainOracle implementation - we will get rid of ChainOracle trait soon anyway." This PR is intended for a point release so that bdk_wallet 2.x users can get a topologically sorted list of transactions (we need a point release on bdk_wallet 2.x as well). It might be useful to take a look at the new test scenarios that I've added, it shows some specific scenarios where the current implementation and output of `canonical_txs` didn't output the transactions in topological order. Let me know if you think the TopologicalIter algorithm and/or API could be improved. ### Changelog notice ``` #### Added - New `list_ordered_canonical_txs` method to `TxGraph` that returns canonical transactions in topological order, ensuring parent transactions always appear before their children #### Deprecated - `list_canonical_txs` method - use `list_orde... (continued)
389 of 526 branches covered (73.95%)
Branch coverage included in aggregate %.
95 of 97 new or added lines in 2 files covered. (97.94%)
4326 of 5388 relevant lines covered (80.29%)
2283.44 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|