From c2902c1146cc817f17638d960418f74b2c29919e Mon Sep 17 00:00:00 2001 From: Chris Stewart Date: Tue, 25 Jul 2023 16:20:39 -0500 Subject: [PATCH] Fix `onBlockReceived` unit test (#5166) * Fix onBlockReceived unit test * scalafmt --- .../node/networking/peer/DataMessageHandlerTest.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node-test/src/test/scala/org/bitcoins/node/networking/peer/DataMessageHandlerTest.scala b/node-test/src/test/scala/org/bitcoins/node/networking/peer/DataMessageHandlerTest.scala index e1ffdb95e8..cc77ef4bef 100644 --- a/node-test/src/test/scala/org/bitcoins/node/networking/peer/DataMessageHandlerTest.scala +++ b/node-test/src/test/scala/org/bitcoins/node/networking/peer/DataMessageHandlerTest.scala @@ -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)