Skip to content

Commit

Permalink
feat: prepare for wasm app (#3956)
Browse files Browse the repository at this point in the history
### Description

- Pass the `servertypes.AppOptions` to the `registerIBCModules` function so we can use it in the wasm integration app;
- Return an error for `registerIBCModules` instead panic;
  • Loading branch information
Pantani authored and julienrbrt committed May 29, 2024
1 parent fd2a31a commit 297e769
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [#3839](https://github.com/ignite/cli/pull/3839) New structure for app scaffolding
- [#3835](https://github.com/ignite/cli/pull/3835) Add `--minimal` flag to `scaffold chain` to scaffold a chain with the least amount of sdk modules
- [#3820](https://github.com/ignite/cli/pull/3820) Add integration tests for IBC chains
- [#3956](https://github.com/ignite/cli/pull/3956) Prepare for wasm app

### Changes

Expand Down
4 changes: 3 additions & 1 deletion ignite/templates/app/files/app/app.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ func New(
app.App = appBuilder.Build(db, traceStore, baseAppOptions...)

// Register legacy modules
app.registerIBCModules()
if err := app.registerIBCModules(appOpts); err != nil {
return nil, err
}

// register streaming services
if err := app.RegisterStreamingServices(appOpts, app.kvStoreKeys()); err != nil {
Expand Down
12 changes: 7 additions & 5 deletions ignite/templates/app/files/app/ibc.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
)

// registerIBCModules register IBC keepers and non dependency inject modules.
func (app *App) registerIBCModules() {
func (app *App) registerIBCModules(appOpts servertypes.AppOptions) error {
// set up non depinject support modules store keys
if err := app.RegisterStores(
storetypes.NewKVStoreKey(capabilitytypes.StoreKey),
Expand All @@ -50,7 +50,7 @@ func (app *App) registerIBCModules() {
storetypes.NewMemoryStoreKey(capabilitytypes.MemStoreKey),
storetypes.NewTransientStoreKey(paramstypes.TStoreKey),
); err != nil {
panic(err)
return err
}

// register the key tables for legacy param subspaces
Expand Down Expand Up @@ -176,12 +176,14 @@ func (app *App) registerIBCModules() {
ibctm.AppModule{},
solomachine.AppModule{},
); err != nil {
panic(err)
return err
}

return nil
}

// Since the IBC modules don't support dependency injection, we need to
// manually register the modules on the client side.
// RegisterIBC Since the IBC modules don't support dependency injection,
// we need to manually register the modules on the client side.
// This needs to be removed after IBC supports App Wiring.
func RegisterIBC(registry cdctypes.InterfaceRegistry) map[string]appmodule.AppModule {
modules := map[string]appmodule.AppModule{
Expand Down

0 comments on commit 297e769

Please sign in to comment.