From a6d37a49a222174763b24bf929a9661d8140483a Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Sun, 14 Feb 2016 13:11:01 -0800 Subject: [PATCH] s/GetHash/Commit/g --- mempool/mempool_test.go | 4 ++-- node/node.go | 2 +- proxy/app_conn.go | 4 ++-- proxy/local_app_conn.go | 12 ++++++------ state/execution.go | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/mempool/mempool_test.go b/mempool/mempool_test.go index ac241f290..67293765e 100644 --- a/mempool/mempool_test.go +++ b/mempool/mempool_test.go @@ -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) } } diff --git a/node/node.go b/node/node.go index 11d8730e9..bf5e8294a 100644 --- a/node/node.go +++ b/node/node.go @@ -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)) } diff --git a/proxy/app_conn.go b/proxy/app_conn.go index 391254fe1..2e19394a7 100644 --- a/proxy/app_conn.go +++ b/proxy/app_conn.go @@ -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) } diff --git a/proxy/local_app_conn.go b/proxy/local_app_conn.go index 713f7f38d..001c81ebf 100644 --- a/proxy/local_app_conn.go +++ b/proxy/local_app_conn.go @@ -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 } diff --git a/state/execution.go b/state/execution.go index 7c56e7216..1a81e6e66 100644 --- a/state/execution.go +++ b/state/execution.go @@ -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))