Merge branch 'abci_proof' into develop

This commit is contained in:
Jae Kwon
2017-01-27 22:27:32 -08:00
26 changed files with 903 additions and 368 deletions
+4 -3
View File
@@ -2,7 +2,6 @@ package main
import (
"flag"
"fmt"
"log"
"github.com/tendermint/abci/server"
@@ -59,8 +58,10 @@ func (app *ChainAwareApplication) Commit() types.Result {
return types.NewResultOK([]byte("nil"), "")
}
func (app *ChainAwareApplication) Query(query []byte) types.Result {
return types.NewResultOK([]byte(fmt.Sprintf("%d,%d", app.beginCount, app.endCount)), "")
func (app *ChainAwareApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) {
return types.ResponseQuery{
Value: []byte(cmn.Fmt("%d,%d", app.beginCount, app.endCount)),
}
}
func (app *ChainAwareApplication) BeginBlock(hash []byte, header *types.Header) {
+3 -3
View File
@@ -40,10 +40,10 @@ func TestChainAware(t *testing.T) {
client.CommitSync()
}
r := app.Query(nil)
spl := strings.Split(string(r.Data), ",")
r := app.Query(types.RequestQuery{})
spl := strings.Split(string(r.Value), ",")
if len(spl) != 2 {
t.Fatal("expected %d,%d ; got %s", n, n, string(r.Data))
t.Fatal("expected %d,%d ; got %s", n, n, string(r.Value))
}
beginCount, _ := strconv.Atoi(spl[0])
endCount, _ := strconv.Atoi(spl[1])