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.
This commit is contained in:
Roman Khimov 2021-07-21 18:25:10 +03:00
parent 7d6898677b
commit 0415e6dc10

View file

@ -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")) _, _ = tw.Write([]byte("ValidUntil:\t" + strconv.FormatUint(uint64(tx.ValidUntilBlock), 10) + "\n"))
} else { } else {
_, _ = tw.Write([]byte("BlockHash:\t" + tx.Blockhash.StringLE() + "\n")) _, _ = 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 { if verbose {
for _, sig := range tx.Signers { for _, sig := range tx.Signers {