CommitSync returns tmsp.Result

This commit is contained in:
Jae Kwon
2016-03-23 02:50:29 -07:00
parent 5a3975d54a
commit 6785b9a3b6
10 changed files with 82 additions and 50 deletions
+5 -5
View File
@@ -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, "")
}
}