mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-26 23:32:15 +00:00
rpc: fix tests
This commit is contained in:
parent
9529f12c28
commit
2e76b23c9a
@ -96,10 +96,8 @@ func TestABCIRecorder(t *testing.T) {
|
|||||||
|
|
||||||
_, err := r.ABCIInfo()
|
_, err := r.ABCIInfo()
|
||||||
assert.Nil(err, "expected no err on info")
|
assert.Nil(err, "expected no err on info")
|
||||||
_, err = r.ABCIInfo()
|
|
||||||
assert.Nil(err, "expected no err on info")
|
|
||||||
|
|
||||||
_, err := r.ABCIQueryWithOptions("path", data.Bytes("data"), client.ABCIQueryOptions{Trusted: false})
|
_, err = r.ABCIQueryWithOptions("path", data.Bytes("data"), client.ABCIQueryOptions{Trusted: false})
|
||||||
assert.NotNil(err, "expected error on query")
|
assert.NotNil(err, "expected error on query")
|
||||||
require.Equal(2, len(r.Calls))
|
require.Equal(2, len(r.Calls))
|
||||||
|
|
||||||
|
@ -318,8 +318,7 @@ func TestWSNewWSRPCFunc(t *testing.T) {
|
|||||||
err = cl.Call(context.Background(), "echo_ws", params)
|
err = cl.Call(context.Background(), "echo_ws", params)
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
|
|
||||||
select {
|
msg := <-cl.ResponsesCh
|
||||||
case msg := <-cl.ResponsesCh:
|
|
||||||
if msg.Error != nil {
|
if msg.Error != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -328,12 +327,6 @@ func TestWSNewWSRPCFunc(t *testing.T) {
|
|||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
got := result.Value
|
got := result.Value
|
||||||
assert.Equal(t, got, val)
|
assert.Equal(t, got, val)
|
||||||
}
|
|
||||||
result := new(ResultEcho)
|
|
||||||
err = json.Unmarshal(*msg.Result, result)
|
|
||||||
require.Nil(t, err)
|
|
||||||
got := result.Value
|
|
||||||
assert.Equal(t, got, val)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestWSHandlesArrayParams(t *testing.T) {
|
func TestWSHandlesArrayParams(t *testing.T) {
|
||||||
@ -348,8 +341,7 @@ func TestWSHandlesArrayParams(t *testing.T) {
|
|||||||
err = cl.CallWithArrayParams(context.Background(), "echo_ws", params)
|
err = cl.CallWithArrayParams(context.Background(), "echo_ws", params)
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
|
|
||||||
select {
|
msg := <-cl.ResponsesCh
|
||||||
case msg := <-cl.ResponsesCh:
|
|
||||||
if msg.Error != nil {
|
if msg.Error != nil {
|
||||||
t.Fatalf("%+v", err)
|
t.Fatalf("%+v", err)
|
||||||
}
|
}
|
||||||
@ -358,12 +350,6 @@ func TestWSHandlesArrayParams(t *testing.T) {
|
|||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
got := result.Value
|
got := result.Value
|
||||||
assert.Equal(t, got, val)
|
assert.Equal(t, got, val)
|
||||||
}
|
|
||||||
result := new(ResultEcho)
|
|
||||||
err = json.Unmarshal(*msg.Result, result)
|
|
||||||
require.Nil(t, err)
|
|
||||||
got := result.Value
|
|
||||||
assert.Equal(t, got, val)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestWSClientPingPong checks that a client & server exchange pings
|
// TestWSClientPingPong checks that a client & server exchange pings
|
||||||
|
Loading…
x
Reference in New Issue
Block a user