Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R4R: Use dash-separated flags for minimus gas prices #3364

Merged
merged 2 commits into from
Jan 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ IMPROVEMENTS
* Validators specify minimum gas prices instead of minimum fees
* Clients may provide either fees or gas prices directly
* The gas prices of a tx must meet a validator's minimum
* `gaiad start` and `gaia.toml` take --minimum-gas-prices flag and minimum-gas-price config key respectively.
* [\#2859](https://github.com/cosmos/cosmos-sdk/issues/2859) Rename `TallyResult` in gov proposals to `FinalTallyResult`
* [\#3286](https://github.com/cosmos/cosmos-sdk/pull/3286) Fix `gaiad gentx` printout of account's addresses, i.e. user bech32 instead of hex.

Expand Down
6 changes: 3 additions & 3 deletions cmd/gaia/cli_test/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestGaiaCLIMinimumFees(t *testing.T) {
// start gaiad server with minimum fees
minGasPrice, _ := sdk.NewDecFromStr("0.000006")
fees := fmt.Sprintf(
"--minimum_gas_prices=%s,%s",
"--minimum-gas-prices=%s,%s",
sdk.NewDecCoinFromDec(feeDenom, minGasPrice),
sdk.NewDecCoinFromDec(fee2Denom, minGasPrice),
)
Expand Down Expand Up @@ -87,7 +87,7 @@ func TestGaiaCLIGasPrices(t *testing.T) {

// start gaiad server with minimum fees
minGasPrice, _ := sdk.NewDecFromStr("0.000006")
proc := f.GDStart(fmt.Sprintf("--minimum_gas_prices=%s", sdk.NewDecCoinFromDec(feeDenom, minGasPrice)))
proc := f.GDStart(fmt.Sprintf("--minimum-gas-prices=%s", sdk.NewDecCoinFromDec(feeDenom, minGasPrice)))
defer proc.Stop(false)

barAddr := f.KeyAddress(keyBar)
Expand Down Expand Up @@ -120,7 +120,7 @@ func TestGaiaCLIFeesDeduction(t *testing.T) {

// start gaiad server with minimum fees
minGasPrice, _ := sdk.NewDecFromStr("0.000006")
proc := f.GDStart(fmt.Sprintf("--minimum_gas_prices=%s", sdk.NewDecCoinFromDec(feeDenom, minGasPrice)))
proc := f.GDStart(fmt.Sprintf("--minimum-gas-prices=%s", sdk.NewDecCoinFromDec(feeDenom, minGasPrice)))
defer proc.Stop(false)

// Save key addresses for later use
Expand Down
2 changes: 1 addition & 1 deletion server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type BaseConfig struct {
// The minimum gas prices a validator is willing to accept for processing a
// transaction. A transaction's fees must meet the minimum of each denomination
// specified in this config (e.g. 0.01photino,0.0001stake).
MinGasPrices string `mapstructure:"minimum_gas_prices"`
MinGasPrices string `mapstructure:"minimum-gas-prices"`
}

// Config defines the server's top level configuration
Expand Down
2 changes: 1 addition & 1 deletion server/config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const defaultConfigTemplate = `# This is a TOML config file.
# The minimum gas prices a validator is willing to accept for processing a
# transaction. A transaction's fees must meet the minimum of each denomination
# specified in this config (e.g. 0.01photino,0.0001stake).
minimum_gas_prices = "{{ .BaseConfig.MinGasPrices }}"
minimum-gas-prices = "{{ .BaseConfig.MinGasPrices }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So is this required? This is why I didn't go with this in the first place because most (all?) toml keys are snake-cased.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is true for Tendermint config.toml, not for gaiad.toml.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right...TOML spec doesn't really seem to have a preference here (https://github.com/toml-lang/toml#user-content-keys)

`

var configTemplate *template.Template
Expand Down
2 changes: 1 addition & 1 deletion server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (
flagAddress = "address"
flagTraceStore = "trace-store"
flagPruning = "pruning"
FlagMinGasPrices = "minimum_gas_prices"
FlagMinGasPrices = "minimum-gas-prices"
)

// StartCmd runs the service passed in, either stand-alone or in-process with
Expand Down