From 7267e0738a427e65978e1f94e8fd7c7828ea04a7 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Mon, 30 Oct 2023 11:32:11 +0200 Subject: [PATCH 1/3] Register message service descriptor (#4969) --- modules/apps/27-interchain-accounts/host/types/codec.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/apps/27-interchain-accounts/host/types/codec.go b/modules/apps/27-interchain-accounts/host/types/codec.go index ef94e88ae67..8752640e767 100644 --- a/modules/apps/27-interchain-accounts/host/types/codec.go +++ b/modules/apps/27-interchain-accounts/host/types/codec.go @@ -3,6 +3,7 @@ package types import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" ) // RegisterInterfaces registers the interchain accounts host message types using the provided InterfaceRegistry @@ -11,4 +12,6 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { (*sdk.Msg)(nil), &MsgUpdateParams{}, ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } From aef6a3f00a31415cc4a086df4378f5139a8cb357 Mon Sep 17 00:00:00 2001 From: srdtrk <59252793+srdtrk@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:41:04 +0300 Subject: [PATCH 2/3] docs: fee middleware tutorial improvements (#4979) * docs: removed duplicate code snippet * docs: consistent use of yaml vs yml * docs: using 'auto_register_counterparty_payee' * docs: added Fee Middleware docs to prereqs * docs: fixed broken link * docs: improved fee tutorial * imp: review item --- docs/tutorials/01-fee/01-intro.md | 4 ++-- docs/tutorials/01-fee/02-setup-env.md | 8 +++++++- docs/tutorials/01-fee/04-wire-feeibc-mod.md | 8 -------- docs/tutorials/01-fee/07-test-app.md | 16 +++++----------- 4 files changed, 14 insertions(+), 22 deletions(-) diff --git a/docs/tutorials/01-fee/01-intro.md b/docs/tutorials/01-fee/01-intro.md index cbf092b0013..f3bd825f6a9 100644 --- a/docs/tutorials/01-fee/01-intro.md +++ b/docs/tutorials/01-fee/01-intro.md @@ -16,10 +16,10 @@ This is a tutorial for wiring up the ICS-29 Fee Middleware to a Cosmos SDK block -- Basic Knowledge of [Go](https://golang.org/doc/tutorial/getting-started) -- Basic Knowledge of [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) +- Basic Knowledge of [TypeScript](https://www.typescriptlang.org/) - Basic Knowledge of Cosmos SDK - If you are new to Cosmos SDK, we recommend you to go through the first two categories of the [Developer Portal](https://tutorials.cosmos.network/academy/1-what-is-cosmos/) +- Basic Knowledge of [the Fee Middleware module](https://ibc.cosmos.network/main/middleware/ics29-fee/overview) diff --git a/docs/tutorials/01-fee/02-setup-env.md b/docs/tutorials/01-fee/02-setup-env.md index 23f9d490361..c6bd1bed75f 100644 --- a/docs/tutorials/01-fee/02-setup-env.md +++ b/docs/tutorials/01-fee/02-setup-env.md @@ -48,7 +48,13 @@ go version ## Hermes -Install Hermes relayer version `v1.6.0` via cargo following the instructions on the [Hermes website](https://hermes.informal.systems/quick-start/installation.html#install-via-cargo). Test if Hermes is installed by running. +Install Hermes relayer version `v1.6.0` via cargo following the instructions on the [Hermes website](https://hermes.informal.systems/quick-start/installation.html#install-via-cargo) or by using the command below. + +```bash +cargo install ibc-relayer-cli --version 1.6.0 --bin hermes --locked +``` + +Test if Hermes is installed by running the following command: ```bash hermes version diff --git a/docs/tutorials/01-fee/04-wire-feeibc-mod.md b/docs/tutorials/01-fee/04-wire-feeibc-mod.md index 15d427c62bd..0329fecd1a8 100644 --- a/docs/tutorials/01-fee/04-wire-feeibc-mod.md +++ b/docs/tutorials/01-fee/04-wire-feeibc-mod.md @@ -164,14 +164,6 @@ Next, we need to add the fee middleware to the `SetOrderBeginBlockers`, `SetOrde consensusparamtypes.ModuleName, // this line is used by starport scaffolding # stargate/app/endBlockers ) - app.mm.SetOrderEndBlockers( - // ... other modules - vestingtypes.ModuleName, - consensusparamtypes.ModuleName, - // plus-diff-line -+ ibcfeetypes.ModuleName, - // this line is used by starport scaffolding # stargate/app/endBlockers - ) // NOTE: The genutils module must occur after staking so that pools are // properly initialized with tokens from genesis accounts. diff --git a/docs/tutorials/01-fee/07-test-app.md b/docs/tutorials/01-fee/07-test-app.md index 4738341ee00..78aadfdc8cd 100644 --- a/docs/tutorials/01-fee/07-test-app.md +++ b/docs/tutorials/01-fee/07-test-app.md @@ -27,11 +27,11 @@ You can find the React app we created in the previous section [here](https://git Ignite supports running multiple chains locally with different configs. The source chain will be called earth and the destination chain will be called mars. Add the following config files to the root of the project: -```yaml reference title="earth.yaml" +```yaml reference title="earth.yml" https://github.com/srdtrk/cosmoverse2023-ibc-fee-demo/blob/96cb63bf2e60b4613a89841416066551dd666c0d/earth.yml ``` -```yaml reference title="mars.yaml" +```yaml reference title="mars.yml" https://github.com/srdtrk/cosmoverse2023-ibc-fee-demo/blob/96cb63bf2e60b4613a89841416066551dd666c0d/mars.yml ``` @@ -50,7 +50,7 @@ ignite chain serve -c mars.yml --reset-once We first need to create a relayer configuration file. Add the following file to the root of the project: ```toml reference title="hermes/config.toml" -https://github.com/srdtrk/cosmoverse2023-ibc-fee-demo/blob/960d8b7e148cbe2207c3a743bac7c0985a5b653a/hermes/config.toml +https://github.com/srdtrk/cosmoverse2023-ibc-fee-demo/blob/0186b9ee979c288efbe3fe5fd071169d9dbcf91e/hermes/config.toml ``` We can move this file to the `~/.hermes` directory to avoid having to specify the path to the config file every time we run the relayer: @@ -105,15 +105,9 @@ hermes create channel --channel-version '{"fee_version":"ics29-1","app_version": ``` This will create an incentivized IBC transfer channel between the two chains with the channel id `channel-0`, and channel version `{"fee_version":"ics29-1","app_version":"ics20-1"}`. -Next recall that the Fee Middleware only pays fees on the source chain. That's why we should register `damian` and `charlie` as each other's counterparty on both chains. - -```bash title="Terminal 4" -hermes fee register-counterparty-payee --chain mars --channel channel-0 --port transfer --counterparty-payee cosmos1vapwvcsr0m32ptal6z6g9hjctywrw4yzyf6y6v -``` -```bash title="Terminal 4" -hermes fee register-counterparty-payee --chain earth --channel channel-0 --port transfer --counterparty-payee cosmos1uu38gkyed0dte5f9xk20p8wcppulsjt90s7f8h -``` +Next recall that the Fee Middleware only pays fees on the source chain. That's why we should register `damian` and `charlie` as each other's counterparty on both chains. +Luckily, the relayer does this for us under the hood because we've enabled the `auto_register_counterparty_payee` option in the config file. Now we can run the relayer with the following command: From 7cf30ef6a01b68e5bb8bbad473245cd65ef2de24 Mon Sep 17 00:00:00 2001 From: Muku <44918265+muku314115@users.noreply.github.com> Date: Mon, 30 Oct 2023 16:33:32 +0530 Subject: [PATCH 3/3] (mod/capability) Use AppModule directly in favour of AppModuleBasic in mod/capability (#4982) * removing appmodulebasic and all nil/unneeded functions * lint * test file changes * lint --------- Co-authored-by: Damian Nolan --- modules/capability/capability_test.go | 2 +- modules/capability/keeper/keeper_test.go | 2 +- modules/capability/module.go | 15 +-------------- modules/capability/simulation/decoder_test.go | 2 +- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/modules/capability/capability_test.go b/modules/capability/capability_test.go index e725fdf1cb2..77c7170401d 100644 --- a/modules/capability/capability_test.go +++ b/modules/capability/capability_test.go @@ -39,7 +39,7 @@ type CapabilityTestSuite struct { } func (suite *CapabilityTestSuite) SetupTest() { - encodingCfg := moduletestutil.MakeTestEncodingConfig(capability.AppModuleBasic{}) + encodingCfg := moduletestutil.MakeTestEncodingConfig(capability.AppModule{}) suite.cdc = encodingCfg.Codec suite.storeKey = storetypes.NewKVStoreKey(types.StoreKey) diff --git a/modules/capability/keeper/keeper_test.go b/modules/capability/keeper/keeper_test.go index 9fada176f38..12ac910a7c2 100644 --- a/modules/capability/keeper/keeper_test.go +++ b/modules/capability/keeper/keeper_test.go @@ -33,7 +33,7 @@ func (suite *KeeperTestSuite) SetupTest() { key := storetypes.NewKVStoreKey(types.StoreKey) testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test")) suite.ctx = testCtx.Ctx - encCfg := moduletestutil.MakeTestEncodingConfig(capability.AppModuleBasic{}) + encCfg := moduletestutil.MakeTestEncodingConfig(capability.AppModule{}) suite.keeper = keeper.NewKeeper(encCfg.Codec, key, key) } diff --git a/modules/capability/module.go b/modules/capability/module.go index ab9bc97a9db..355ec428f65 100644 --- a/modules/capability/module.go +++ b/modules/capability/module.go @@ -7,7 +7,6 @@ import ( "time" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" "cosmossdk.io/core/appmodule" @@ -26,7 +25,6 @@ import ( var ( _ module.AppModule = (*AppModule)(nil) - _ module.AppModuleBasic = (*AppModuleBasic)(nil) _ module.AppModuleSimulation = (*AppModule)(nil) _ module.HasName = (*AppModule)(nil) _ module.HasConsensusVersion = (*AppModule)(nil) @@ -48,11 +46,6 @@ func NewAppModuleBasic(cdc codec.Codec) AppModuleBasic { return AppModuleBasic{cdc: cdc} } -// Name returns the capability module's name. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - // RegisterLegacyAminoCodec does nothing. Capability does not support amino. func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} @@ -77,12 +70,6 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *gwruntime.ServeMux) { } -// GetTxCmd returns the capability module's root tx command. -func (AppModuleBasic) GetTxCmd() *cobra.Command { return nil } - -// GetQueryCmd returns the capability module's root query command. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { return nil } - // ---------------------------------------------------------------------------- // AppModule // ---------------------------------------------------------------------------- @@ -112,7 +99,7 @@ func (AppModule) IsAppModule() {} // Name returns the capability module's name. func (am AppModule) Name() string { - return am.AppModuleBasic.Name() + return types.ModuleName } // InitGenesis performs the capability module's genesis initialization It returns diff --git a/modules/capability/simulation/decoder_test.go b/modules/capability/simulation/decoder_test.go index c47ce7dc9bc..b5115e66139 100644 --- a/modules/capability/simulation/decoder_test.go +++ b/modules/capability/simulation/decoder_test.go @@ -16,7 +16,7 @@ import ( ) func TestDecodeStore(t *testing.T) { - encodingCfg := moduletestutil.MakeTestEncodingConfig(capability.AppModuleBasic{}) + encodingCfg := moduletestutil.MakeTestEncodingConfig(capability.AppModule{}) dec := simulation.NewDecodeStore(encodingCfg.Codec) capOwners := types.CapabilityOwners{