mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-19 08:01:22 +00:00
add Call method to WSClient, which does proper encoding of params
This commit is contained in:
14
rpc_test.go
14
rpc_test.go
@ -137,12 +137,7 @@ func echoViaWS(cl *client.WSClient, val string) (string, error) {
|
||||
params := map[string]interface{}{
|
||||
"arg": val,
|
||||
}
|
||||
err := cl.WriteJSON(types.RPCRequest{
|
||||
JSONRPC: "2.0",
|
||||
ID: "",
|
||||
Method: "echo",
|
||||
Params: params,
|
||||
})
|
||||
err := cl.Call("echo", params)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@ -164,12 +159,7 @@ func echoBytesViaWS(cl *client.WSClient, bytes []byte) ([]byte, error) {
|
||||
params := map[string]interface{}{
|
||||
"arg": bytes,
|
||||
}
|
||||
err := cl.WriteJSON(types.RPCRequest{
|
||||
JSONRPC: "2.0",
|
||||
ID: "",
|
||||
Method: "echo_bytes",
|
||||
Params: params,
|
||||
})
|
||||
err := cl.Call("echo_bytes", params)
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user