@@ -103,9 +103,9 @@ import (
103103
104104	"github.com/CosmWasm/wasmd/x/wasm" 
105105	wasmclient "github.com/CosmWasm/wasmd/x/wasm/client" 
106+ 	wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" 
106107
107108	ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts" 
108- 	icacontrollertypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types" 
109109	icahost "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host" 
110110	icahostkeeper "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/keeper" 
111111	icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types" 
@@ -207,7 +207,7 @@ var (
207207// KitoolsApp extends an ABCI application, but with most of its parameters exported. 
208208// They are exported for convenience in creating helper functions, as object 
209209// capabilities aren't needed for testing. 
210- type  KitoolsApp  struct  { //  nolint: golint 
210+ type  KitoolsApp  struct  { //nolint: golint 
211211	* baseapp.BaseApp 
212212	legacyAmino        * codec.LegacyAmino 
213213	appCodec           codec.Codec 
@@ -697,47 +697,22 @@ func NewKitoolsApp(
697697	app .UpgradeKeeper .SetUpgradeHandler (
698698		upgradeName ,
699699		func (ctx  sdk.Context , _  upgradetypes.Plan , fromVM  module.VersionMap ) (module.VersionMap , error ) {
700+ 			ctx .Logger ().Info ("start to run module migrations..." )
701+ 
702+ 			params  :=  app .WasmKeeper .GetParams (ctx )
703+ 
704+ 			uploadAddresses  :=  []string {"ki12u4jtcczpg2m3nt50muh3srte7zed77qsfyng4" , "ki12qmzh8ewtp90qxtsrvrgl52qydauerhkl8f6u2" }
700705
701- 			ctx .Logger ().Info ("Initialize ICA" )
702- 			fromVM [icatypes .ModuleName ] =  icaModule .ConsensusVersion ()
703- 
704- 			// create ICS27 Controller submodule params 
705- 			controllerParams  :=  icacontrollertypes.Params {}
706- 
707- 			// create ICS27 Host submodule params 
708- 			hostParams  :=  icahosttypes.Params {
709- 				HostEnabled : true ,
710- 				AllowMessages : []string {
711- 					authzMsgExec ,
712- 					authzMsgGrant ,
713- 					authzMsgRevoke ,
714- 					bankMsgSend ,
715- 					bankMsgMultiSend ,
716- 					distrMsgSetWithdrawAddr ,
717- 					distrMsgWithdrawValidatorCommission ,
718- 					distrMsgFundCommunityPool ,
719- 					distrMsgWithdrawDelegatorReward ,
720- 					feegrantMsgGrantAllowance ,
721- 					feegrantMsgRevokeAllowance ,
722- 					govMsgVoteWeighted ,
723- 					govMsgSubmitProposal ,
724- 					govMsgDeposit ,
725- 					govMsgVote ,
726- 					stakingMsgEditValidator ,
727- 					stakingMsgDelegate ,
728- 					stakingMsgUndelegate ,
729- 					stakingMsgBeginRedelegate ,
730- 					stakingMsgCreateValidator ,
731- 					vestingMsgCreateVestingAccount ,
732- 					transferMsgTransfer ,
733- 					wasmMsgExecuteContract ,
734- 				},
706+ 			if  address .Bech32MainPrefix  ==  "tki"  {
707+ 				uploadAddresses  =  []string {"tki1vexd57shjr2rax74ym5g8nqwq7ve04n5gz0kaj" , "tki1mxag493xqx5rwqug950n0uer3kayjnw3ctxpxu" }
735708			}
736709
737- 			// initialize ICS27 module 
738- 			icaModule .InitModule (ctx , controllerParams , hostParams )
710+ 			params .CodeUploadAccess  =  wasmtypes.AccessConfig {
711+ 				Permission : wasmtypes .AccessTypeAnyOfAddresses ,
712+ 				Addresses :  uploadAddresses ,
713+ 			}
739714
740- 			ctx . Logger (). Info ( "start to run module migrations..." )
715+ 			app . WasmKeeper . SetParams ( ctx ,  params )
741716
742717			return  app .mm .RunMigrations (ctx , app .configurator , fromVM )
743718		},
@@ -749,9 +724,7 @@ func NewKitoolsApp(
749724	}
750725
751726	if  upgradeInfo .Name  ==  upgradeName  &&  ! app .UpgradeKeeper .IsSkipHeight (upgradeInfo .Height ) {
752- 		storeUpgrades  :=  store.StoreUpgrades {
753- 			Added : []string {icahosttypes .StoreKey },
754- 		}
727+ 		storeUpgrades  :=  store.StoreUpgrades {}
755728
756729		// configure store loader that checks if version == upgradeHeight and applies store upgrades 
757730		app .SetStoreLoader (upgradetypes .UpgradeStoreLoader (upgradeInfo .Height , & storeUpgrades ))
0 commit comments