mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 05:43:51 +01:00
Have BitcoindV21RpcClientTest wait for indexes to sync (#2855)
This commit is contained in:
parent
89e84fff67
commit
d726c498d0
@ -35,11 +35,14 @@ class BitcoindV21RpcClientTest extends BitcoindFixturesFundedCachedV21 {
|
||||
}
|
||||
|
||||
it should "get index info" in { client: BitcoindV21RpcClient =>
|
||||
def isHeight101(client: BitcoindRpcClient): Future[Boolean] = {
|
||||
client.getBlockCount.map(_ == 101)
|
||||
def indexSynced(client: BitcoindRpcClient): Future[Boolean] = {
|
||||
client.getIndexInfo.map { indexes =>
|
||||
indexes("txindex").best_block_height == 101 && indexes(
|
||||
"basic block filter index").best_block_height == 101
|
||||
}
|
||||
}
|
||||
for {
|
||||
_ <- AsyncUtil.retryUntilSatisfiedF(() => isHeight101(client))
|
||||
_ <- AsyncUtil.retryUntilSatisfiedF(() => indexSynced(client))
|
||||
indexes <- client.getIndexInfo
|
||||
} yield {
|
||||
val txIndexInfo = indexes("txindex")
|
||||
|
Loading…
Reference in New Issue
Block a user