s/GetHash/Commit/g

This commit is contained in:
Jae Kwon 2016-02-14 13:11:01 -08:00
parent 1da8729e09
commit a6d37a49a2
5 changed files with 13 additions and 13 deletions

View File

@ -77,9 +77,9 @@ func TestSerialReap(t *testing.T) {
code, result, logStr)
}
}
hash, log := appConnCon.GetHash()
hash, log := appConnCon.Commit()
if len(hash) != 8 {
t.Errorf("Error getting hash. Hash:%X log:%v", hash, log)
t.Errorf("Error committing. Hash:%X log:%v", hash, log)
}
}

View File

@ -242,7 +242,7 @@ func getProxyApp(addr string, hash []byte) (proxyAppConn proxy.AppConn) {
}
// Check the hash
currentHash, _, err := proxyAppConn.GetHashSync()
currentHash, _, err := proxyAppConn.CommitSync()
if err != nil {
PanicCrisis(Fmt("Error in getting proxyAppConn hash: %v", err))
}

View File

@ -12,10 +12,10 @@ type AppConn interface {
FlushAsync() *tmspcli.ReqRes
AppendTxAsync(tx []byte) *tmspcli.ReqRes
CheckTxAsync(tx []byte) *tmspcli.ReqRes
GetHashAsync() *tmspcli.ReqRes
CommitAsync() *tmspcli.ReqRes
SetOptionAsync(key string, value string) *tmspcli.ReqRes
InfoSync() (info string, err error)
FlushSync() error
GetHashSync() (hash []byte, log string, err error)
CommitSync() (hash []byte, log string, err error)
}

View File

@ -76,13 +76,13 @@ func (app *localAppConn) CheckTxAsync(tx []byte) *tmspcli.ReqRes {
return nil // TODO maybe create a ReqRes
}
func (app *localAppConn) GetHashAsync() *tmspcli.ReqRes {
func (app *localAppConn) CommitAsync() *tmspcli.ReqRes {
app.mtx.Lock()
hash, log := app.Application.GetHash()
hash, log := app.Application.Commit()
app.mtx.Unlock()
app.Callback(
tmsp.RequestGetHash(),
tmsp.ResponseGetHash(hash, log),
tmsp.RequestCommit(),
tmsp.ResponseCommit(hash, log),
)
return nil // TODO maybe create a ReqRes
}
@ -98,9 +98,9 @@ func (app *localAppConn) FlushSync() error {
return nil
}
func (app *localAppConn) GetHashSync() (hash []byte, log string, err error) {
func (app *localAppConn) CommitSync() (hash []byte, log string, err error) {
app.mtx.Lock()
hash, log = app.Application.GetHash()
hash, log = app.Application.Commit()
app.mtx.Unlock()
return hash, log, nil
}

View File

@ -84,13 +84,13 @@ func (s *State) execBlockOnProxyApp(evsw *events.EventSwitch, proxyAppConn proxy
return err
}
}
hash, logStr, err := proxyAppConn.GetHashSync()
hash, logStr, err := proxyAppConn.CommitSync()
if err != nil {
log.Warn("Error computing proxyAppConn hash", "error", err)
return err
}
if logStr != "" {
log.Debug("GetHash.Log: " + logStr)
log.Debug("Commit.Log: " + logStr)
}
log.Info(Fmt("ExecBlock got %v valid txs and %v invalid txs", validTxs, invalidTxs))