Skip to content

Commit

Permalink
minimize diff between yui-relayer's simapp with ibc-go's simapp
Browse files Browse the repository at this point in the history
Signed-off-by: Masanori Yoshida <[email protected]>
  • Loading branch information
siburu committed Apr 9, 2024
1 parent 07a0396 commit a4ed210
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/chains/tendermint/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ type SimApp struct {

// make IBC modules public for test purposes
// these modules are never directly routed to by the IBC Router
IBCMockModule ibcmock.IBCModule
ICAAuthModule ibcmock.IBCModule
FeeMockModule ibcmock.IBCModule

Expand Down Expand Up @@ -344,6 +345,7 @@ func NewSimApp(
// NOTE: the IBC mock keeper and application module is used only for testing core IBC. Do
// not replicate if you do not need to test core IBC or light clients.
scopedIBCMockKeeper := app.CapabilityKeeper.ScopeToModule(ibcmock.ModuleName)
scopedIBCMockBlockUpgradeKeeper := app.CapabilityKeeper.ScopeToModule(ibcmock.MockBlockUpgrade)
scopedFeeMockKeeper := app.CapabilityKeeper.ScopeToModule(MockFeePort)
scopedICAMockKeeper := app.CapabilityKeeper.ScopeToModule(ibcmock.ModuleName + icacontrollertypes.SubModuleName)

Expand Down Expand Up @@ -494,8 +496,16 @@ func NewSimApp(

// The mock module is used for testing IBC
mockIBCModule := ibcmock.NewIBCModule(&mockModule, ibcmock.NewIBCApp(ibcmock.ModuleName, scopedIBCMockKeeper))
app.IBCMockModule = mockIBCModule
ibcRouter.AddRoute(ibcmock.ModuleName, mockIBCModule)

// Mock IBC app wrapped with a middleware which does not implement the UpgradeableModule interface.
// NOTE: this is used to test integration with apps which do not yet fulfill the UpgradeableModule interface and error when
// an upgrade is tried on the channel.
mockBlockUpgradeIBCModule := ibcmock.NewIBCModule(&mockModule, ibcmock.NewIBCApp(ibcmock.MockBlockUpgrade, scopedIBCMockBlockUpgradeKeeper))
mockBlockUpgradeMw := ibcmock.NewBlockUpgradeMiddleware(&mockModule, mockBlockUpgradeIBCModule.IBCApp)
ibcRouter.AddRoute(ibcmock.MockBlockUpgrade, mockBlockUpgradeMw)

// Create Transfer Stack
// SendPacket, since it is originating from the application to core IBC:
// transferKeeper.SendPacket -> fee.SendPacket -> channel.SendPacket
Expand Down

0 comments on commit a4ed210

Please sign in to comment.