support key-value params in JSONRPC (Refs #1)

More changes:

- remove Client interface (reason: empty)
- introduce HTTPClient interface, which can be used for both ClientURI
  and ClientJSONRPC clients (so our users don't have to create their own) (Refs #8)
- rename integration tests script to `integration_test.sh`
- do not update deps on `get_deps`
This commit is contained in:
Anton Kaliaev
2017-03-07 18:34:54 +04:00
parent b03facd828
commit e1d5873bdf
10 changed files with 150 additions and 115 deletions

View File

@ -5,10 +5,10 @@ import (
"testing"
"time"
"github.com/tendermint/go-rpc/client"
"github.com/tendermint/go-rpc/server"
"github.com/tendermint/go-rpc/types"
"github.com/tendermint/go-wire"
rpcclient "github.com/tendermint/go-rpc/client"
rpcserver "github.com/tendermint/go-rpc/server"
rpctypes "github.com/tendermint/go-rpc/types"
wire "github.com/tendermint/go-wire"
)
// Client and Server should work over tcp or unix sockets
@ -88,7 +88,9 @@ func testURI(t *testing.T, cl *rpcclient.ClientURI) {
func testJSONRPC(t *testing.T, cl *rpcclient.ClientJSONRPC) {
val := "acbd"
params := []interface{}{val}
params := map[string]interface{}{
"arg": val,
}
var result Result
_, err := cl.Call("status", params, &result)
if err != nil {
@ -102,7 +104,9 @@ func testJSONRPC(t *testing.T, cl *rpcclient.ClientJSONRPC) {
func testWS(t *testing.T, cl *rpcclient.WSClient) {
val := "acbd"
params := []interface{}{val}
params := map[string]interface{}{
"arg": val,
}
err := cl.WriteJSON(rpctypes.RPCRequest{
JSONRPC: "2.0",
ID: "",