Skip to content

Commit

Permalink
Add interfaces to LikeApp for testing suite
Browse files Browse the repository at this point in the history
Ref #125

Adopt to ibctesting.TestingApp
  • Loading branch information
elise-ng committed Mar 25, 2022
1 parent eb13c3e commit cd10d38
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ type LikeApp struct {
FeeGrantKeeper feegrantkeeper.Keeper
IscnKeeper iscnkeeper.Keeper

// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper

// the module manager
mm *module.Manager

Expand Down Expand Up @@ -471,6 +475,9 @@ func NewLikeApp(
}
}

app.ScopedIBCKeeper = scopedIBCKeeper
app.ScopedTransferKeeper = scopedTransferKeeper

return app
}

Expand Down Expand Up @@ -557,6 +564,26 @@ func (app *LikeApp) AppCodec() codec.Codec {
return app.appCodec
}

// Interfaces for testing suite
func (app *LikeApp) GetBaseApp() *baseapp.BaseApp {
return app.BaseApp
}
func (app *LikeApp) GetStakingKeeper() stakingkeeper.Keeper {
return app.StakingKeeper
}
func (app *LikeApp) GetIBCKeeper() *ibckeeper.Keeper {
return app.IBCKeeper
}
func (app *LikeApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper {
return app.ScopedIBCKeeper
}
func (app *LikeApp) GetScopedTransferKeeper() capabilitykeeper.ScopedKeeper {
return app.ScopedTransferKeeper
}
func (app *LikeApp) GetTxConfig() client.TxConfig {
return MakeEncodingConfig().TxConfig
}

// RegisterAPIRoutes registers all application module routes with the provided
// API server.
func (app *LikeApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
Expand Down

0 comments on commit cd10d38

Please sign in to comment.