bitcoin-s/testkit
Torkel Rogstad 6de0ba268e Bump P2P + crypto test coverage (#506)
* Rename P2P tests and move generators into correct package

* Add more tests for P2P messages

* Add note on coverage to contributing guide

* Replace network in P2P header with typed network

* Add more P2P tests

* Add more tests for ECPriv and ECPub
2019-06-11 10:01:46 -05:00
..
src Bump P2P + crypto test coverage (#506) 2019-06-11 10:01:46 -05:00
README.md update readmes (#467) 2019-05-30 09:02:03 -05:00

Download

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