Browse Source

s/GetHash/Commit/g

pull/192/head
Jae Kwon 9 years ago
parent
commit
a6d37a49a2
5 changed files with 13 additions and 13 deletions
  1. +2
    -2
      mempool/mempool_test.go
  2. +1
    -1
      node/node.go
  3. +2
    -2
      proxy/app_conn.go
  4. +6
    -6
      proxy/local_app_conn.go
  5. +2
    -2
      state/execution.go

+ 2
- 2
mempool/mempool_test.go 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)
}
}


+ 1
- 1
node/node.go 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))
}


+ 2
- 2
proxy/app_conn.go 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)
}

+ 6
- 6
proxy/local_app_conn.go 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
}

+ 2
- 2
state/execution.go 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))


Loading…
Cancel
Save