Proof uses uint64 for blockHeight

This commit is contained in:
Ethan Frey
2017-01-17 17:22:34 +01:00
parent e0309007ad
commit fdc047ae7a
14 changed files with 193 additions and 194 deletions

View File

@@ -3,9 +3,9 @@ package main
import (
"flag"
. "github.com/tendermint/go-common"
"github.com/tendermint/abci/server"
"github.com/tendermint/abci/types"
. "github.com/tendermint/go-common"
)
func main() {
@@ -61,7 +61,7 @@ func (app *ChainAwareApplication) Query(query []byte) types.Result {
return types.NewResultOK([]byte(Fmt("%d,%d", app.beginCount, app.endCount)), "")
}
func (app *ChainAwareApplication) Proof(key []byte, blockHeight int64) types.Result {
func (app *ChainAwareApplication) Proof(key []byte, blockHeight uint64) types.Result {
return types.NewResultOK(nil, Fmt("Proof is not supported"))
}

View File

@@ -3,8 +3,8 @@ package counter
import (
"encoding/binary"
. "github.com/tendermint/go-common"
"github.com/tendermint/abci/types"
. "github.com/tendermint/go-common"
)
type CounterApplication struct {
@@ -84,6 +84,6 @@ func (app *CounterApplication) Query(query []byte) types.Result {
return types.ErrUnknownRequest.SetLog(Fmt("Invalid nonce. Expected hash or tx, got %v", queryStr))
}
func (app *CounterApplication) Proof(key []byte, blockHeight int64) types.Result {
func (app *CounterApplication) Proof(key []byte, blockHeight uint64) types.Result {
return types.NewResultOK(nil, Fmt("Proof is not supported"))
}

View File

@@ -54,7 +54,7 @@ func (app *DummyApplication) Query(query []byte) types.Result {
return types.NewResultOK(wire.JSONBytes(queryResult), "")
}
func (app *DummyApplication) Proof(key []byte, blockHeight int64) types.Result {
func (app *DummyApplication) Proof(key []byte, blockHeight uint64) types.Result {
// TODO: when go-merkle supports querying older blocks without possible panics,
// we should store a cache and allow a query. But for now it is impossible.
// And this is just a Dummy application anyway, what do you expect? ;)

View File

@@ -6,11 +6,11 @@ import (
"strconv"
"strings"
"github.com/tendermint/abci/types"
. "github.com/tendermint/go-common"
dbm "github.com/tendermint/go-db"
"github.com/tendermint/go-merkle"
"github.com/tendermint/go-wire"
"github.com/tendermint/abci/types"
)
const (
@@ -93,7 +93,7 @@ func (app *PersistentDummyApplication) Query(query []byte) types.Result {
return app.app.Query(query)
}
func (app *PersistentDummyApplication) Proof(key []byte, blockHeight int64) types.Result {
func (app *PersistentDummyApplication) Proof(key []byte, blockHeight uint64) types.Result {
return app.app.Proof(key, blockHeight)
}

View File

@@ -35,6 +35,6 @@ func (app *NilApplication) Query(query []byte) types.Result {
return types.NewResultOK(nil, "")
}
func (app *NilApplication) Proof(key []byte, blockHeight int64) types.Result {
func (app *NilApplication) Proof(key []byte, blockHeight uint64) types.Result {
return types.NewResultOK(nil, "")
}