mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-27 19:37:08 +00:00
CommitSync returns tmsp.Result
This commit is contained in:
@@ -43,7 +43,7 @@ func (app *CounterApplication) AppendTx(tx []byte) types.Result {
|
||||
}
|
||||
}
|
||||
app.txCount += 1
|
||||
return types.NewResultOK(nil, "")
|
||||
return types.OK
|
||||
}
|
||||
|
||||
func (app *CounterApplication) CheckTx(tx []byte) types.Result {
|
||||
@@ -59,18 +59,18 @@ func (app *CounterApplication) CheckTx(tx []byte) types.Result {
|
||||
}
|
||||
}
|
||||
}
|
||||
return types.NewResultOK(nil, "")
|
||||
return types.OK
|
||||
}
|
||||
|
||||
func (app *CounterApplication) Commit() (hash []byte, log string) {
|
||||
func (app *CounterApplication) Commit() types.Result {
|
||||
app.hashCount += 1
|
||||
|
||||
if app.txCount == 0 {
|
||||
return nil, ""
|
||||
return types.OK
|
||||
} else {
|
||||
hash := make([]byte, 8)
|
||||
binary.BigEndian.PutUint64(hash, uint64(app.txCount))
|
||||
return hash, ""
|
||||
return types.NewResultOK(hash, "")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,16 +35,16 @@ func (app *DummyApplication) AppendTx(tx []byte) types.Result {
|
||||
} else {
|
||||
app.state.Set(tx, tx)
|
||||
}
|
||||
return types.NewResultOK(nil, "")
|
||||
return types.OK
|
||||
}
|
||||
|
||||
func (app *DummyApplication) CheckTx(tx []byte) types.Result {
|
||||
return types.NewResultOK(nil, "")
|
||||
return types.OK
|
||||
}
|
||||
|
||||
func (app *DummyApplication) Commit() (hash []byte, log string) {
|
||||
hash = app.state.Hash()
|
||||
return hash, ""
|
||||
func (app *DummyApplication) Commit() types.Result {
|
||||
hash := app.state.Hash()
|
||||
return types.NewResultOK(hash, "")
|
||||
}
|
||||
|
||||
func (app *DummyApplication) Query(query []byte) types.Result {
|
||||
|
||||
@@ -27,8 +27,8 @@ func (app *NilApplication) CheckTx(tx []byte) types.Result {
|
||||
return types.NewResultOK(nil, "")
|
||||
}
|
||||
|
||||
func (app *NilApplication) Commit() (hash []byte, log string) {
|
||||
return []byte("nil"), ""
|
||||
func (app *NilApplication) Commit() types.Result {
|
||||
return types.NewResultOK([]byte("nil"), "")
|
||||
}
|
||||
|
||||
func (app *NilApplication) Query(query []byte) types.Result {
|
||||
|
||||
Reference in New Issue
Block a user