@@ -48,6 +48,7 @@ import (
4848 "github.com/cosmos/cosmos-sdk/codec/types"
4949 "github.com/cosmos/cosmos-sdk/runtime"
5050 runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services"
51+ "github.com/cosmos/interchain-security/v5/app/common"
5152 "github.com/cosmos/cosmos-sdk/server"
5253 "github.com/cosmos/cosmos-sdk/server/api"
5354 "github.com/cosmos/cosmos-sdk/server/config"
@@ -155,21 +156,8 @@ var (
155156 _ ibctesting.TestingApp = (* App )(nil )
156157)
157158
158- // ICS1 E2E FIX: Simple implementation of VersionModifier interface
159- // AtomOne SDK v0.50.14 requires a VersionModifier for ABCI queries to work.
160- // This implementation returns protocol version 0, which is sufficient for testing.
161- // Without this, Hermes fails with "app.versionModifier is nil" when querying ABCI info.
162- type simpleVersionModifier struct {}
163-
164- func (s simpleVersionModifier ) SetAppVersion (ctx context.Context , version uint64 ) error {
165- // For now, we don't need to store the version
166- return nil
167- }
168-
169- func (s simpleVersionModifier ) AppVersion (ctx context.Context ) (uint64 , error ) {
170- // Return protocol version 0 as default
171- return 0 , nil
172- }
159+ // ICS1 E2E FIX: SimpleVersionModifier moved to app/common/version_modifier.go
160+ // to avoid code duplication between provider and consumer apps.
173161
174162// App extends an ABCI application, but with most of its parameters exported.
175163// They are exported for convenience in creating helper functions, as object
@@ -276,7 +264,7 @@ func New(
276264
277265 // ICS1 E2E FIX: Set a simple VersionModifier to fix "app.versionModifier is nil" error
278266 // This is needed for ABCI queries to work properly with AtomOne SDK
279- bApp .SetVersionModifier (simpleVersionModifier {})
267+ bApp .SetVersionModifier (common. SimpleVersionModifier {})
280268
281269 // IBC v10: Capability keeper and scoped keepers removed
282270
@@ -365,13 +353,6 @@ func New(
365353 authtypes .NewModuleAddress (govtypes .ModuleName ).String (),
366354 )
367355
368- // ICS1 E2E FIX: Register the tendermint light client module with IBC v10
369- // This is required for the 07-tendermint light client to work properly
370- // Based on AtomOne's implementation
371- storeProvider := app .IBCKeeper .ClientKeeper .GetStoreProvider ()
372- tmLightClientModule := ibctm .NewLightClientModule (appCodec , storeProvider )
373- app .IBCKeeper .ClientKeeper .AddRoute (ibctm .ModuleName , & tmLightClientModule )
374-
375356 // initialize the actual consumer keeper
376357 // IBC v10: Pass IBC keepers directly following ICS v7 pattern
377358 app .ConsumerKeeper = ibcconsumerkeeper .NewKeeper (
@@ -433,6 +414,11 @@ func New(
433414
434415 app .EvidenceKeeper = * evidenceKeeper
435416
417+ // IBC v10: Create light client module for tendermint
418+ // Reference: https://github.com/cosmos/interchain-security/blob/v7.0.1/app/consumer/app.go#L403-L404
419+ tmLightClientModule := ibctm .NewLightClientModule (appCodec , app .IBCKeeper .ClientKeeper .GetStoreProvider ())
420+ app .IBCKeeper .ClientKeeper .AddRoute (ibctm .ModuleName , tmLightClientModule )
421+
436422 // NOTE: Any module instantiated in the module manager that is later modified
437423 // must be passed by reference here.
438424 app .MM = module .NewManager (
0 commit comments