Browse Source

fixes for go-rpc unix socket updates

pull/192/head
Ethan Buchman 9 years ago
parent
commit
254baa19f3
2 changed files with 5 additions and 5 deletions
  1. +0
    -1
      rpc/core/routes.go
  2. +5
    -4
      rpc/test/helpers.go

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

@ -6,7 +6,6 @@ import (
ctypes "github.com/tendermint/tendermint/rpc/core/types" ctypes "github.com/tendermint/tendermint/rpc/core/types"
) )
// TODO: eliminate redundancy between here and reading code from core/
var Routes = map[string]*rpc.RPCFunc{ var Routes = map[string]*rpc.RPCFunc{
"subscribe": rpc.NewWSRPCFunc(SubscribeResult, "event"), "subscribe": rpc.NewWSRPCFunc(SubscribeResult, "event"),
"unsubscribe": rpc.NewWSRPCFunc(UnsubscribeResult, "event"), "unsubscribe": rpc.NewWSRPCFunc(UnsubscribeResult, "event"),


+ 5
- 4
rpc/test/helpers.go View File

@ -23,7 +23,7 @@ var (
chainID string chainID string
rpcAddr, requestAddr, websocketAddr string
rpcAddr, requestAddr, websocketAddr, websocketEndpoint string
clientURI *client.ClientURI clientURI *client.ClientURI
clientJSON *client.ClientJSONRPC clientJSON *client.ClientJSONRPC
@ -33,8 +33,9 @@ var (
func init() { func init() {
chainID = config.GetString("chain_id") chainID = config.GetString("chain_id")
rpcAddr = config.GetString("rpc_laddr") rpcAddr = config.GetString("rpc_laddr")
requestAddr = "http://" + rpcAddr
websocketAddr = "ws://" + rpcAddr + "/websocket"
requestAddr = rpcAddr
websocketAddr = rpcAddr
websocketEndpoint = "/websocket"
clientURI = client.NewClientURI(requestAddr) clientURI = client.NewClientURI(requestAddr)
clientJSON = client.NewClientJSONRPC(requestAddr) clientJSON = client.NewClientJSONRPC(requestAddr)
@ -71,7 +72,7 @@ func newNode(ready chan struct{}) {
// create a new connection // create a new connection
func newWSClient(t *testing.T) *client.WSClient { func newWSClient(t *testing.T) *client.WSClient {
wsc := client.NewWSClient(websocketAddr)
wsc := client.NewWSClient(websocketAddr, websocketEndpoint)
if _, err := wsc.Start(); err != nil { if _, err := wsc.Start(); err != nil {
t.Fatal(err) t.Fatal(err)
} }


Loading…
Cancel
Save