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
+3 -3
View File
@@ -4,8 +4,8 @@ import (
"fmt"
"sync"
. "github.com/tendermint/go-common"
"github.com/tendermint/abci/types"
. "github.com/tendermint/go-common"
)
type Client interface {
@@ -21,7 +21,7 @@ type Client interface {
DeliverTxAsync(tx []byte) *ReqRes
CheckTxAsync(tx []byte) *ReqRes
QueryAsync(tx []byte) *ReqRes
ProofAsync(key []byte, blockHeight int64) *ReqRes
ProofAsync(key []byte, blockHeight uint64) *ReqRes
CommitAsync() *ReqRes
FlushSync() error
@@ -31,7 +31,7 @@ type Client interface {
DeliverTxSync(tx []byte) (res types.Result)
CheckTxSync(tx []byte) (res types.Result)
QuerySync(tx []byte) (res types.Result)
ProofSync(key []byte, blockHeight int64) (res types.Result)
ProofSync(key []byte, blockHeight uint64) (res types.Result)
CommitSync() (res types.Result)
InitChainAsync(validators []*types.Validator) *ReqRes
+3 -3
View File
@@ -8,8 +8,8 @@ import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
. "github.com/tendermint/go-common"
"github.com/tendermint/abci/types"
. "github.com/tendermint/go-common"
)
// A stripped copy of the remoteClient that makes
@@ -182,7 +182,7 @@ func (cli *grpcClient) QueryAsync(query []byte) *ReqRes {
return cli.finishAsyncCall(req, &types.Response{&types.Response_Query{res}})
}
func (cli *grpcClient) ProofAsync(key []byte, blockHeight int64) *ReqRes {
func (cli *grpcClient) ProofAsync(key []byte, blockHeight uint64) *ReqRes {
req := types.ToRequestProof(key, blockHeight)
res, err := cli.client.Proof(context.Background(), req.GetProof(), grpc.FailFast(true))
if err != nil {
@@ -310,7 +310,7 @@ func (cli *grpcClient) CheckTxSync(tx []byte) (res types.Result) {
return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log}
}
func (cli *grpcClient) ProofSync(key []byte, blockHeight int64) (res types.Result) {
func (cli *grpcClient) ProofSync(key []byte, blockHeight uint64) (res types.Result) {
reqres := cli.ProofAsync(key, blockHeight)
if res := cli.checkErrGetResult(); res.IsErr() {
return res
+3 -3
View File
@@ -3,8 +3,8 @@ package abcicli
import (
"sync"
. "github.com/tendermint/go-common"
types "github.com/tendermint/abci/types"
. "github.com/tendermint/go-common"
)
type localClient struct {
@@ -99,7 +99,7 @@ func (app *localClient) QueryAsync(tx []byte) *ReqRes {
)
}
func (app *localClient) ProofAsync(key []byte, blockHeight int64) *ReqRes {
func (app *localClient) ProofAsync(key []byte, blockHeight uint64) *ReqRes {
app.mtx.Lock()
res := app.Application.Proof(key, blockHeight)
app.mtx.Unlock()
@@ -202,7 +202,7 @@ func (app *localClient) QuerySync(query []byte) (res types.Result) {
return res
}
func (app *localClient) ProofSync(key []byte, blockHeight int64) (res types.Result) {
func (app *localClient) ProofSync(key []byte, blockHeight uint64) (res types.Result) {
app.mtx.Lock()
res = app.Application.Proof(key, blockHeight)
app.mtx.Unlock()
+3 -3
View File
@@ -10,8 +10,8 @@ import (
"sync"
"time"
. "github.com/tendermint/go-common"
"github.com/tendermint/abci/types"
. "github.com/tendermint/go-common"
)
const (
@@ -255,7 +255,7 @@ func (cli *socketClient) QueryAsync(query []byte) *ReqRes {
return cli.queueRequest(types.ToRequestQuery(query))
}
func (cli *socketClient) ProofAsync(key []byte, blockHeight int64) *ReqRes {
func (cli *socketClient) ProofAsync(key []byte, blockHeight uint64) *ReqRes {
return cli.queueRequest(types.ToRequestProof(key, blockHeight))
}
@@ -349,7 +349,7 @@ func (cli *socketClient) QuerySync(query []byte) (res types.Result) {
return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log}
}
func (cli *socketClient) ProofSync(key []byte, blockHeight int64) (res types.Result) {
func (cli *socketClient) ProofSync(key []byte, blockHeight uint64) (res types.Result) {
reqres := cli.queueRequest(types.ToRequestProof(key, blockHeight))
cli.FlushSync()
if err := cli.Error(); err != nil {