From 82c658613e589e3b9ba07fa1268bbf5f592737a0 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 29 Nov 2019 18:28:03 +0300 Subject: [PATCH] cli/smartcontract: allow float gas specification It can be useful for non-deployment transactions. --- cli/smartcontract/smart_contract.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/smartcontract/smart_contract.go b/cli/smartcontract/smart_contract.go index 567576944..d788d2f2d 100644 --- a/cli/smartcontract/smart_contract.go +++ b/cli/smartcontract/smart_contract.go @@ -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 {