cli/smartcontract: allow float gas specification

It can be useful for non-deployment transactions.
This commit is contained in:
Roman Khimov 2019-11-29 18:28:03 +03:00
parent fd93986503
commit 82c658613e

View file

@ -93,7 +93,7 @@ func NewCommands() []cli.Command {
Name: "wif, w",
Usage: "key to sign deployed transaction (in wif format)",
},
cli.IntFlag{
cli.Float64Flag{
Name: "gas, g",
Usage: "gas to pay for contract deployment",
},
@ -470,7 +470,7 @@ func contractDeploy(ctx *cli.Context) error {
if len(wifStr) == 0 {
return cli.NewExitError(errNoWIF, 1)
}
gas := util.Fixed8FromInt64(int64(ctx.Int("gas")))
gas := util.Fixed8FromFloat(ctx.Float64("gas"))
wif, err := keys.WIFDecode(wifStr, 0)
if err != nil {