Refactor TestEnv::wait_until_electrum_sees_block
to be more concrete.
#1640
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Before, the signature of
TestEnv::wait_until_electrum_sees_block
only took in adelay: Duration
input. It was not clear which block we were waiting for exactly. This PR adds 2 inputs to this method: ablock_height
target, and an optionalblock_hash
method. Just having theblock_height
method waits until Electrs sees a block at that height, and all spk histories are up to date to that block. If the caller also includes ablock_hash
, we wait until Electrs sees a block at the given height, also has that block hash.We also introduce a new method:
TestEnv::wait_until_electrum_tip_syncs_with_bitcoind
. The method name is self-explanatory.Notes to the reviewers
It's a breaking change for
bdk_testenv
. The API now makes more sense.Changelog notice
TestEnv::wait_until_electrum_sees_block
to have a height target, and an optional block hash target.TestEnv::wait_until_electrum_tip_syncs_with_bitcoind
.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features: