Skip to content

Commit 1b7745f

Browse files
docs: fix migration/docs for ICA controller middleware (#2737)
* update docs/migration with the change to middleware for ICA controller * improve variable naming * alignment Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>
1 parent 510afbe commit 1b7745f

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

docs/apps/interchain-accounts/integration.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,15 @@ icaAuthModule := icaauth.NewAppModule(appCodec, app.ICAAuthKeeper)
9797
// ICA auth IBC Module
9898
icaAuthIBCModule := icaauth.NewIBCModule(app.ICAAuthKeeper)
9999

100-
// Create host and controller IBC Modules as desired
101-
icaControllerIBCModule := icacontroller.NewIBCModule(app.ICAControllerKeeper, icaAuthIBCModule)
100+
// Create controller IBC application stack and host IBC module as desired
101+
icaControllerStack := icacontroller.NewIBCMiddleware(icaAuthIBCModule, app.ICAControllerKeeper)
102102
icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper)
103103

104104
// Register host and authentication routes
105-
ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule).
106-
AddRoute(icahosttypes.SubModuleName, icaHostIBCModule).
107-
AddRoute(icaauthtypes.ModuleName, icaControllerIBCModule) // Note, the authentication module is routed to the top level of the middleware stack
105+
ibcRouter.
106+
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
107+
AddRoute(icahosttypes.SubModuleName, icaHostIBCModule).
108+
AddRoute(icaauthtypes.ModuleName, icaControllerStack) // Note, the authentication module is routed to the top level of the middleware stack
108109

109110
...
110111

@@ -178,10 +179,11 @@ app.ICAAuthKeeper = icaauthkeeper.NewKeeper(appCodec, keys[icaauthtypes.StoreKey
178179
icaAuthModule := icaauth.NewAppModule(appCodec, app.ICAAuthKeeper)
179180
icaAuthIBCModule := icaauth.NewIBCModule(app.ICAAuthKeeper)
180181

181-
// Create controller IBC Module
182-
icaControllerIBCModule := icacontroller.NewIBCModule(app.ICAControllerKeeper, icaAuthIBCModule)
182+
// Create controller IBC application stack
183+
icaControllerStack := icacontroller.NewIBCMiddleware(icaAuthIBCModule, app.ICAControllerKeeper)
183184

184185
// Register controller and authentication routes
185-
ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule)
186-
ibcRouter.AddRoute(icaauthtypes.ModuleName, icaControllerIBCModule) // Note, the authentication module is routed to the top level of the middleware stack
186+
ibcRouter.
187+
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
188+
AddRoute(icaauthtypes.ModuleName, icaControllerStack) // Note, the authentication module is routed to the top level of the middleware stack
187189
```

docs/middleware/ics29-fee/integration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ For Cosmos SDK chains this setup is done via the `app/app.go` file, where module
1616

1717
## Example integration of the Fee Middleware module
1818

19-
```
19+
```go
2020
// app.go
2121

2222
// Register the AppModule for the fee middleware module

docs/migrations/v3-to-v4.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,18 @@ No genesis or in-place migrations required when upgrading from v1 or v2 of ibc-g
1818

1919
## Chains
2020

21-
### Fee Middleware
21+
### ICS27 - Interchain Accounts
22+
23+
The controller submodule implements now the 05-port `Middleware` interface instead of the 05-port `IBCModule` interface. Chains that integrate the controller submodule, need to create it with the `NewIBCMiddleware` constructor function. For example:
24+
25+
```diff
26+
- icacontroller.NewIBCModule(app.ICAControllerKeeper, icaAuthIBCModule)
27+
+ icacontroller.NewIBCMiddleware(icaAuthIBCModule, app.ICAControllerKeeper)
28+
```
29+
30+
where `icaAuthIBCModule` is the Interchain Accounts authentication IBC Module.
31+
32+
### ICS29 - Fee Middleware
2233

2334
The Fee Middleware module, as the name suggests, plays the role of an IBC middleware and as such must be configured by chain developers to route and handle IBC messages correctly.
2435

0 commit comments

Comments
 (0)