From 759a4130305eafb7f5cb63852e9b0d7775f1552f Mon Sep 17 00:00:00 2001 From: kkast Date: Thu, 18 Apr 2024 02:58:38 +0300 Subject: [PATCH] client states parse only for grandpa --- modules/core/02-client/client/utils/utils.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/core/02-client/client/utils/utils.go b/modules/core/02-client/client/utils/utils.go index 8b490439720..d1182f8115d 100644 --- a/modules/core/02-client/client/utils/utils.go +++ b/modules/core/02-client/client/utils/utils.go @@ -2,6 +2,7 @@ package utils import ( "context" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" wasmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/08-wasm/types" @@ -223,10 +224,12 @@ func MaybeDecodeWasmData(codec codec.BinaryCodec, any *codectypes.Any) { var innerAny codectypes.Any err = codec.Unmarshal(state.Data, &innerAny) if err == nil { - state.XInner = &wasmtypes.ClientState_Inner{Inner: &innerAny} - bts, err := state.Marshal() - if err == nil { - any.Value = bts + if innerAny.TypeUrl == "/ibc.lightclients.grandpa.v1.ClientState" { + state.XInner = &wasmtypes.ClientState_Inner{Inner: &innerAny} + bts, err := state.Marshal() + if err == nil { + any.Value = bts + } } } }