DeliverTxSync/CheckTxSync/CommitSync now return error as well

This commit is contained in:
Anton Kaliaev
2017-11-22 17:34:00 -06:00
parent 01252e8cc8
commit f01f2bbf3a
8 changed files with 66 additions and 36 deletions

View File

@ -166,18 +166,18 @@ func (app *localClient) SetOptionSync(key string, value string) (log string, err
return log, nil
}
func (app *localClient) DeliverTxSync(tx []byte) *types.ResponseDeliverTx {
func (app *localClient) DeliverTxSync(tx []byte) (*types.ResponseDeliverTx, error) {
app.mtx.Lock()
res := app.Application.DeliverTx(tx)
app.mtx.Unlock()
return &res
return &res, nil
}
func (app *localClient) CheckTxSync(tx []byte) *types.ResponseCheckTx {
func (app *localClient) CheckTxSync(tx []byte) (*types.ResponseCheckTx, error) {
app.mtx.Lock()
res := app.Application.CheckTx(tx)
app.mtx.Unlock()
return &res
return &res, nil
}
func (app *localClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) {
@ -187,11 +187,11 @@ func (app *localClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery,
return &res, nil
}
func (app *localClient) CommitSync() *types.ResponseCommit {
func (app *localClient) CommitSync() (*types.ResponseCommit, error) {
app.mtx.Lock()
res := app.Application.Commit()
app.mtx.Unlock()
return &res
return &res, nil
}
func (app *localClient) InitChainSync(params types.RequestInitChain) error {