mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-21 17:01:35 +00:00
fixes from rebase
This commit is contained in:
@ -2,12 +2,6 @@ package core
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
rpc "github.com/tendermint/tendermint/rpc/lib/server"
|
rpc "github.com/tendermint/tendermint/rpc/lib/server"
|
||||||
|
|
||||||
data "github.com/tendermint/go-wire/data"
|
|
||||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
|
||||||
rpc "github.com/tendermint/tendermint/rpc/lib/server"
|
|
||||||
"github.com/tendermint/tendermint/rpc/lib/types"
|
|
||||||
"github.com/tendermint/tendermint/types"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO: better system than "unsafe" prefix
|
// TODO: better system than "unsafe" prefix
|
||||||
|
@ -145,7 +145,7 @@ func mapParamsToArgs(rpcFunc *RPCFunc, params map[string]*json.RawMessage, argsO
|
|||||||
for i, argName := range rpcFunc.argNames {
|
for i, argName := range rpcFunc.argNames {
|
||||||
argType := rpcFunc.args[i+argsOffset]
|
argType := rpcFunc.args[i+argsOffset]
|
||||||
|
|
||||||
if p, ok := params[argName]; ok && len(*p) > 0 {
|
if p, ok := params[argName]; ok && p != nil && len(*p) > 0 {
|
||||||
val := reflect.New(argType)
|
val := reflect.New(argType)
|
||||||
err := json.Unmarshal(*p, val.Interface())
|
err := json.Unmarshal(*p, val.Interface())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -43,7 +43,7 @@ func testStatus(t *testing.T, client rpc.HTTPClient) {
|
|||||||
result := new(ctypes.ResultStatus)
|
result := new(ctypes.ResultStatus)
|
||||||
_, err := client.Call("status", map[string]interface{}{}, result)
|
_, err := client.Call("status", map[string]interface{}{}, result)
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
assert.Equal(t, moniker, status.NodeInfo.Moniker)
|
assert.Equal(t, moniker, result.NodeInfo.Moniker)
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
@ -158,8 +158,9 @@ func TestURITx(t *testing.T) {
|
|||||||
testTx(t, GetURIClient(), true)
|
testTx(t, GetURIClient(), true)
|
||||||
|
|
||||||
core.SetTxIndexer(&null.TxIndex{})
|
core.SetTxIndexer(&null.TxIndex{})
|
||||||
testTx(t, GetJSONClient(), false)
|
defer core.SetTxIndexer(node.ConsensusState().GetState().TxIndexer)
|
||||||
core.SetTxIndexer(node.ConsensusState().GetState().TxIndexer)
|
|
||||||
|
testTx(t, GetURIClient(), false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestJSONTx(t *testing.T) {
|
func TestJSONTx(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user