Combine local and http into client package, unify tests with table-driven tests

This commit is contained in:
Ethan Frey
2017-02-23 14:16:59 +01:00
parent 202146e4ce
commit 931af6a072
9 changed files with 314 additions and 538 deletions

View File

@ -1,21 +1,21 @@
/*
package client provides a general purpose interface for connecting
package client provides a general purpose interface (Client) for connecting
to a tendermint node, as well as higher-level functionality.
The main implementation for production code is http, which connects
via http to the jsonrpc interface of the tendermint node.
The main implementation for production code is client.HTTP, which
connects via http to the jsonrpc interface of the tendermint node.
For connecting to a node running in the same process (eg. when
compiling the abci app in the same process), you can use the local
compiling the abci app in the same process), you can use the client.Local
implementation.
For mocking out server responses during testing to see behavior for
arbitrary return values, use the mock package.
In addition to the Client interface, which should be used externally
for maximum flexibility and testability, this package also provides
a wrapper that accepts any Client implementation and adds some
higher-level functionality.
for maximum flexibility and testability, and two implementations,
this package also provides helper functions that work on any Client
implementation.
*/
package client