diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index 240d9f98a4..61874cffd9 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -495,7 +495,7 @@ func (tr Chain) UpdateConsumer(providerChain ChainID, validator ValidatorID, upd bz, err = cmd.CombinedOutput() if err != nil { fmt.Println("command failed: ", cmd) - log.Fatal("update consumer failed error: %w, output: %s", err, string(bz)) + log.Fatalf("update consumer failed error: %s, output: %s", err, string(bz)) } // Check transaction diff --git a/tests/e2e/state.go b/tests/e2e/state.go index 336d4af39c..cf30020ef1 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -9,6 +9,7 @@ import ( "regexp" "sort" "strconv" + "strings" "time" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" @@ -285,12 +286,28 @@ func (tr Commands) GetReward(chain ChainID, validator ValidatorID, blockHeight u log.Fatal("failed getting rewards: ", err, "\n", string(bz)) } - denomCondition := `total.#(denom!="stake").amount` - if isNativeDenom { - denomCondition = `total.#(denom=="stake").amount` + denom := "stake" + if !isNativeDenom { + denom = "ibc" } - return gjson.Get(string(bz), denomCondition).Float() + denomCondition := fmt.Sprintf(`total.#(%%"*%s*")`, denom) + amount := strings.Split(gjson.Get(string(bz), denomCondition).String(), denom)[0] + + fmt.Println("denomCondition:", denomCondition) + fmt.Println("json:", gjson.Parse(string(bz))) + + res := float64(0) + if amount != "" { + res, err = strconv.ParseFloat(amount, 64) + if err != nil { + log.Fatal("failed parsing consumer reward:", err) + } + } + + fmt.Println("res", res) + + return res } // interchain-securityd query gov proposals