Fix onBlockReceived unit test (#5166)

* Fix onBlockReceived unit test

* scalafmt
This commit is contained in:
Chris Stewart 2023-07-25 16:20:39 -05:00 committed by GitHub
parent ef2c96cc99
commit c2902c1146
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,10 +88,10 @@ class DataMessageHandlerTest extends NodeTestWithCachedBitcoindNewest {
}
}
val nodeCallbacks = NodeCallbacks.onBlockReceived(callback)
node.nodeAppConfig.addCallbacks(nodeCallbacks)
for {
_ <- NodeTestUtil.awaitAllSync(node, bitcoind)
nodeCallbacks = NodeCallbacks.onBlockReceived(callback)
_ = node.nodeAppConfig.addCallbacks(nodeCallbacks)
hash <- bitcoind.generateToAddress(blocks = 1, junkAddress).map(_.head)
result = Await.result(resultP.future, 30.seconds)
} yield assert(result.blockHeader.hashBE == hash)