Skip to content
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 @@ -11,6 +11,7 @@

- [#4689](https://github.com/ignite/cli/pull/4689) Revert `HasGenesis` implementation from retracted `core` v1 to SDK `HasGenesis` interface.
- [#4701](https://github.com/ignite/cli/pull/4701) Improve `ignite doctor` by removing manual migration step. Additionally, remove protoc to buf migrations logic.
- [#4702](https://github.com/ignite/cli/pull/4702) Improve app detection by checking for inheritance instead of interface implementation.

### Bug Fixes

Expand Down
12 changes: 0 additions & 12 deletions docs/docs/06-migration/v29.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,4 @@ Now start your chain.
ignite chain serve
```

:::tip
If Ignite is unable to detect the chain `app.go`, make sure you have the following methods on the `App` struct:

```go
func (app *App) AppCodec() codec.Codec
func (app *App) TxConfig() client.TxConfig
func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
```

All recent Ignite v28 scaffolded chains should have these methods.
:::

If you need our help and support, do not hesitate to visit our [Discord](https://discord.com/invite/ignite).
4 changes: 2 additions & 2 deletions ignite/pkg/cosmosanalysis/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const registerRoutesMethod = "RegisterAPIRoutes"
// CheckKeeper checks for the existence of the keeper with the provided name in the app structure.
func CheckKeeper(path, keeperName string) error {
// find app type
appImpl, err := cosmosanalysis.FindImplementation(path, cosmosanalysis.AppImplementation)
appImpl, err := cosmosanalysis.FindEmbed(path, cosmosanalysis.AppEmbeddedTypes)
if err != nil {
return err
}
Expand Down Expand Up @@ -119,7 +119,7 @@ func FindRegisteredModules(chainRoot string) ([]string, error) {
// DiscoverModules find a map of import modules based on the configured app.
func DiscoverModules(file *ast.File, chainRoot string, fileImports map[string]string) ([]string, error) {
// find app type
appImpl := cosmosanalysis.FindImplementationInFile(file, cosmosanalysis.AppImplementation)
appImpl := cosmosanalysis.FindEmbedInFile(file, cosmosanalysis.AppEmbeddedTypes)
appTypeName := "App"
switch {
case len(appImpl) > 1:
Expand Down
23 changes: 5 additions & 18 deletions ignite/pkg/cosmosanalysis/app/testdata/app_generic.go
Original file line number Diff line number Diff line change
@@ -1,35 +1,22 @@
package foo

import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/runtime"
sdk "github.com/cosmos/cosmos-sdk/types"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
abci "github.com/tendermint/tendermint/abci/types"

app "github.com/ignite/cli/v29/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go"
)

type Foo[T any] struct {
*runtime.App

FooKeeper foo.keeper
i T
}

func (f Foo[T]) TxConfig() client.TxConfig { return nil }
func (f Foo[T]) RegisterAPIRoutes() {}
func (f Foo[T]) RegisterTxService() {}
func (f Foo[T]) RegisterTendermintService() {}
func (f Foo[T]) AppCodec() codec.Codec { return app.appCodec }
func (f Foo[T]) Name() string { return app.BaseApp.Name() }
func (f Foo[T]) GetKey(storeKey string) *storetypes.KVStoreKey { return nil }
func (f Foo[T]) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { return nil }
func (f Foo[T]) kvStoreKeys() map[string]*storetypes.KVStoreKey { return nil }
func (f Foo[T]) GetSubspace(moduleName string) paramstypes.Subspace { return subspace }
func (f Foo[T]) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
return app.mm.BeginBlock(ctx, req)
return f.App.BeginBlocker(ctx, req)
}

func (f Foo[T]) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock {
return app.mm.EndBlock(ctx, req)
return f.App.EndBlocker(ctx, req)
}
23 changes: 5 additions & 18 deletions ignite/pkg/cosmosanalysis/app/testdata/app_minimal.go
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
package foo

import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/baseapp"
sdk "github.com/cosmos/cosmos-sdk/types"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
abci "github.com/tendermint/tendermint/abci/types"

app "github.com/ignite/cli/v29/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go"
)

type Foo struct {
*baseapp.BaseApp

FooKeeper foo.keeper
}

func (f Foo) TxConfig() client.TxConfig { return nil }
func (f Foo) RegisterAPIRoutes() {}
func (f Foo) RegisterTxService() {}
func (f Foo) RegisterTendermintService() {}
func (f Foo) Name() string { return app.BaseApp.Name() }
func (f Foo) AppCodec() codec.Codec { return app.appCodec }
func (F Foo) GetKey(storeKey string) *storetypes.KVStoreKey { return nil }
func (F Foo) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { return nil }
func (F Foo) kvStoreKeys() map[string]*storetypes.KVStoreKey { return nil }
func (F Foo) GetSubspace(moduleName string) paramstypes.Subspace { return subspace }
func (f Foo) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
return app.mm.BeginBlock(ctx, req)
return f.BaseApp.BeginBlocker(ctx, req)
}

func (f Foo) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock {
return app.mm.EndBlock(ctx, req)
return f.BaseApp.EndBlocker(ctx, req)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package app

import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/server/api"
"github.com/cosmos/cosmos-sdk/server/config"
Expand All @@ -19,6 +20,8 @@ import (
)

type Foo struct {
runtime.App

AuthKeeper authkeeper.Keeper
BankKeeper bankkeeper.Keeper
StakingKeeper stakingkeeper.Keeper
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app

import (
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/server/api"
Expand All @@ -20,6 +21,8 @@ import (
)

type Foo struct {
baseapp.BaseApp

AuthKeeper authkeeper.Keeper
BankKeeper bankkeeper.Keeper
StakingKeeper stakingkeeper.Keeper
Expand Down
36 changes: 8 additions & 28 deletions ignite/pkg/cosmosanalysis/app/testdata/two_app.go
Original file line number Diff line number Diff line change
@@ -1,52 +1,32 @@
package foo

import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/runtime"
sdk "github.com/cosmos/cosmos-sdk/types"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
abci "github.com/tendermint/tendermint/abci/types"

app "github.com/ignite/cli/v29/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go"
)

type Foo struct {
*runtime.App

FooKeeper foo.keeper
}

func (f Foo) TxConfig() client.TxConfig { return nil }
func (f Foo) RegisterAPIRoutes() {}
func (f Foo) RegisterTxService() {}
func (f Foo) RegisterTendermintService() {}
func (f Foo) Name() string { return app.BaseApp.Name() }
func (f Foo) AppCodec() codec.Codec { return app.appCodec }
func (F Foo) GetKey(storeKey string) *storetypes.KVStoreKey { return nil }
func (F Foo) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { return nil }
func (F Foo) kvStoreKeys() map[string]*storetypes.KVStoreKey { return nil }
func (F Foo) GetSubspace(moduleName string) paramstypes.Subspace { return subspace }
func (f Foo) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
return app.mm.BeginBlock(ctx, req)
return f.App.BeginBlocker(ctx, req)
}

func (f Foo) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock {
return app.mm.EndBlock(ctx, req)
return f.App.EndBlocker(ctx, req)
}

type Bar struct {
*baseapp.BaseApp

FooKeeper foo.keeper
}

func (f Bar) TxConfig() client.TxConfig { return nil }
func (f Bar) RegisterAPIRoutes() {}
func (f Bar) RegisterTxService() {}
func (f Bar) RegisterTendermintService() {}
func (f Bar) Name() string { return app.BaseApp.Name() }
func (f Bar) AppCodec() codec.Codec { return app.appCodec }
func (f Bar) GetKey(storeKey string) *storetypes.KVStoreKey { return nil }
func (f Bar) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { return nil }
func (f Bar) kvStoreKeys() map[string]*storetypes.KVStoreKey { return nil }
func (f Bar) GetSubspace(moduleName string) paramstypes.Subspace { return subspace }
func (f Bar) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
return app.mm.BeginBlock(ctx, req)
}
Expand Down
Loading