diff --git a/client/context/query.go b/client/context/query.go index 4cd3c427f..e4e488190 100644 --- a/client/context/query.go +++ b/client/context/query.go @@ -14,10 +14,10 @@ import ( "github.com/cosmos/cosmos-sdk/store" abci "github.com/tendermint/tendermint/abci/types" cmn "github.com/tendermint/tendermint/libs/common" - "github.com/tendermint/tendermint/lite" tmliteErr "github.com/tendermint/tendermint/lite/errors" tmliteProxy "github.com/tendermint/tendermint/lite/proxy" rpcclient "github.com/tendermint/tendermint/rpc/client" + tmtypes "github.com/tendermint/tendermint/types" ) // GetNode returns an RPC client. If the context's client is not defined, an @@ -185,13 +185,13 @@ func (ctx CLIContext) query(path string, key cmn.HexBytes) (res []byte, err erro } // Verify verifies the consensus proof at given height. -func (ctx CLIContext) Verify(height int64) (lite.Commit, error) { +func (ctx CLIContext) Verify(height int64) (tmtypes.SignedHeader, error) { check, err := tmliteProxy.GetCertifiedCommit(height, ctx.Client, ctx.Verifier) switch { - case tmliteErr.IsCommitNotFoundErr(err): - return lite.Commit{}, ErrVerifyCommit(height) + case tmliteErr.IsErrCommitNotFound(err): + return tmtypes.SignedHeader{}, ErrVerifyCommit(height) case err != nil: - return lite.Commit{}, err + return tmtypes.SignedHeader{}, err } return check, nil diff --git a/client/rpc/block.go b/client/rpc/block.go index 44def2d32..d734dc989 100644 --- a/client/rpc/block.go +++ b/client/rpc/block.go @@ -46,7 +46,7 @@ func getBlock(cliCtx context.CLIContext, height *int64) ([]byte, error) { } if !cliCtx.TrustNode { - check, err := cliCtx.Certify(res.Block.Height) + check, err := cliCtx.Verify(res.Block.Height) if err != nil { return nil, err } diff --git a/client/rpc/validators.go b/client/rpc/validators.go index 4802e785b..e3fef4c6e 100644 --- a/client/rpc/validators.go +++ b/client/rpc/validators.go @@ -12,8 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/context" sdk "github.com/cosmos/cosmos-sdk/types" - tmtypes "github.com/tendermint/tendermint/types" "github.com/spf13/viper" + tmtypes "github.com/tendermint/tendermint/types" ) // TODO these next two functions feel kinda hacky based on their placement @@ -76,12 +76,12 @@ func getValidators(cliCtx context.CLIContext, height *int64) ([]byte, error) { } if !cliCtx.TrustNode { - check, err := cliCtx.Certify(validatorsRes.BlockHeight) + check, err := cliCtx.Verify(validatorsRes.BlockHeight) if err != nil { return nil, err } - if !bytes.Equal(check.ValidatorsHash(), tmtypes.NewValidatorSet(validatorsRes.Validators).Hash()) { + if !bytes.Equal(check.ValidatorsHash, tmtypes.NewValidatorSet(validatorsRes.Validators).Hash()) { return nil, fmt.Errorf("got invalid validatorset") } } diff --git a/client/tx/query.go b/client/tx/query.go index f1d13b608..a1b7e5552 100644 --- a/client/tx/query.go +++ b/client/tx/query.go @@ -3,8 +3,8 @@ package tx import ( "encoding/hex" "fmt" - "net/http" "github.com/tendermint/tendermint/libs/common" + "net/http" "github.com/gorilla/mux" "github.com/spf13/cobra" @@ -83,7 +83,7 @@ func queryTx(cdc *codec.Codec, cliCtx context.CLIContext, hashHexStr string) ([] // ValidateTxResult performs transaction verification func ValidateTxResult(cliCtx context.CLIContext, res *ctypes.ResultTx) error { - check, err := cliCtx.Certify(res.Height) + check, err := cliCtx.Verify(res.Height) if err != nil { return err }