From 0415e6dc10de037021f7135987183f28ea95349c Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 21 Jul 2021 18:25:10 +0300 Subject: [PATCH] cli/query: use application log for vm state C# node doesn't return VMState data, so it leads to "false" being printed for successful transactions. --- cli/query/query.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/query/query.go b/cli/query/query.go index d77850591..2f5c9945b 100644 --- a/cli/query/query.go +++ b/cli/query/query.go @@ -86,7 +86,11 @@ func dumpApplicationLog(ctx *cli.Context, res *result.ApplicationLog, tx *result _, _ = tw.Write([]byte("ValidUntil:\t" + strconv.FormatUint(uint64(tx.ValidUntilBlock), 10) + "\n")) } else { _, _ = tw.Write([]byte("BlockHash:\t" + tx.Blockhash.StringLE() + "\n")) - _, _ = tw.Write([]byte(fmt.Sprintf("Success:\t%t\n", tx.VMState == vm.HaltState.String()))) + if len(res.Executions) != 1 { + _, _ = tw.Write([]byte("Success:\tunknown (no execution data)\n")) + } else { + _, _ = tw.Write([]byte(fmt.Sprintf("Success:\t%t\n", res.Executions[0].VMState == vm.HaltState))) + } } if verbose { for _, sig := range tx.Signers {