Skip to content

Commit

Permalink
fix(server): fix fallback genesis path (backport #22564) (#22573)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Robert <[email protected]>
  • Loading branch information
mergify[bot] and julienrbrt authored Nov 20, 2024
1 parent d8d7eb0 commit 47874ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Bug Fixes

* (server) [#22564](https://github.com/cosmos/cosmos-sdk/pull/22564) Fix fallback genesis path in server
* (x/group) [#22425](https://github.com/cosmos/cosmos-sdk/pull/22425) Proper address rendering in error
* (sims) [#21906](https://github.com/cosmos/cosmos-sdk/pull/21906) Skip sims test when running dry on validators
* (cli) [#21919](https://github.com/cosmos/cosmos-sdk/pull/21919) Query address-by-acc-num by account_id instead of id.
Expand Down
7 changes: 6 additions & 1 deletion server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,12 @@ func DefaultBaseappOptions(appOpts types.AppOptions) []func(*baseapp.BaseApp) {
chainID := cast.ToString(appOpts.Get(flags.FlagChainID))
if chainID == "" {
// fallback to genesis chain-id
reader, err := os.Open(filepath.Join(homeDir, "config", "genesis.json"))
genesisPathCfg, _ := appOpts.Get("genesis_file").(string)
if genesisPathCfg == "" {
genesisPathCfg = filepath.Join("config", "genesis.json")
}

reader, err := os.Open(filepath.Join(homeDir, genesisPathCfg))
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 47874ac

Please sign in to comment.