mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-28 04:01:40 +00:00
Improve go-data json support in rpc
This commit is contained in:
committed by
Ethan Buchman
parent
6a0217688f
commit
90abc61c56
@ -10,6 +10,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/tendermint/abci/example/dummy"
|
||||
abci "github.com/tendermint/abci/types"
|
||||
data "github.com/tendermint/go-data"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
|
||||
@ -35,8 +36,8 @@ func TestABCIMock(t *testing.T) {
|
||||
BroadcastCommit: mock.Call{
|
||||
Args: goodTx,
|
||||
Response: &ctypes.ResultBroadcastTxCommit{
|
||||
CheckTx: &abci.ResponseCheckTx{Data: []byte("stand")},
|
||||
DeliverTx: &abci.ResponseDeliverTx{Data: []byte("deliver")},
|
||||
CheckTx: &abci.ResponseCheckTx{Data: data.Bytes("stand")},
|
||||
DeliverTx: &abci.ResponseDeliverTx{Data: data.Bytes("deliver")},
|
||||
},
|
||||
Error: errors.New("bad tx"),
|
||||
},
|
||||
@ -91,7 +92,7 @@ func TestABCIRecorder(t *testing.T) {
|
||||
require.Equal(0, len(r.Calls))
|
||||
|
||||
r.ABCIInfo()
|
||||
r.ABCIQuery("path", []byte("data"), true)
|
||||
r.ABCIQuery("path", data.Bytes("data"), true)
|
||||
require.Equal(2, len(r.Calls))
|
||||
|
||||
info := r.Calls[0]
|
||||
@ -163,7 +164,7 @@ func TestABCIApp(t *testing.T) {
|
||||
assert.True(res.DeliverTx.Code.IsOK())
|
||||
|
||||
// check the key
|
||||
qres, err := m.ABCIQuery("/key", []byte(key), false)
|
||||
qres, err := m.ABCIQuery("/key", data.Bytes(key), false)
|
||||
require.Nil(err)
|
||||
assert.EqualValues(value, qres.Response.Value)
|
||||
}
|
||||
|
Reference in New Issue
Block a user