Skip to content

Commit

Permalink
Merge pull request #265 from terra-money/fix/v0.3.x/app
Browse files Browse the repository at this point in the history
fix: app genesis creation
  • Loading branch information
emidev98 authored Oct 16, 2023
2 parents 1d2086d + 807ce1e commit 6d302c2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 315 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ var (
// and genesis verification.
ModuleBasics = module.NewBasicManager(
auth.AppModuleBasic{},
genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator),
authzmodule.AppModuleBasic{},
genutil.AppModuleBasic{},
bank.AppModuleBasic{},
capability.AppModuleBasic{},
staking.AppModuleBasic{},
Expand Down
200 changes: 0 additions & 200 deletions cmd/allianced/cmd/genaccounts.go

This file was deleted.

111 changes: 0 additions & 111 deletions cmd/allianced/cmd/genaccounts_test.go

This file was deleted.

12 changes: 11 additions & 1 deletion cmd/allianced/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
genutilcli.MigrateGenesisCmd(),
genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome),
genutilcli.ValidateGenesisCmd(app.ModuleBasics),
AddGenesisAccountCmd(app.DefaultNodeHome),
genesisCommand(encodingConfig),
tmcli.NewCompletionCmd(rootCmd, true),
NewTestnetCmd(app.ModuleBasics, banktypes.GenesisBalancesIterator{}),
debug.Cmd(),
Expand All @@ -189,6 +189,16 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
rootCmd.AddCommand(rosettaCmd.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Marshaler))
}

// genesisCommand builds genesis-related `terrad genesis` command. Users may provide application specific commands as a parameter
func genesisCommand(encodingConfig params.EncodingConfig, cmds ...*cobra.Command) *cobra.Command {
cmd := genutilcli.GenesisCoreCommand(encodingConfig.TxConfig, app.ModuleBasics, app.DefaultNodeHome)

for _, subCmd := range cmds {
cmd.AddCommand(subCmd)
}
return cmd
}

func addModuleInitFlags(startCmd *cobra.Command) {
crisis.AddModuleInitFlags(startCmd)
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/allianced/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import (
)

func main() {
// app.SetAddressPrefixes() //TODO: either implement or remove
rootCmd, _ := cmd.NewRootCmd()

if err := svrcmd.Execute(rootCmd, "ALLIANCED", app.DefaultNodeHome); err != nil {
if err := svrcmd.Execute(rootCmd, "allianced", app.DefaultNodeHome); err != nil {
switch e := err.(type) {
case server.ErrorCode:
os.Exit(e.Code)
Expand Down

0 comments on commit 6d302c2

Please sign in to comment.