@@ -19,9 +19,12 @@ import (
19
19
20
20
dbm "github.com/cosmos/cosmos-db"
21
21
"github.com/cosmos/gogoproto/proto"
22
+ ibcwasm "github.com/cosmos/ibc-go/modules/light-clients/08-wasm"
22
23
ibcwasmkeeper "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/keeper"
23
- ibctesting "github.com/cosmos/ibc-go/v8/testing"
24
- providertypes "github.com/cosmos/interchain-security/v6/x/ccv/provider/types"
24
+ ibcwasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"
25
+ ibctm "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint"
26
+ ibctesting "github.com/cosmos/ibc-go/v10/testing"
27
+ providertypes "github.com/cosmos/interchain-security/v7/x/ccv/provider/types"
25
28
26
29
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
27
30
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
@@ -63,7 +66,7 @@ import (
63
66
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
64
67
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
65
68
66
- wasm "github.com/CosmWasm/wasmd/x/wasm"
69
+ "github.com/CosmWasm/wasmd/x/wasm"
67
70
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
68
71
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
69
72
@@ -194,9 +197,18 @@ func NewGaiaApp(
194
197
wasmOpts ,
195
198
)
196
199
200
+ // Create IBC Tendermint Light Client Stack
201
+ clientKeeper := app .AppKeepers .IBCKeeper .ClientKeeper
202
+ tmLightClientModule := ibctm .NewLightClientModule (appCodec , clientKeeper .GetStoreProvider ())
203
+ clientKeeper .AddRoute (ibctm .ModuleName , & tmLightClientModule )
204
+
205
+ // Create WASM Light Client Stack
206
+ wasmLightClientModule := ibcwasm .NewLightClientModule (app .WasmClientKeeper , clientKeeper .GetStoreProvider ())
207
+ clientKeeper .AddRoute (ibcwasmtypes .ModuleName , & wasmLightClientModule )
208
+
197
209
// NOTE: Any module instantiated in the module manager that is later modified
198
210
// must be passed by reference here.
199
- app .mm = module .NewManager (appModules (app , appCodec , txConfig , skipGenesisInvariants )... )
211
+ app .mm = module .NewManager (appModules (app , appCodec , txConfig , skipGenesisInvariants , tmLightClientModule )... )
200
212
app .ModuleBasics = newBasicManagerFromManager (app )
201
213
202
214
enabledSignModes := append ([]sigtypes.SignMode (nil ), authtx .DefaultSignModes ... )
@@ -223,7 +235,6 @@ func NewGaiaApp(
223
235
// there is nothing left over in the validator fee pool, so as to keep the
224
236
// CanWithdrawInvariant invariant.
225
237
// NOTE: staking module is required if HistoricalEntries param > 0
226
- // NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC)
227
238
// Tell the app's module manager how to set the order of BeginBlockers, which are run at the beginning of every block.
228
239
app .mm .SetOrderBeginBlockers (orderBeginBlockers ()... )
229
240
@@ -232,9 +243,6 @@ func NewGaiaApp(
232
243
// NOTE: The genutils module must occur after staking so that pools are
233
244
// properly initialized with tokens from genesis accounts.
234
245
// NOTE: The genutils module must also occur after auth so that it can access the params from auth.
235
- // NOTE: Capability module must occur first so that it can initialize any capabilities
236
- // so that other modules that want to create or claim capabilities afterwards in InitChain
237
- // can do so safely.
238
246
app .mm .SetOrderInitGenesis (orderInitBlockers ()... )
239
247
240
248
// Uncomment if you want to set a custom migration order here.
@@ -355,7 +363,7 @@ func NewGaiaApp(
355
363
tmos .Exit (fmt .Sprintf ("WasmKeeper failed initialize pinned codes %s" , err ))
356
364
}
357
365
358
- if err := ibcwasmkeeper .InitializePinnedCodes (ctx ); err != nil {
366
+ if err := app . WasmClientKeeper .InitializePinnedCodes (ctx ); err != nil {
359
367
panic (fmt .Sprintf ("wasmlckeeper failed initialize pinned codes %s" , err ))
360
368
}
361
369
}
0 commit comments