Browse Source

fixes from rebase

pull/484/head
Ethan Buchman 8 years ago
parent
commit
75989342b0
3 changed files with 5 additions and 10 deletions
  1. +0
    -6
      rpc/core/routes.go
  2. +1
    -1
      rpc/lib/server/handlers.go
  3. +4
    -3
      rpc/test/client_test.go

+ 0
- 6
rpc/core/routes.go View File

@ -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


+ 1
- 1
rpc/lib/server/handlers.go View File

@ -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 {


+ 4
- 3
rpc/test/client_test.go View File

@ -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)
core.SetTxIndexer(node.ConsensusState().GetState().TxIndexer)
defer core.SetTxIndexer(node.ConsensusState().GetState().TxIndexer)
testTx(t, GetURIClient(), false)
} }
func TestJSONTx(t *testing.T) { func TestJSONTx(t *testing.T) {


Loading…
Cancel
Save