From d71e45bcc5c8f7282e65ef9e592d515c1578fe87 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 4 Dec 2020 10:59:46 +0300 Subject: [PATCH] cli/contract: make `--force` flag bool --- 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 14ddf157b..86839d294 100644 --- a/cli/smartcontract/smart_contract.go +++ b/cli/smartcontract/smart_contract.go @@ -56,7 +56,7 @@ var ( Name: "out", Usage: "file to put JSON transaction to", } - forceFlag = cli.StringFlag{ + forceFlag = cli.BoolFlag{ Name: "force", Usage: "force-push the transaction in case of bad VM state after test script invocation", } @@ -507,7 +507,7 @@ func invokeInternal(ctx *cli.Context, signAndPush bool) error { } if signAndPush && resp.State != "HALT" { errText := fmt.Sprintf("Warning: %s VM state returned from the RPC node: %s\n", resp.State, resp.FaultException) - if ctx.String("force") == "" { + if !ctx.Bool("force") { return cli.NewExitError(errText+". Use --force flag to send the transaction anyway.", 1) } fmt.Fprintln(ctx.App.Writer, errText+". Sending transaction...")