Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: prepare for wasm app #3956

Merged
merged 3 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading