fix tests

This commit is contained in:
Ethan Buchman
2017-05-26 12:17:32 -04:00
parent 42626d9e16
commit bd7ec18c19
7 changed files with 21 additions and 12 deletions
+6 -6
View File
@@ -59,31 +59,31 @@ func GetConfig() *cfg.Config {
// and we use random ports to run in parallel
tm, rpc, grpc := makeAddrs()
config.P2P.ListenAddress = tm
config.RPCListenAddress = rpc
config.GRPCListenAddress = grpc
config.RPC.ListenAddress = rpc
config.RPC.GRPCListenAddress = grpc
}
return config
}
// GetURIClient gets a uri client pointing to the test tendermint rpc
func GetURIClient() *client.URIClient {
rpcAddr := GetConfig().RPCListenAddress
rpcAddr := GetConfig().RPC.ListenAddress
return client.NewURIClient(rpcAddr)
}
// GetJSONClient gets a http/json client pointing to the test tendermint rpc
func GetJSONClient() *client.JSONRPCClient {
rpcAddr := GetConfig().RPCListenAddress
rpcAddr := GetConfig().RPC.ListenAddress
return client.NewJSONRPCClient(rpcAddr)
}
func GetGRPCClient() core_grpc.BroadcastAPIClient {
grpcAddr := config.GRPCListenAddress
grpcAddr := config.RPC.GRPCListenAddress
return core_grpc.StartGRPCClient(grpcAddr)
}
func GetWSClient() *client.WSClient {
rpcAddr := GetConfig().RPCListenAddress
rpcAddr := GetConfig().RPC.ListenAddress
wsc := client.NewWSClient(rpcAddr, "/websocket")
if _, err := wsc.Start(); err != nil {
panic(err)