mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 06:54:41 +00:00
Everything compiles, test proof in dummy app
This commit is contained in:
+2
-2
@@ -21,7 +21,7 @@ type Client interface {
|
||||
DeliverTxAsync(tx []byte) *ReqRes
|
||||
CheckTxAsync(tx []byte) *ReqRes
|
||||
QueryAsync(tx []byte) *ReqRes
|
||||
ProofAsync(tx []byte) *ReqRes
|
||||
ProofAsync(key []byte, blockHeight int64) *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(tx []byte) (res types.Result)
|
||||
ProofSync(key []byte, blockHeight int64) (res types.Result)
|
||||
CommitSync() (res types.Result)
|
||||
|
||||
InitChainAsync(validators []*types.Validator) *ReqRes
|
||||
|
||||
@@ -182,8 +182,8 @@ func (cli *grpcClient) QueryAsync(query []byte) *ReqRes {
|
||||
return cli.finishAsyncCall(req, &types.Response{&types.Response_Query{res}})
|
||||
}
|
||||
|
||||
func (cli *grpcClient) ProofAsync(key []byte) *ReqRes {
|
||||
req := types.ToRequestProof(key)
|
||||
func (cli *grpcClient) ProofAsync(key []byte, blockHeight int64) *ReqRes {
|
||||
req := types.ToRequestProof(key, blockHeight)
|
||||
res, err := cli.client.Proof(context.Background(), req.GetProof(), grpc.FailFast(true))
|
||||
if err != nil {
|
||||
cli.StopForError(err)
|
||||
@@ -310,8 +310,8 @@ 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) (res types.Result) {
|
||||
reqres := cli.ProofAsync(key)
|
||||
func (cli *grpcClient) ProofSync(key []byte, blockHeight int64) (res types.Result) {
|
||||
reqres := cli.ProofAsync(key, blockHeight)
|
||||
if res := cli.checkErrGetResult(); res.IsErr() {
|
||||
return res
|
||||
}
|
||||
|
||||
@@ -99,12 +99,12 @@ func (app *localClient) QueryAsync(tx []byte) *ReqRes {
|
||||
)
|
||||
}
|
||||
|
||||
func (app *localClient) ProofAsync(key []byte) *ReqRes {
|
||||
func (app *localClient) ProofAsync(key []byte, blockHeight int64) *ReqRes {
|
||||
app.mtx.Lock()
|
||||
res := app.Application.Proof(key)
|
||||
res := app.Application.Proof(key, blockHeight)
|
||||
app.mtx.Unlock()
|
||||
return app.callback(
|
||||
types.ToRequestProof(key),
|
||||
types.ToRequestProof(key, blockHeight),
|
||||
types.ToResponseQuery(res.Code, res.Data, res.Log),
|
||||
)
|
||||
}
|
||||
@@ -202,9 +202,9 @@ func (app *localClient) QuerySync(query []byte) (res types.Result) {
|
||||
return res
|
||||
}
|
||||
|
||||
func (app *localClient) ProofSync(key []byte) (res types.Result) {
|
||||
func (app *localClient) ProofSync(key []byte, blockHeight int64) (res types.Result) {
|
||||
app.mtx.Lock()
|
||||
res = app.Application.Proof(key)
|
||||
res = app.Application.Proof(key, blockHeight)
|
||||
app.mtx.Unlock()
|
||||
return res
|
||||
}
|
||||
|
||||
@@ -255,8 +255,8 @@ func (cli *socketClient) QueryAsync(query []byte) *ReqRes {
|
||||
return cli.queueRequest(types.ToRequestQuery(query))
|
||||
}
|
||||
|
||||
func (cli *socketClient) ProofAsync(key []byte) *ReqRes {
|
||||
return cli.queueRequest(types.ToRequestProof(key))
|
||||
func (cli *socketClient) ProofAsync(key []byte, blockHeight int64) *ReqRes {
|
||||
return cli.queueRequest(types.ToRequestProof(key, blockHeight))
|
||||
}
|
||||
|
||||
func (cli *socketClient) CommitAsync() *ReqRes {
|
||||
@@ -349,8 +349,8 @@ 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) (res types.Result) {
|
||||
reqres := cli.queueRequest(types.ToRequestProof(key))
|
||||
func (cli *socketClient) ProofSync(key []byte, blockHeight int64) (res types.Result) {
|
||||
reqres := cli.queueRequest(types.ToRequestProof(key, blockHeight))
|
||||
cli.FlushSync()
|
||||
if err := cli.Error(); err != nil {
|
||||
return types.ErrInternalError.SetLog(err.Error())
|
||||
|
||||
Reference in New Issue
Block a user