From 1e12272bd7589eab96b7c106c98bc00425a37366 Mon Sep 17 00:00:00 2001 From: antho1404 Date: Thu, 6 Feb 2020 11:00:59 +0700 Subject: [PATCH 1/2] add test of missing verifier in cli context --- client/context/query.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/context/query.go b/client/context/query.go index b5686f864165..c0c45a226fb7 100644 --- a/client/context/query.go +++ b/client/context/query.go @@ -130,6 +130,9 @@ func (ctx CLIContext) query(path string, key tmbytes.HexBytes) ([]byte, int64, e // Verify verifies the consensus proof at given height. func (ctx CLIContext) Verify(height int64) (tmtypes.SignedHeader, error) { + if ctx.Verifier == nil { + return tmtypes.SignedHeader{}, fmt.Errorf("missing valid certifier to verify data from distrusted node") + } check, err := tmliteProxy.GetCertifiedCommit(height, ctx.Client, ctx.Verifier) switch { case tmliteErr.IsErrCommitNotFound(err): From 2c47f34b603b2cf1ed0157677dd44292cd2e2090 Mon Sep 17 00:00:00 2001 From: antho1404 Date: Thu, 6 Feb 2020 11:09:29 +0700 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc45a176b45d..6d53438b58a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ balances or a single balance by denom when the `denom` query parameter is presen ### Bug Fixes * (x/bank) [\#5531](https://github.com/cosmos/cosmos-sdk/issues/5531) Added missing amount event to MsgMultiSend, emitted for each output. +* (client) [\#5618](https://github.com/cosmos/cosmos-sdk/pull/5618) Fix crash on the client when the verifier is not set. ### State Machine Breaking