diff --git a/app/app.go b/app/app.go index 02997304f..b5bb349e6 100644 --- a/app/app.go +++ b/app/app.go @@ -63,6 +63,7 @@ import ( ibctransferkeeper "github.com/cosmos/ibc-go/v5/modules/apps/transfer/keeper" ibctransfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types" ibcclient "github.com/cosmos/ibc-go/v5/modules/core/02-client" + ibcclienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" porttypes "github.com/cosmos/ibc-go/v5/modules/core/05-port/types" ibchost "github.com/cosmos/ibc-go/v5/modules/core/24-host" ibckeeper "github.com/cosmos/ibc-go/v5/modules/core/keeper" @@ -96,11 +97,9 @@ import ( tibcnfttransfer "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer" tibcnfttransferkeeper "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/keeper" tibcnfttypes "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/types" - tibcclient "github.com/bianjieai/tibc-go/modules/tibc/core/02-client" - tibcclienttypes "github.com/bianjieai/tibc-go/modules/tibc/core/02-client/types" tibchost "github.com/bianjieai/tibc-go/modules/tibc/core/24-host" - tibcrouting "github.com/bianjieai/tibc-go/modules/tibc/core/26-routing" tibcroutingtypes "github.com/bianjieai/tibc-go/modules/tibc/core/26-routing/types" + tibccli "github.com/bianjieai/tibc-go/modules/tibc/core/client/cli" tibckeeper "github.com/bianjieai/tibc-go/modules/tibc/core/keeper" srvflags "github.com/evmos/ethermint/server/flags" @@ -525,9 +524,8 @@ func NewIrisApp( AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). - AddRoute(tibcclienttypes.RouterKey, tibcclient.NewClientProposalHandler(app.TIBCKeeper.ClientKeeper)). - AddRoute(tibcroutingtypes.RouterKey, tibcrouting.NewSetRoutingProposalHandler(app.TIBCKeeper.RoutingKeeper)). + AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). + AddRoute(tibchost.RouterKey, tibccli.NewProposalHandler(app.TIBCKeeper)). AddRoute(farmtypes.RouterKey, farm.NewCommunityPoolCreateFarmProposalHandler(app.FarmKeeper)) govConfig := govtypes.DefaultConfig() diff --git a/app/modules.go b/app/modules.go index ff8fb684b..a873ff500 100644 --- a/app/modules.go +++ b/app/modules.go @@ -70,9 +70,8 @@ import ( tibcnfttransfer "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer" tibcnfttypes "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/types" tibc "github.com/bianjieai/tibc-go/modules/tibc/core" - tibcclient "github.com/bianjieai/tibc-go/modules/tibc/core/02-client" tibchost "github.com/bianjieai/tibc-go/modules/tibc/core/24-host" - tibcrouting "github.com/bianjieai/tibc-go/modules/tibc/core/26-routing" + tibccli "github.com/bianjieai/tibc-go/modules/tibc/core/client/cli" "github.com/evmos/ethermint/x/evm" evmtypes "github.com/evmos/ethermint/x/evm/types" @@ -88,6 +87,15 @@ import ( ) var ( + legacyProposalHandlers = []govclient.ProposalHandler{ + paramsclient.ProposalHandler, + distrclient.ProposalHandler, + upgradeclient.LegacyProposalHandler, + upgradeclient.LegacyCancelProposalHandler, + ibcclientclient.UpdateClientProposalHandler, + ibcclientclient.UpgradeProposalHandler, + } + // ModuleBasics defines the module BasicManager is in charge of setting up basic, // non-dependant module elements, such as codec registration // and genesis verification. @@ -101,18 +109,7 @@ var ( mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( - []govclient.ProposalHandler{ - paramsclient.ProposalHandler, - distrclient.ProposalHandler, - upgradeclient.LegacyProposalHandler, - upgradeclient.LegacyCancelProposalHandler, - ibcclientclient.UpdateClientProposalHandler, - ibcclientclient.UpgradeProposalHandler, - tibcclient.CreateClientProposalHandler, - tibcclient.UpgradeClientProposalHandler, - tibcclient.RegisterRelayerProposalHandler, - tibcrouting.SetRoutingRulesProposalHandler, - }, + append(legacyProposalHandlers, tibccli.GovHandlers...), ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, diff --git a/go.mod b/go.mod index fdb45a98e..cd84e7560 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( cosmossdk.io/math v1.0.0-beta.4 - github.com/bianjieai/tibc-go v0.4.3-rc1 + github.com/bianjieai/tibc-go v0.4.3-rc1.0.20230407110346-39868b8fc901 github.com/cosmos/cosmos-sdk v0.46.9 github.com/cosmos/ibc-go/v5 v5.2.0 github.com/evmos/ethermint v0.20.0 diff --git a/go.sum b/go.sum index 7d793927d..58ce0829f 100644 --- a/go.sum +++ b/go.sum @@ -138,8 +138,8 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bianjieai/tibc-go v0.4.3-rc1 h1:4CxDwdCcknnYhSZ6IkRkqxKk9vDgc/s70IE/xywrrlY= -github.com/bianjieai/tibc-go v0.4.3-rc1/go.mod h1:G4U1RRB4uu9oi5jITFPIzpBpP45MBZxD5ya9wpZrkIw= +github.com/bianjieai/tibc-go v0.4.3-rc1.0.20230407110346-39868b8fc901 h1:1ETLCD2k45uop9AlkLJPOygF8ukFJQyxPPBsOzMe7lM= +github.com/bianjieai/tibc-go v0.4.3-rc1.0.20230407110346-39868b8fc901/go.mod h1:G4U1RRB4uu9oi5jITFPIzpBpP45MBZxD5ya9wpZrkIw= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= diff --git a/simapp/app.go b/simapp/app.go index b2f2e33a3..c50d630d4 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -80,10 +80,11 @@ import ( ibctransfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types" ibc "github.com/cosmos/ibc-go/v5/modules/core" ibcclient "github.com/cosmos/ibc-go/v5/modules/core/02-client" + ibcclientclient "github.com/cosmos/ibc-go/v5/modules/core/02-client/client" + ibcclienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" porttypes "github.com/cosmos/ibc-go/v5/modules/core/05-port/types" ibchost "github.com/cosmos/ibc-go/v5/modules/core/24-host" ibckeeper "github.com/cosmos/ibc-go/v5/modules/core/keeper" - "github.com/irisnet/irismod/modules/token" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" "github.com/irisnet/irismod/modules/coinswap" @@ -127,6 +128,7 @@ import ( "github.com/irisnet/irismod/modules/farm" farmkeeper "github.com/irisnet/irismod/modules/farm/keeper" farmtypes "github.com/irisnet/irismod/modules/farm/types" + "github.com/irisnet/irismod/modules/token" tibcmttransfer "github.com/bianjieai/tibc-go/modules/tibc/apps/mt_transfer" tibcmttransferkeeper "github.com/bianjieai/tibc-go/modules/tibc/apps/mt_transfer/keeper" @@ -135,11 +137,9 @@ import ( tibcnfttransferkeeper "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/keeper" tibcnfttypes "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/types" tibc "github.com/bianjieai/tibc-go/modules/tibc/core" - tibcclient "github.com/bianjieai/tibc-go/modules/tibc/core/02-client" - tibcclienttypes "github.com/bianjieai/tibc-go/modules/tibc/core/02-client/types" tibchost "github.com/bianjieai/tibc-go/modules/tibc/core/24-host" - tibcrouting "github.com/bianjieai/tibc-go/modules/tibc/core/26-routing" tibcroutingtypes "github.com/bianjieai/tibc-go/modules/tibc/core/26-routing/types" + tibccli "github.com/bianjieai/tibc-go/modules/tibc/core/client/cli" tibckeeper "github.com/bianjieai/tibc-go/modules/tibc/core/keeper" ) @@ -154,6 +154,15 @@ var ( // overwite sdk reDnmString reDnmString = `[a-zA-Z][a-zA-Z0-9/-]{2,127}` + legacyProposalHandlers = []govclient.ProposalHandler{ + paramsclient.ProposalHandler, + distrclient.ProposalHandler, + upgradeclient.LegacyProposalHandler, + upgradeclient.LegacyCancelProposalHandler, + ibcclientclient.UpdateClientProposalHandler, + ibcclientclient.UpgradeProposalHandler, + } + // ModuleBasics defines the module BasicManager is in charge of setting up basic, // non-dependant module elements, such as codec registration // and genesis verification. @@ -167,16 +176,7 @@ var ( mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( - []govclient.ProposalHandler{ - paramsclient.ProposalHandler, - distrclient.ProposalHandler, - upgradeclient.LegacyProposalHandler, - upgradeclient.LegacyCancelProposalHandler, - tibcclient.CreateClientProposalHandler, - tibcclient.UpgradeClientProposalHandler, - tibcclient.RegisterRelayerProposalHandler, - tibcrouting.SetRoutingRulesProposalHandler, - }, + append(legacyProposalHandlers, tibccli.GovHandlers...), ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, @@ -649,9 +649,8 @@ func NewSimApp( AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). - AddRoute(tibcclienttypes.RouterKey, tibcclient.NewClientProposalHandler(app.TIBCKeeper.ClientKeeper)). - AddRoute(tibcroutingtypes.RouterKey, tibcrouting.NewSetRoutingProposalHandler(app.TIBCKeeper.RoutingKeeper)). + AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). + AddRoute(tibchost.RouterKey, tibccli.NewProposalHandler(app.TIBCKeeper)). AddRoute(farmtypes.RouterKey, farm.NewCommunityPoolCreateFarmProposalHandler(app.FarmKeeper)) govConfig := govtypes.DefaultConfig()