Skip to content

Commit

Permalink
fix: miss add chainId
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed Dec 28, 2023
1 parent 24e14da commit 3408c03
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ func NewMigalooApp(

// Configure the hooks keeper
hooksKeeper := ibchookskeeper.NewKeeper(
keys[ibchookstypes.StoreKey],
app.keys[ibchookstypes.StoreKey],
)
app.IBCHooksKeeper = &hooksKeeper

Expand Down
21 changes: 19 additions & 2 deletions cmd/migalood/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package cmd

import (
"errors"

Check failure on line 4 in cmd/migalood/cmd/root.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed (gofumpt)
tmtypes "github.com/cometbft/cometbft/types"
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
"io"

Check failure on line 8 in cmd/migalood/cmd/root.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed (gofumpt)
"os"
"path/filepath"

rosettaCmd "cosmossdk.io/tools/rosetta/cmd"
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/cast"

Expand Down Expand Up @@ -145,7 +147,7 @@ func initAppConfig() (string, interface{}) {
// own app.toml to override, or use this default value.
//
// In simapp, we set the min gas prices to 0.
srvCfg.MinGasPrices = "0whale"
srvCfg.MinGasPrices = "0.25uwhale"
// srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default

customAppConfig := CustomAppConfig{
Expand Down Expand Up @@ -194,7 +196,8 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
keys.Commands(app.DefaultNodeHome),
)

server.AddCommands(rootCmd, app.DefaultNodeHome, a.newApp, a.appExport, addModuleInitFlags)
// add rosetta
rootCmd.AddCommand(rosettaCmd.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Codec))
}

func addModuleInitFlags(startCmd *cobra.Command) {
Expand Down Expand Up @@ -293,6 +296,19 @@ func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, a
skipUpgradeHeights[int64(h)] = true
}

homeDir := cast.ToString(appOpts.Get(flags.FlagHome))

chainID := cast.ToString(appOpts.Get(flags.FlagChainID))
if chainID == "" {
// fallback to genesis chain-id
appGenesis, err := tmtypes.GenesisDocFromFile(filepath.Join(homeDir, "config", "genesis.json"))
if err != nil {
panic(err)
}

chainID = appGenesis.ChainID
}

return app.NewMigalooApp(
logger,
db,
Expand All @@ -314,6 +330,7 @@ func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, a
baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))),
baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))),
baseapp.SetSnapshot(snapshotStore, snapshotOptions),
baseapp.SetChainID(chainID),
)
}

Expand Down

0 comments on commit 3408c03

Please sign in to comment.