Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions rpc/jsonrpc/server/http_json_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
// HTTP + JSON handler

// jsonrpc calls grab the given method's function info and runs reflect.Call
func makeJSONRPCHandler(funcMap map[string]*RPCFunc, logger log.Logger) http.HandlerFunc {
func MakeJSONRPCHandler(funcMap map[string]*RPCFunc, logger log.Logger) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
b, err := ioutil.ReadAll(r.Body)
if err != nil {
Expand Down Expand Up @@ -67,13 +67,14 @@ func makeJSONRPCHandler(funcMap map[string]*RPCFunc, logger log.Logger) http.Han
)
continue
}
if len(r.URL.Path) > 1 {
responses = append(
responses,
types.RPCInvalidRequestError(request.ID, fmt.Errorf("path %s is invalid", r.URL.Path)),
)
continue
}
// TODO: need to rever this change
//if len(r.URL.Path) > 1 {
// responses = append(
// responses,
// types.RPCInvalidRequestError(request.ID, fmt.Errorf("path %s is invalid", r.URL.Path)),
// )
// continue
//}
rpcFunc, ok := funcMap[request.Method]
if !ok || rpcFunc.ws {
responses = append(responses, types.RPCMethodNotFoundError(request.ID))
Expand Down
2 changes: 1 addition & 1 deletion rpc/jsonrpc/server/rpc_func.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func RegisterRPCFuncs(mux *http.ServeMux, funcMap map[string]*RPCFunc, logger lo
}

// JSONRPC endpoints
mux.HandleFunc("/", handleInvalidJSONRPCPaths(makeJSONRPCHandler(funcMap, logger)))
mux.HandleFunc("/", handleInvalidJSONRPCPaths(MakeJSONRPCHandler(funcMap, logger)))
}

// Function introspection
Expand Down
5 changes: 2 additions & 3 deletions vm/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
tmstate "github.com/consideritdone/landslidecore/proto/tendermint/state"
"github.com/consideritdone/landslidecore/proxy"
"github.com/consideritdone/landslidecore/rpc/client"
coretypes "github.com/consideritdone/landslidecore/rpc/core/types"
"github.com/consideritdone/landslidecore/state"
"github.com/consideritdone/landslidecore/store"
"github.com/consideritdone/landslidecore/types"
Expand Down Expand Up @@ -371,8 +370,8 @@ func WaitForHeight(c Service, h int64, waiter client.Waiter) error {
}
delta := int64(1)
for delta > 0 {
r := new(coretypes.ResultStatus)
if err := c.Status(nil, nil, r); err != nil {
r, err := c.Status(nil)
if err != nil {
return err
}
delta = h - r.SyncInfo.LatestBlockHeight
Expand Down
Loading