func InitGenesis(ctx sdk.Context, k keeper.Keeper, gs types.GenesisState) {
	if len(gs.ClientsMetadata) != 0 {
		k.SetAllClientMetadata(ctx, gs.ClientsMetadata)
	}
	for _, client := range gs.Clients {
		cs, ok := client.ClientState.GetCachedValue().(exported.ClientState)
		if !ok {
			panic("invalid client state")
		}
		k.SetClientState(ctx, client.ChainName, cs)
	}
	for _, cs := range gs.ClientsConsensus {
		for _, consState := range cs.ConsensusStates {
			consensusState, ok := consState.ConsensusState.GetCachedValue().(exported.ConsensusState)
			if !ok {
				panic(fmt.Sprintf("invalid consensus state with chain name %s at height %s", cs.ChainName, consState.Height))
			}
			k.SetClientConsensusState(ctx, cs.ChainName, consState.Height, consensusState)
		}
	}
	for _, rs := range gs.Relayers {
		k.RegisterRelayers(ctx, rs.ChainName, rs.Relayers)
	}
	k.SetChainName(ctx, gs.NativeChainName)
}
InitGenesis initializes the tibc client submodule's state from a provided genesis
state.
package client
import (
	"fmt"
	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/bianjieai/tibc-go/modules/tibc/core/02-client/keeper"
	"github.com/bianjieai/tibc-go/modules/tibc/core/02-client/types"
	"github.com/bianjieai/tibc-go/modules/tibc/core/exported"
)