Skip to content

Commit 993b918

Browse files
mergify[bot]crodriguezvega
andauthoredNov 15, 2022
docs: fix migration/docs for ICA controller middleware (#2737) (#2762)
* update docs/migration with the change to middleware for ICA controller * improve variable naming * alignment Co-authored-by: Carlos Rodriguez <[email protected]> (cherry picked from commit 1b7745f) Co-authored-by: Carlos Rodriguez <[email protected]>
1 parent 032b7b3 commit 993b918

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
@@ -96,14 +96,15 @@ icaAuthModule := icaauth.NewAppModule(appCodec, app.ICAAuthKeeper)
9696
// ICA auth IBC Module
9797
icaAuthIBCModule := icaauth.NewIBCModule(app.ICAAuthKeeper)
9898

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

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

108109
...
109110

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

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

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

‎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)
Please sign in to comment.