]> Untitled Git - bdk/commit
refactor(testenv)!: make `wait_until_electrum_sees_block` concrete
authorClaude <noreply@anthropic.com>
Mon, 15 Jun 2026 21:36:50 +0000 (21:36 +0000)
committer志宇 <hello@evanlinjin.me>
Thu, 15 Oct 2026 06:30:18 +0000 (06:30 +0000)
commita98cf7c48664c37a717c3160883ece6ceaed1684
tree6af02553c2e4720761b290d11c8058af32f7d279
parentbc9e873995b830caa428adbb569085144a00218d
refactor(testenv)!: make `wait_until_electrum_sees_block` concrete

Previously `TestEnv::wait_until_electrum_sees_block` only took a `timeout`
and returned as soon as Electrum emitted any new-block notification, so it
was not clear which block was actually being waited for.

Add `block_height` and an optional `block_hash` so callers state exactly
which block Electrum must be aware of. When the notified tip has already
advanced past `block_height`, the header at that height is fetched
explicitly so the expected `block_hash` can still be verified.

Introduce `TestEnv::wait_until_electrum_tip_syncs_with_bitcoind`, a
convenience wrapper that waits until Electrum's tip matches bitcoind's
chain tip (both height and hash), and migrate all existing call sites to
it.

https://claude.ai/code/session_016gJvi98Q65QnanBFxe2UUn
crates/electrum/benches/test_sync.rs
crates/electrum/src/bdk_electrum_client.rs
crates/electrum/tests/test_electrum.rs
crates/testenv/src/lib.rs