cli/smartcontract: print proper error message on failed testinvoke

Do not print info about `--force` flag if we don't send or save a transaction.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgeniy Stratonikov 2022-06-29 15:09:11 +03:00
parent 1f62ecd5a3
commit 0dc606f50e

View file

@ -665,6 +665,10 @@ func invokeWithArgs(ctx *cli.Context, acc *wallet.Account, wall *wallet.Wallet,
} }
if resp.State != "HALT" { if resp.State != "HALT" {
errText := fmt.Sprintf("Warning: %s VM state returned from the RPC node: %s\n", resp.State, resp.FaultException) errText := fmt.Sprintf("Warning: %s VM state returned from the RPC node: %s\n", resp.State, resp.FaultException)
if out == "" && !signAndPush {
return sender, cli.NewExitError(errText, 1)
}
action := "save" action := "save"
process := "Saving" process := "Saving"
if signAndPush { if signAndPush {