mukan-ibc/modules/core/genesis.go
Mukan Erkin Törük 6852832fe8
Some checks failed
CodeQL / Analyze (push) Waiting to run
Docker Build & Push Simapp (main) / docker-build (push) Waiting to run
golangci-lint / lint (push) Waiting to run
Tests / Code Coverage / build (amd64) (push) Waiting to run
Tests / Code Coverage / build (arm64) (push) Waiting to run
Tests / Code Coverage / unit-tests (map[additional-args:-tags="test_e2e" name:e2e path:./e2e]) (push) Waiting to run
Tests / Code Coverage / unit-tests (map[name:08-wasm path:./modules/light-clients/08-wasm]) (push) Waiting to run
Tests / Code Coverage / unit-tests (map[name:ibc-go path:.]) (push) Waiting to run
Deploy to GitHub Pages / Deploy to GitHub Pages (push) Has been cancelled
Buf-Push / push (push) Has been cancelled
initial: sovereign Mukan Network fork
2026-05-11 03:18:28 +03:00

34 lines
1.4 KiB
Go

package ibc
import (
sdk "github.com/cosmos/cosmos-sdk/types"
client "github.com/cosmos/ibc-go/v10/modules/core/02-client"
clientv2 "github.com/cosmos/ibc-go/v10/modules/core/02-client/v2"
connection "github.com/cosmos/ibc-go/v10/modules/core/03-connection"
channel "github.com/cosmos/ibc-go/v10/modules/core/04-channel"
channelv2 "github.com/cosmos/ibc-go/v10/modules/core/04-channel/v2"
"github.com/cosmos/ibc-go/v10/modules/core/keeper"
"github.com/cosmos/ibc-go/v10/modules/core/types"
)
// InitGenesis initializes the ibc state from a provided genesis
// state.
func InitGenesis(ctx sdk.Context, k keeper.Keeper, gs *types.GenesisState) {
client.InitGenesis(ctx, k.ClientKeeper, gs.ClientGenesis)
clientv2.InitGenesis(ctx, k.ClientV2Keeper, gs.ClientV2Genesis)
connection.InitGenesis(ctx, k.ConnectionKeeper, gs.ConnectionGenesis)
channel.InitGenesis(ctx, k.ChannelKeeper, gs.ChannelGenesis)
channelv2.InitGenesis(ctx, k.ChannelKeeperV2, gs.ChannelV2Genesis)
}
// ExportGenesis returns the ibc exported genesis.
func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState {
return &types.GenesisState{
ClientGenesis: client.ExportGenesis(ctx, k.ClientKeeper),
ClientV2Genesis: clientv2.ExportGenesis(ctx, k.ClientV2Keeper),
ConnectionGenesis: connection.ExportGenesis(ctx, k.ConnectionKeeper),
ChannelGenesis: channel.ExportGenesis(ctx, k.ChannelKeeper),
ChannelV2Genesis: channelv2.ExportGenesis(ctx, k.ChannelKeeperV2),
}
}