CommitSync() returns tmsp.Result

This commit is contained in:
Jae Kwon
2016-03-23 02:49:30 -07:00
parent de6f76758d
commit 8183e3201b
5 changed files with 21 additions and 21 deletions

View File

@ -74,11 +74,11 @@ func (app *localAppConn) CheckTxAsync(tx []byte) *tmspcli.ReqRes {
func (app *localAppConn) CommitAsync() *tmspcli.ReqRes {
app.mtx.Lock()
hash, log := app.Application.Commit()
res := app.Application.Commit()
app.mtx.Unlock()
return app.callback(
tmsp.RequestCommit(),
tmsp.ResponseCommit(hash, log),
tmsp.ResponseCommit(res.Code, res.Data, res.Log),
)
}
@ -93,11 +93,11 @@ func (app *localAppConn) FlushSync() error {
return nil
}
func (app *localAppConn) CommitSync() (hash []byte, log string, err error) {
func (app *localAppConn) CommitSync() (res tmsp.Result) {
app.mtx.Lock()
hash, log = app.Application.Commit()
res = app.Application.Commit()
app.mtx.Unlock()
return hash, log, nil
return res
}
func (app *localAppConn) InitChainSync(validators []*tmsp.Validator) (err error) {