From 40b65001c80811a60aab31e974825eaa7f64e210 Mon Sep 17 00:00:00 2001 From: Lior Bondarevski Date: Sun, 21 Aug 2022 18:07:10 +0300 Subject: [PATCH] Fix list-contract-by-code output --- x/compute/client/cli/query.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x/compute/client/cli/query.go b/x/compute/client/cli/query.go index bc26f67ad..fe30a2fb4 100644 --- a/x/compute/client/cli/query.go +++ b/x/compute/client/cli/query.go @@ -172,6 +172,11 @@ func GetCmdListContractByCode() *cobra.Command { if err != nil { return err } + + if len(res) == 0 { + return fmt.Errorf("can not find contract with code id %d", codeID) + } + fmt.Println(string(res)) return nil },