Skip to content

Commit

Permalink
set consensus
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Aug 12, 2024
1 parent 293fc32 commit f2fa48c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
26 changes: 21 additions & 5 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import (
"cosmossdk.io/x/consensus"
consensusparamkeeper "cosmossdk.io/x/consensus/keeper"
consensusparamtypes "cosmossdk.io/x/consensus/types"
consensustypes "cosmossdk.io/x/consensus/types"
distr "cosmossdk.io/x/distribution"
distrkeeper "cosmossdk.io/x/distribution/keeper"
distrtypes "cosmossdk.io/x/distribution/types"
Expand Down Expand Up @@ -501,11 +502,26 @@ func NewSimApp(
// 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.
genesisModuleOrder := []string{
accounts.ModuleName, authtypes.ModuleName, banktypes.ModuleName,
distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName,
minttypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName,
feegrant.ModuleName, nft.ModuleName, group.ModuleName, upgradetypes.ModuleName,
vestingtypes.ModuleName, consensusparamtypes.ModuleName, circuittypes.ModuleName, pooltypes.ModuleName,
consensustypes.ModuleName,
accounts.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
distrtypes.ModuleName,
stakingtypes.ModuleName,
slashingtypes.ModuleName,
govtypes.ModuleName,
minttypes.ModuleName,
genutiltypes.ModuleName,
evidencetypes.ModuleName,
authz.ModuleName,
feegrant.ModuleName,
nft.ModuleName,
group.ModuleName,
upgradetypes.ModuleName,
vestingtypes.ModuleName,
consensusparamtypes.ModuleName,
circuittypes.ModuleName,
pooltypes.ModuleName,
epochstypes.ModuleName,
}
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
Expand Down
1 change: 1 addition & 0 deletions simapp/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ var (
// 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,
Expand Down
1 change: 0 additions & 1 deletion x/consensus/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func (k *Keeper) GetAuthority() string {

// InitGenesis initializes the initial state of the module
func (k *Keeper) InitGenesis(ctx context.Context) error {
fmt.Println("InitGenesis consensus")
value := ctx.Value(corecontext.InitInfoKey).(*types.MsgUpdateParams)
if value == nil {
return nil
Expand Down

0 comments on commit f2fa48c

Please sign in to comment.