* Start refactoring BroadcastTransactionTest to use new SpvNodeFundedWalletBitcoind fixture * Double timeout to 10.seconds on spv node disconnect * Attempt to bump disconnect even more * Add more logging around starting and stoping spv node to try and debug failures with fixtures on test suites * move starting of spv node into one place in the fixtures -- createSpvNode() --, also look at ordering of destruction to make sure that the spv node is stopped/destroyed BEFORE bitcoind is stopped/destroyed. If the inverse order happens, our spv node won't receive a response from bitcoind and will hang waiting for the Tcp connection to close gracefully * Try switching from to to get CI to pass * Add more logging and throws to try and debug failures on ci * Add logging in the case we send a close command and peer isn't defined * Match on Tcp.Connect on default receive in P2PClient * Make SpvNode.disconnect() check to see if we are connected before attempting to disconnect * Add more logging in fixtures, change behavior of SpvNode.disconnect() to not throw if we are already disconnected * Switch to preferred way of terminating actor system in tests * Make PeerMessageSender.sendMsg() return a , make sure a message is not sent to P2PClient until we are fully intialized * Switch p2p logging to DEBUG * Complete disconnect promise on peer message recv in the case where we didn't have a peer to begin with * Make SpvNodeTest more robust, fix bug for when we send 'sendheaders' message. We shouldn't do this until our peer has sent us a verack * Only send 'sendheaders' message to our peer after we receive a 'sendheaders' message from our peer. Hopefully this solves async issues where we were sending 'sendheaders' before our handshake was fully completed with our peer which means we wouldn't get headers sent to us * Cleanup pt1 |
||
---|---|---|
.. | ||
src | ||
README.md |
Philosphy of testkit
The high level of of the bitcoin-s testkit is to mimic provide functionality to test 3rd party applications.
There are other examples of these in the Scala ecosystem like the akka-testkit
and slick-testkit
.
We use this testkit to test bitcoin-s it self. For instance, our BitcoindRpcClient is tested with the functionality provided in the testkit. A quick example of a useful utility method is BitcoindRpcTestUtil.startedBitcoindRpcClient(). This spins up a bitcoind regtest instance on machine and generates 101 blocks on that node. This gives you the abililty to start spending money immediately with that bitcoind node.
We have similar utility methods for eclair.
Property based testing
There is also a robust set of generators available in the org.bitcoins.testkit.gen package. This allows you to integrate property based testing into your library and feel confident about implementing your application specific logic correctly.
You can see examples of us using these generators inside of testkit in our Private Key test cases