# README
rpctest
Package rpctest provides a bchd-specific RPC testing harness crafting and
executing integration tests by driving a bchd
instance via the RPC
interface. Each instance of an active harness comes equipped with a simple
in-memory HD wallet capable of properly syncing to the generated chain,
creating new addresses, and crafting fully signed transactions paying to an
arbitrary set of outputs.
This package was designed specifically to act as an RPC testing harness for
bchd
. However, the constructs presented are general enough to be adapted to
any project wishing to programmatically drive a bchd
instance of its
systems/integration tests.
Installation and Updating
$ go get -u github.com/aviator-coding/bchd/integration/rpctest
License
Package rpctest is licensed under the copyfree ISC License.
# Functions
ActiveHarnesses returns a slice of all currently active test harnesses.
ConnectNode establishes a new peer-to-peer connection between the "from" harness and the "to" harness.
CreateBlock creates a new block building from the previous block with a specified blockversion and timestamp.
JoinNodes is a synchronization tool used to block until all passed nodes are fully synced with respect to an attribute.
New creates and initializes new instance of the rpc test harness.
TearDownAll tears down all active test harnesses.
# Constants
Blocks is a JoinType which waits until all nodes share the same block height.
BlockVersion is the default block version used when generating blocks.
Mempools is a JoinType which blocks until all nodes have identical mempool.
# Structs
Harness fully encapsulates an active bchd process to provide a unified platform for creating rpc driven integration tests involving bchd.
# Type aliases
HarnessTestCase represents a test-case which utilizes an instance of the Harness to exercise functionality.
JoinType is an enum representing a particular type of "node join".