When using akash I am getting this error if I set --gas-prices=1uakt
$ ~/akash/akash/akash --home "${PWD?}" tx staking create-validator --keyring-backend test --from extravalidator --moniker node1 --amount=1uakt --pubkey akashvalconspub1zcjduepq3wkvh6k0r36qrfprwqza7tkmd4u4rrvx2400m5zdhctt3auk4zls6g604m --commission-rate=0.1 --commission-max-rate=0.2 --commission-max-change-rate=0.01 --min-self-delegation=1 --gas=auto --gas-prices=1uakt --chain-id=local
panic: invalid decimal coin expression: 1uakt
goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/client/tx.Factory.WithGasPrices(...)
github.com/cosmos/[email protected]/client/tx/factory.go:136
github.com/cosmos/cosmos-sdk/client/tx.NewFactoryCLI(0xc0012f8b80, 0x14, 0x20, 0x2dc71e0, 0xc00121ef30, 0x7ffd30a44594, 0x5, 0x2d8db60, 0xc000f8f550, 0x2da2560, ...)
github.com/cosmos/[email protected]/client/tx/factory.go:76 +0x52b
github.com/cosmos/cosmos-sdk/x/staking/client/cli.NewCreateValidatorCmd.func1(0xc0010978c0, 0xc00110e240, 0x0, 0x12, 0x0, 0x0)
github.com/cosmos/[email protected]/x/staking/client/cli/tx.go:61 +0x14a
github.com/spf13/cobra.(*Command).execute(0xc0010978c0, 0xc00110e120, 0x12, 0x12, 0xc0010978c0, 0xc00110e120)
github.com/spf13/[email protected]/command.go:850 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0xc000f37080, 0x2803ec9, 0x5, 0xc000e0cf60)
github.com/spf13/[email protected]/command.go:958 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/command.go:895
github.com/spf13/cobra.(*Command).ExecuteContext(...)
github.com/spf13/[email protected]/command.go:888
github.com/ovrclk/akash/cmd/akash/cmd.Execute(0xc000f37080, 0x2da2560, 0xc000fcb9c0)
github.com/ovrclk/akash/cmd/akash/cmd/root.go:113 +0x22f
main.main()
github.com/ovrclk/akash/cmd/akash/main.go:12 +0x2a
Setting --gas-prices=1.0uakt causes the command to work as expected. So I think what is happening is it tries to parse it as a float and fails. It seems like cosmos SDK should not panic here even if the amount isn't something it understands.
might be related to https://github.com/cosmos/cosmos-sdk/pull/7954, cc @yihuang is it? We should definitely add a test.
might be related to #7954, cc @yihuang is it? We should definitely add a test.
I think this is fixed by that commit, not the other way around, before that PR, decimal coin regex don't accept integers.
@hydrogen18 are you using master version? if not, can you try if master version already fixed it?
Closing at it seems already addressed.
Most helpful comment
I think this is fixed by that commit, not the other way around, before that PR, decimal coin regex don't accept integers.
@hydrogen18 are you using master version? if not, can you try if master version already fixed it?