use TendermintResult for rpctypes.Result

This commit is contained in:
Ethan Buchman
2016-01-12 18:04:06 -05:00
parent 0be13d1d27
commit fb59255095
6 changed files with 124 additions and 18 deletions

View File

@ -16,12 +16,14 @@ import (
"github.com/tendermint/go-p2p"
"github.com/tendermint/go-rpc"
"github.com/tendermint/go-rpc/server"
"github.com/tendermint/go-rpc/types"
"github.com/tendermint/go-wire"
bc "github.com/tendermint/tendermint/blockchain"
"github.com/tendermint/tendermint/consensus"
mempl "github.com/tendermint/tendermint/mempool"
"github.com/tendermint/tendermint/proxy"
"github.com/tendermint/tendermint/rpc/core"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
sm "github.com/tendermint/tendermint/state"
"github.com/tendermint/tendermint/types"
"github.com/tendermint/tmsp/example/golang"
@ -181,6 +183,14 @@ func (n *Node) StartRPC() (net.Listener, error) {
listenAddr := config.GetString("rpc_laddr")
// register the result objects with wire
// so consumers of tendermint rpc will not have
// conflicts with their own rpc
wire.RegisterInterface(
struct{ rpctypes.Result }{},
wire.ConcreteType{&ctypes.TendermintResult{}, 0x1},
)
mux := http.NewServeMux()
wm := rpcserver.NewWebsocketManager(core.Routes, n.evsw)
mux.HandleFunc("/websocket", wm.WebsocketHandler)