]> Untitled Git - bdk-cli/commit
fix(tests): wait for electrs to reach bitcoind's tip in online tests
authorVihiga Tyonum <withtvpeter@gmail.com>
Wed, 28 Oct 2026 14:59:46 +0000 (15:59 +0100)
committerVihiga Tyonum <withtvpeter@gmail.com>
Wed, 28 Oct 2026 14:59:46 +0000 (15:59 +0100)
commitd2317d2a6f549d22e312d73a120a643eaf69a2af
tree778c4e19b5516a0d1f7a6ce12c76aed505cc3a34
parentc5d3230ad76a0a3e03e45e2c296d0c563812d8a1
fix(tests): wait for electrs to reach bitcoind's tip in online tests

bdk_testenv 0.13.1's `wait_until_electrum_sees_block` returns on the
first queued header notification, which can be a stale one left over
from an earlier `mine_blocks` call. A following `full_scan` could then
run before electrs had indexed the confirmation blocks, intermittently
failing tests such as `test_create_tx_multiple_recipients` with a
confirmed balance of 0.

Add a `wait_for_electrum_tip` helper to `tests/common` that reads
bitcoind's current block height and drains header notifications until
electrs reports that height, and use it in place of all calls to
`wait_until_electrum_sees_block` in the electrum and esplora online
tests.

The same bug is fixed upstream in bdk (a98cf7c4) but not yet released;
the helper can be dropped once a new bdk_testenv is published.
tests/common/mod.rs
tests/integration/online.rs