Skip to content

Commit

Permalink
client states parse only for grandpa
Browse files Browse the repository at this point in the history
  • Loading branch information
kkast committed Apr 17, 2024
1 parent f04551c commit 759a413
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/core/02-client/client/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
}
}
}
}
Expand Down

0 comments on commit 759a413

Please sign in to comment.