• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bitcoindevkit / bdk / 21207897136
79%

Build:
DEFAULT BRANCH: master
Ran 21 Jan 2026 11:32AM UTC
Jobs 1
Files 28
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Jan 2026 11:29AM UTC coverage: 78.926% (-0.2%) from 79.086%
21207897136

push

github

evanlinjin
Merge bitcoindevkit/bdk#2074: Fix `ChainPosition` ordering

1cc7d606a fix(chain): correct unconfirmed `ChainPosition` `last_seen` tiebreaker (志宇)
184db01a3 fix(chain): correct ChainPosition ordering for wallet transaction display (志宇)

Pull request description:

  ## Description

  This PR fixes incorrect ordering of `ChainPosition` that affected how wallet transactions are displayed. Previously, unconfirmed transactions that were never seen in the mempool would incorrectly appear before transactions with mempool timestamps due to the derived `Ord` implementation treating `None` as less than `Some(_)`.

  ### Problem

  The derived `Ord` implementation for `ChainPosition::Unconfirmed` caused incorrect transaction ordering:
  - `Unconfirmed { first_seen: None, last_seen: None }` (never in mempool)
  - Would appear **before** `Unconfirmed { first_seen: Some(10), last_seen: Some(10) }` (seen in mempool)

  This resulted in a confusing wallet display where transactions never broadcast would appear before pending mempool transactions.

  ### Solution

  Implemented manual `Ord` and `PartialOrd` traits for `ChainPosition` with the correct ordering:

  1. **Confirmed transactions** (earliest first by block height)
  2. **Unconfirmed transactions seen in mempool** (ordered by `first_seen`)
  3. **Unconfirmed transactions never seen** (these come last)

  Additional ordering rules:
  - At the same confirmation height, transitive confirmations come before direct confirmations (as they may actually be confirmed earlier)
  - Tie-breaking uses transaction IDs for deterministic ordering

  ## Changelog notice

  ### Fixed
  - Fixed `ChainPosition` ordering so unconfirmed transactions never seen in mempool appear last instead of first

  ### Changed
  - `ChainPosition`, `CanonicalTx`, and `FullTxOut` now require `A: Ord` for their `Ord` implementations
  - Simplified `FullTxOut` ordering to only use essen... (continued)

378 of 512 branches covered (73.83%)

Branch coverage included in aggregate %.

27 of 46 new or added lines in 2 files covered. (58.7%)

4236 of 5334 relevant lines covered (79.42%)

3233.46 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
8
87.45
-2.93% crates/chain/src/canonical_view.rs
11
62.73
4.39% crates/chain/src/chain_data.rs
Jobs
ID Job ID Ran Files Coverage
1 21207897136.1 21 Jan 2026 11:32AM UTC 28
78.93
GitHub Action Run
Source Files on build 21207897136
  • Tree
  • List 28
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 226b65c6 on github
  • Prev Build on master (#20966252878)
  • Next Build on master (#21224262458)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc