mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-31 20:36:13 +00:00
Merge branch 'abci_proof' into develop
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user