Skip to content

Commit

Permalink
Mark v1.19.1 and fix mainnet CLI queries. (#2108)
Browse files Browse the repository at this point in the history
* Look up the testnet flag the hard way when initially creating the root command.

* Mark v1.19.1.

* Add blurb.
  • Loading branch information
SpicyLemon committed Jul 25, 2024
1 parent 0965893 commit 3b120ad
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ Ref: https://keepachangelog.com/en/1.0.0/

---

## [v1.19.1](https://github.com/provenance-io/provenance/releases/tag/v1.19.1) - 2024-07-25

### Bug Fixes

* Use the correct HRP in the CLI queries [#2108](https://github.com/provenance-io/provenance/issues/2108).

### Full Commit History

* https://github.com/provenance-io/provenance/compare/v1.19.0...v1.19.1
* https://github.com/provenance-io/provenance/compare/v1.18.0...v1.19.1

---

## [v1.19.0](https://github.com/provenance-io/provenance/releases/tag/v1.19.0) - 2024-07-19

### Features
Expand Down
19 changes: 17 additions & 2 deletions cmd/provenanced/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ func NewRootCmd(sealConfig bool) (*cobra.Command, params.EncodingConfig) {
sdk.SetAddrCacheEnabled(false)
defer sdk.SetAddrCacheEnabled(true)

// We initially set the config as testnet so commands that run before start work for testing such as gentx.
app.SetConfig(true, false)
app.SetConfig(isTestnetFlagSet(), false)

tempApp := app.New(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(tempDir))
encodingConfig := tempApp.GetEncodingConfig()
Expand Down Expand Up @@ -438,3 +437,19 @@ func getIAVLCacheSize(options servertypes.AppOptions) int {
}
return iavlCacheSize
}

// isTestnetFlagSet returns true if the command was invoked with the --testnet flag.
// This should be the same as viper.Get("testnet"), but can be used without needing
// to set up viper.
func isTestnetFlagSet() bool {
ev := os.Getenv("PIO_TESTNET")
if len(ev) > 0 {
return cast.ToBool(ev)
}
for _, arg := range os.Args[1:] {
if arg == "-t" || arg == "--testnet" {
return true
}
}
return false
}

0 comments on commit 3b120ad

Please sign in to comment.