remove Result from the client package

plus make Client interface more consistent. All *Sync functions now
return an error as a second return param. Deliver/Check/Commit use Code
to indicate errors and have IsErr() func defined on ResponseXYZ structs.
This commit is contained in:
Anton Kaliaev
2017-11-21 17:44:13 -06:00
parent 8e6269ce93
commit fbe7234639
7 changed files with 140 additions and 189 deletions
+7
View File
@@ -106,6 +106,7 @@ func (r *ResponseCheckTx) Result() Result {
}
}
// IsErr returns true if Code is something other than OK.
func (r ResponseCheckTx) IsErr() bool {
return r.Code != CodeType_OK
}
@@ -120,6 +121,7 @@ func (r *ResponseDeliverTx) Result() Result {
}
}
// IsErr returns true if Code is something other than OK.
func (r ResponseDeliverTx) IsErr() bool {
return r.Code != CodeType_OK
}
@@ -145,3 +147,8 @@ func (r *ResponseQuery) Result() *ResultQuery {
Log: r.Log,
}
}
// IsErr returns true if Code is something other than OK.
func (r ResponseCommit) IsErr() bool {
return r.Code != CodeType_OK
}