Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasmd 30 + ibc v4 + IBCFees #387

Merged
merged 24 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v3/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"

paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"

Expand Down
6 changes: 3 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import (
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
ibcclientclient "github.com/cosmos/ibc-go/v3/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
ibcchanneltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types"
ibcclientclient "github.com/cosmos/ibc-go/v4/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
"github.com/ignite-hq/cli/ignite/pkg/openapiconsole"
"github.com/spf13/cast"
abci "github.com/tendermint/tendermint/abci/types"
Expand Down
2 changes: 1 addition & 1 deletion app/decorators/msg_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

sdk "github.com/cosmos/cosmos-sdk/types"
ibcchanneltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" // TODO: Switch to v3
ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
)

// MsgFilterDecorator defines an AnteHandler decorator for the v9 upgrade that
Expand Down
79 changes: 60 additions & 19 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,29 @@ import (
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
transfer "github.com/cosmos/ibc-go/v3/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibcclient "github.com/cosmos/ibc-go/v3/modules/core/02-client"
ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
ibcfee "github.com/cosmos/ibc-go/v4/modules/apps/29-fee"
ibcfeekeeper "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/keeper"
ibcfeetypes "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"
transfer "github.com/cosmos/ibc-go/v4/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
ibcclient "github.com/cosmos/ibc-go/v4/modules/core/02-client"
ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
ibcconnectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"
porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"

"github.com/CosmWasm/token-factory/x/tokenfactory/bindings"
tokenfactorykeeper "github.com/CosmWasm/token-factory/x/tokenfactory/keeper"
tokenfactorytypes "github.com/CosmWasm/token-factory/x/tokenfactory/types"

icahost "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host"
icahostkeeper "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/keeper"
icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types"
icahost "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host"
icahostkeeper "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/keeper"
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"

feesharekeeper "github.com/CosmosContracts/juno/v12/x/feeshare/keeper"
feesharetypes "github.com/CosmosContracts/juno/v12/x/feeshare/types"
Expand All @@ -82,6 +87,7 @@ type AppKeepers struct {
UpgradeKeeper upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
IBCFeeKeeper ibcfeekeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
AuthzKeeper authzkeeper.Keeper
Expand Down Expand Up @@ -217,6 +223,16 @@ func NewAppKeepers(
scopedIBCKeeper,
)

appKeepers.IBCFeeKeeper = ibcfeekeeper.NewKeeper(
appCodec, appKeepers.keys[ibcfeetypes.StoreKey],
appKeepers.GetSubspace(ibcfeetypes.ModuleName), // this isn't even used in the keeper but is required?
appKeepers.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware
appKeepers.IBCKeeper.ChannelKeeper,
&appKeepers.IBCKeeper.PortKeeper,
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
)

appKeepers.FeeGrantKeeper = feegrantkeeper.NewKeeper(
appCodec,
appKeepers.keys[feegrant.StoreKey],
Expand Down Expand Up @@ -249,8 +265,6 @@ func NewAppKeepers(
scopedTransferKeeper,
)

transferIBCModule := transfer.NewIBCModule(appKeepers.TransferKeeper)

appKeepers.ICAHostKeeper = icahostkeeper.NewKeeper(
appCodec,
appKeepers.keys[icahosttypes.StoreKey],
Expand All @@ -261,7 +275,6 @@ func NewAppKeepers(
scopedICAHostKeeper,
bApp.MsgServiceRouter(),
)
icaHostIBCModule := icahost.NewIBCModule(appKeepers.ICAHostKeeper)

// Create evidence Keeper for to register the IBC light client misbehaviour evidence route
evidenceKeeper := evidencekeeper.NewKeeper(
Expand Down Expand Up @@ -290,6 +303,19 @@ func NewAppKeepers(
// if we want to allow any custom callbacks
supportedFeatures := "iterator,staking,stargate,cosmwasm_1_1,token_factory"
wasmOpts = append(bindings.RegisterCustomPlugins(&appKeepers.BankKeeper, &appKeepers.TokenFactoryKeeper), wasmOpts...)

// Stargate Queries
accepted := wasmkeeper.AcceptedStargateQueries{
"/ibc.core.client.v1.Query/ClientState": &ibcclienttypes.QueryClientStateResponse{},
"/ibc.core.client.v1.Query/ConsensusState": &ibcclienttypes.QueryConsensusStateResponse{},
"/ibc.core.connection.v1.Query/Connection": &ibcconnectiontypes.QueryConnectionResponse{},
}
faddat marked this conversation as resolved.
Show resolved Hide resolved
querierOpts := wasmkeeper.WithQueryPlugins(
&wasmkeeper.QueryPlugins{
Stargate: wasmkeeper.AcceptListStargateQuerier(accepted, bApp.GRPCQueryRouter(), appCodec),
})
wasmOpts = append(wasmOpts, querierOpts)

appKeepers.WasmKeeper = wasm.NewKeeper(
appCodec,
appKeepers.keys[wasm.StoreKey],
Expand Down Expand Up @@ -320,18 +346,33 @@ func NewAppKeepers(
authtypes.FeeCollectorName,
)

ibcRouter := porttypes.NewRouter()

// register wasm gov proposal types
// The gov proposal types can be individually enabled
if len(enabledProposals) != 0 {
govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(appKeepers.WasmKeeper, enabledProposals))
}

// Create Transfer Stack
var transferStack porttypes.IBCModule
transferStack = transfer.NewIBCModule(appKeepers.TransferKeeper)
transferStack = ibcfee.NewIBCMiddleware(transferStack, appKeepers.IBCFeeKeeper)

// RecvPacket, message that originates from core IBC and goes down to app, the flow is:
// channel.RecvPacket -> fee.OnRecvPacket -> icaHost.OnRecvPacket
var icaHostStack porttypes.IBCModule
icaHostStack = icahost.NewIBCModule(appKeepers.ICAHostKeeper)
icaHostStack = ibcfee.NewIBCMiddleware(icaHostStack, appKeepers.IBCFeeKeeper)

// Create fee enabled wasm ibc Stack
var wasmStack porttypes.IBCModule
wasmStack = wasm.NewIBCHandler(appKeepers.WasmKeeper, appKeepers.IBCKeeper.ChannelKeeper, appKeepers.IBCFeeKeeper)
wasmStack = ibcfee.NewIBCMiddleware(wasmStack, appKeepers.IBCFeeKeeper)

// Create static IBC router, add transfer route, then set and seal it
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferIBCModule).
AddRoute(wasm.ModuleName, wasm.NewIBCHandler(appKeepers.WasmKeeper, appKeepers.IBCKeeper.ChannelKeeper)).
AddRoute(icahosttypes.SubModuleName, icaHostIBCModule)
ibcRouter := porttypes.NewRouter().
AddRoute(ibctransfertypes.ModuleName, transferStack).
AddRoute(wasm.ModuleName, wasmStack).
AddRoute(icahosttypes.SubModuleName, icaHostStack)
appKeepers.IBCKeeper.SetRouter(ibcRouter)

appKeepers.GovKeeper = govkeeper.NewKeeper(
Expand Down
9 changes: 5 additions & 4 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host"
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
ibcfeetypes "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
)

func (appKeepers *AppKeepers) GenerateKeys() {
Expand All @@ -30,7 +31,7 @@ func (appKeepers *AppKeepers) GenerateKeys() {
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey,
evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey,
authzkeeper.StoreKey, feegrant.StoreKey, icahosttypes.StoreKey,
authzkeeper.StoreKey, feegrant.StoreKey, icahosttypes.StoreKey, ibcfeetypes.StoreKey,
tokenfactorytypes.StoreKey, feesharetypes.StoreKey, wasm.StoreKey,
)
appKeepers.tkeys = sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
Expand Down
21 changes: 15 additions & 6 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ import (
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/cosmos/gaia/v8/x/globalfee"
ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts"
icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"
transfer "github.com/cosmos/ibc-go/v3/modules/apps/transfer"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v3/modules/core"
ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host"
ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts"
icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"
ibcfee "github.com/cosmos/ibc-go/v4/modules/apps/29-fee"
ibcfeetypes "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"
transfer "github.com/cosmos/ibc-go/v4/modules/apps/transfer"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v4/modules/core"
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
)

// module account permissions
Expand All @@ -60,6 +62,7 @@ var maccPerms = map[string][]string{
govtypes.ModuleName: {authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
icatypes.ModuleName: nil,
ibcfeetypes.ModuleName: nil,
wasm.ModuleName: {authtypes.Burner},
tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner},
}
Expand All @@ -80,6 +83,7 @@ var ModuleBasics = module.NewBasicManager(
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
ibc.AppModuleBasic{},
ibcfee.AppModuleBasic{},
feegrantmodule.AppModuleBasic{},
upgrade.AppModuleBasic{},
evidence.AppModuleBasic{},
Expand Down Expand Up @@ -122,6 +126,7 @@ func appModules(
params.NewAppModule(app.ParamsKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
transfer.NewAppModule(app.TransferKeeper),
ibcfee.NewAppModule(app.IBCFeeKeeper),
ica.NewAppModule(nil, &app.ICAHostKeeper),
tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper),
globalfee.NewAppModule(app.GetSubspace(globalfee.ModuleName)),
Expand Down Expand Up @@ -156,6 +161,7 @@ func simulationModules(
ibc.NewAppModule(app.IBCKeeper),
transfer.NewAppModule(app.TransferKeeper),
feeshare.NewAppModule(app.FeeShareKeeper, app.AccountKeeper),
ibcfee.NewAppModule(app.IBCFeeKeeper),
}
}

Expand Down Expand Up @@ -183,6 +189,7 @@ func orderBeginBlockers() []string {
ibchost.ModuleName,
ibctransfertypes.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
tokenfactorytypes.ModuleName,
feesharetypes.ModuleName,
globalfee.ModuleName,
Expand Down Expand Up @@ -212,6 +219,7 @@ func orderEndBlockers() []string {
ibchost.ModuleName,
ibctransfertypes.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
tokenfactorytypes.ModuleName,
feesharetypes.ModuleName,
globalfee.ModuleName,
Expand Down Expand Up @@ -241,6 +249,7 @@ func orderInitBlockers() []string {
ibchost.ModuleName,
ibctransfertypes.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
tokenfactorytypes.ModuleName,
feesharetypes.ModuleName,
globalfee.ModuleName,
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v10/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package v10
import (
"github.com/CosmosContracts/juno/v12/app/upgrades"
store "github.com/cosmos/cosmos-sdk/store/types"
icacontrollertypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types"
icacontrollertypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
)

// UpgradeName defines the on-chain upgrade name for the Juno v10 upgrade.
Expand Down
5 changes: 2 additions & 3 deletions app/upgrades/v10/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
)

// CreateV10UpgradeHandler makes an upgrade handler for v10 of Juno
Expand All @@ -22,7 +22,6 @@ func CreateV10UpgradeHandler(
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {

// update ICA Host to catch missed msg
// enumerate all because it's easier to reason about
newIcaHostParams := icahosttypes.Params{
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v11/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package v11
import (
"github.com/CosmosContracts/juno/v12/app/upgrades"
store "github.com/cosmos/cosmos-sdk/store/types"
icacontrollertypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types"
icacontrollertypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
)

// UpgradeName defines the on-chain upgrade name for the Juno v11 upgrade.
Expand Down
5 changes: 2 additions & 3 deletions app/upgrades/v11/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
)

// CreateV11UpgradeHandler makes an upgrade handler for v11 of Juno
Expand All @@ -22,7 +22,6 @@ func CreateV11UpgradeHandler(
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {

// update ICA Host to add new messages available
// enumerate all because it's easier to reason about
newIcaHostParams := icahosttypes.Params{
Expand Down
3 changes: 2 additions & 1 deletion app/upgrades/v12/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
feesharetypes "github.com/CosmosContracts/juno/v12/x/feeshare/types"
store "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/gaia/v8/x/globalfee"
ibcfeetypes "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"
)

// UpgradeName defines the on-chain upgrade name for the Juno v12 upgrade.
Expand All @@ -15,6 +16,6 @@ var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateV12UpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{tokenfactorytypes.ModuleName, feesharetypes.ModuleName, globalfee.ModuleName},
Added: []string{tokenfactorytypes.ModuleName, feesharetypes.ModuleName, globalfee.ModuleName, ibcfeetypes.ModuleName},
},
}
9 changes: 8 additions & 1 deletion app/upgrades/v12/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
ibcfeetypes "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"
)

// CreateV12UpgradeHandler makes an upgrade handler for v12 of Juno
Expand All @@ -16,20 +17,26 @@ func CreateV12UpgradeHandler(
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
// transfer module consensus version has been bumped to 2
// the above is https://github.com/cosmos/ibc-go/blob/v5.1.0/docs/migrations/v3-to-v4.md
faddat marked this conversation as resolved.
Show resolved Hide resolved

// Set the creation fee for the token factory to cost 1 JUNO token
// TokenFactory
newTokenFactoryParams := tokenfactorytypes.Params{
DenomCreationFee: sdk.NewCoins(sdk.NewCoin("ujuno", sdk.NewInt(1000000))),
}
keepers.TokenFactoryKeeper.SetParams(ctx, newTokenFactoryParams)

// FeeShare
newFeeShareParams := feesharetypes.Params{
EnableFeeShare: true,
DeveloperShares: sdk.NewDecWithPrec(50, 2), // = 50%
AllowedDenoms: []string{"ujuno"},
}
keepers.FeeShareKeeper.SetParams(ctx, newFeeShareParams)

// IBCFee
vm[ibcfeetypes.ModuleName] = mm.Modules[ibcfeetypes.ModuleName].ConsensusVersion()

return mm.RunMigrations(ctx, cfg, vm)
}
}
6 changes: 3 additions & 3 deletions cmd/junod/cmd/genica.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/spf13/cobra"

icacontrollertypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"
icacontrollertypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand Down
Loading