Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Feb 12, 2025
1 parent b5c526f commit 6203f1a
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 147 deletions.
17 changes: 4 additions & 13 deletions ignite/templates/app/files-minimal/app/app.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,12 @@ import (

clienthelpers "cosmossdk.io/client/v2/helpers"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/registry"
corestore "cosmossdk.io/core/store"
"cosmossdk.io/depinject"
"cosmossdk.io/log"
"cosmossdk.io/x/accounts"
basedepinject "cosmossdk.io/x/accounts/defaults/base/depinject"
lockupdepinject "cosmossdk.io/x/accounts/defaults/lockup/depinject"
multisigdepinject "cosmossdk.io/x/accounts/defaults/multisig/depinject"
basedepinject "cosmossdk.io/x/accounts/defaults/base/depinject"
bankkeeper "cosmossdk.io/x/bank/keeper"
distrkeeper "cosmossdk.io/x/distribution/keeper"
_ "cosmossdk.io/x/protocolpool"
stakingkeeper "cosmossdk.io/x/staking/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -52,13 +45,12 @@ var (
// capabilities aren't needed for testing.
type App struct {
*runtime.App
legacyAmino registry.AminoRegistrar
legacyAmino *codec.LegacyAmino
appCodec codec.Codec
txConfig client.TxConfig
interfaceRegistry codectypes.InterfaceRegistry

// keepers
AccountsKeeper accounts.Keeper
AuthKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
Expand Down Expand Up @@ -127,7 +119,6 @@ func New(
&app.txConfig,
&app.interfaceRegistry,
&app.AuthKeeper,
&app.AccountsKeeper,
&app.BankKeeper,
&app.StakingKeeper,
&app.DistrKeeper,
Expand Down
43 changes: 9 additions & 34 deletions ignite/templates/app/files-minimal/app/app_config.go.plush
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
package app

import (
accountsmodulev1 "cosmossdk.io/api/cosmos/accounts/module/v1"
runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1"
appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"
authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1"
bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1"
consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1"
distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1"
genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1"
poolmodulev1 "cosmossdk.io/api/cosmos/protocolpool/module/v1"
stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1"
txconfigv1 "cosmossdk.io/api/cosmos/tx/config/v1"
"cosmossdk.io/depinject/appconfig"
"cosmossdk.io/x/accounts"
_ "cosmossdk.io/x/bank" // import for side-effects
banktypes "cosmossdk.io/x/bank/types"
_ "cosmossdk.io/x/consensus" // import for side-effects
consensustypes "cosmossdk.io/x/consensus/types"
_ "cosmossdk.io/x/distribution" // import for side-effects
distrtypes "cosmossdk.io/x/distribution/types"
minttypes "cosmossdk.io/x/mint/types"
_ "cosmossdk.io/x/protocolpool" // import for side-effects
pooltypes "cosmossdk.io/x/protocolpool/types"
_ "cosmossdk.io/x/staking" // import for side-effects
stakingtypes "cosmossdk.io/x/staking/types"
_ "github.com/cosmos/cosmos-sdk/x/bank" // import for side-effects
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
_ "github.com/cosmos/cosmos-sdk/x/consensus" // import for side-effects
consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
_ "github.com/cosmos/cosmos-sdk/x/distribution" // import for side-effects
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
_ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/cosmos/cosmos-sdk/runtime"
_ "github.com/cosmos/cosmos-sdk/testutil/x/counter" // import for side-effects
Expand All @@ -38,9 +33,6 @@ var (
moduleAccPerms = []*authmodulev1.ModuleAccountPermission{
{Account: authtypes.FeeCollectorName},
{Account: distrtypes.ModuleName},
{Account: pooltypes.ModuleName},
{Account: pooltypes.StreamAccount},
{Account: pooltypes.ProtocolPoolDistrAccount},
{Account: minttypes.ModuleName, Permissions: []string{authtypes.Minter}},
{Account: stakingtypes.BondedPoolName, Permissions: []string{authtypes.Burner, stakingtypes.ModuleName}},
{Account: stakingtypes.NotBondedPoolName, Permissions: []string{authtypes.Burner, stakingtypes.ModuleName}},
Expand All @@ -55,7 +47,6 @@ var (
stakingtypes.NotBondedPoolName,
// We allow the following module accounts to receive funds:
// govtypes.ModuleName
// pooltypes.ModuleName
}

// application configuration (used by depinject)
Expand All @@ -75,14 +66,12 @@ var (
// NOTE: staking module is required if HistoricalEntries param > 0
BeginBlockers: []string{
distrtypes.ModuleName,
pooltypes.ModuleName,
stakingtypes.ModuleName,
// chain modules
// this line is used by starport scaffolding # stargate/app/beginBlockers
},
EndBlockers: []string{
stakingtypes.ModuleName,
pooltypes.ModuleName,
// chain modules
// this line is used by starport scaffolding # stargate/app/endBlockers
},
Expand All @@ -92,23 +81,17 @@ var (
ModuleName: authtypes.ModuleName,
KvStoreKey: "acc",
},
{
ModuleName: accounts.ModuleName,
KvStoreKey: accounts.StoreKey,
},
},
// NOTE: The genutils module must occur after staking so that pools are
// properly initialized with tokens from genesis accounts.
// NOTE: The genutils module must also occur after auth so that it can access the params from auth.
InitGenesis: []string{
consensustypes.ModuleName,
accounts.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
distrtypes.ModuleName,
stakingtypes.ModuleName,
genutiltypes.ModuleName,
pooltypes.ModuleName,
// chain modules
// this line is used by starport scaffolding # stargate/app/initGenesis
},
Expand Down Expand Up @@ -160,14 +143,6 @@ var (
Name: consensustypes.ModuleName,
Config: appconfig.WrapAny(&consensusmodulev1.Module{}),
},
{
Name: pooltypes.ModuleName,
Config: appconfig.WrapAny(&poolmodulev1.Module{}),
},
{
Name: accounts.ModuleName,
Config: appconfig.WrapAny(&accountsmodulev1.Module{}),
},
// this line is used by starport scaffolding # stargate/app/moduleConfig
},
})
Expand Down
31 changes: 12 additions & 19 deletions ignite/templates/app/files/app/app.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@ import (

clienthelpers "cosmossdk.io/client/v2/helpers"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/registry"
corestore "cosmossdk.io/core/store"
"cosmossdk.io/depinject"
"cosmossdk.io/log"
"cosmossdk.io/x/accounts"
authzkeeper "cosmossdk.io/x/authz/keeper"
bankkeeper "cosmossdk.io/x/bank/keeper"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
circuitkeeper "cosmossdk.io/x/circuit/keeper"
consensuskeeper "cosmossdk.io/x/consensus/keeper"
distrkeeper "cosmossdk.io/x/distribution/keeper"
govkeeper "cosmossdk.io/x/gov/keeper"
mintkeeper "cosmossdk.io/x/mint/keeper"
paramskeeper "cosmossdk.io/x/params/keeper"
paramstypes "cosmossdk.io/x/params/types"
poolkeeper "cosmossdk.io/x/protocolpool/keeper"
slashingkeeper "cosmossdk.io/x/slashing/keeper"
stakingkeeper "cosmossdk.io/x/staking/keeper"
consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
upgradekeeper "cosmossdk.io/x/upgrade/keeper"

abci "github.com/cometbft/cometbft/abci/types"
Expand Down Expand Up @@ -69,15 +66,14 @@ var (
// capabilities aren't needed for testing.
type App struct {
*runtime.App
legacyAmino registry.AminoRegistrar
legacyAmino *codec.LegacyAmino
appCodec codec.Codec
txConfig client.TxConfig
interfaceRegistry codectypes.InterfaceRegistry

// keepers
// only keepers required by the app are exposed
// the list of all modules is available in the app_config
AccountsKeeper accounts.Keeper
AuthKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
Expand All @@ -89,7 +85,6 @@ type App struct {
AuthzKeeper authzkeeper.Keeper
ConsensusParamsKeeper consensuskeeper.Keeper
CircuitBreakerKeeper circuitkeeper.Keeper
PoolKeeper poolkeeper.Keeper
ParamsKeeper paramskeeper.Keeper

// ibc keepers
Expand Down Expand Up @@ -158,7 +153,6 @@ func New(
&app.txConfig,
&app.interfaceRegistry,
&app.AuthKeeper,
&app.AccountsKeeper,
&app.BankKeeper,
&app.StakingKeeper,
&app.SlashingKeeper,
Expand All @@ -169,7 +163,6 @@ func New(
&app.AuthzKeeper,
&app.ConsensusParamsKeeper,
&app.CircuitBreakerKeeper,
&app.PoolKeeper,
&app.ParamsKeeper,
); err != nil {
panic(err)
Expand All @@ -191,7 +184,7 @@ func New(

// create the simulation manager and define the order of the modules for deterministic simulations
overrideModules := map[string]module.AppModuleSimulation{
authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AuthKeeper, &app.AccountsKeeper, authsims.RandomGenesisAccounts, nil),
authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AuthKeeper, authsims.RandomGenesisAccounts, nil),
}
app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules)

Expand Down
Loading

0 comments on commit 6203f1a

Please sign in to comment.