NewXXXClient doesnt run Start or return error

This commit is contained in:
Ethan Buchman
2017-05-15 11:29:34 -04:00
parent fadfcfdcb0
commit eda4f2dddc
9 changed files with 46 additions and 33 deletions

View File

@ -43,15 +43,16 @@ type Client interface {
//----------------------------------------
// NewClient returns a new ABCI client of the specified transport type.
// It returns an error if the transport is not "socket" or "grpc"
func NewClient(addr, transport string, mustConnect bool) (client Client, err error) {
switch transport {
case "socket":
client, err = NewSocketClient(addr, mustConnect)
client = NewSocketClient(addr, mustConnect)
case "grpc":
client, err = NewGRPCClient(addr, mustConnect)
client = NewGRPCClient(addr, mustConnect)
default:
err = fmt.Errorf("Unknown abci transport %s", transport)
}
return
}