-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix stack exception name #855
Changes from 1 commit
527b885
e7e3e8f
2ced172
78d62b3
a6bf3a1
b205496
7e761f6
533a1e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -99,7 +99,7 @@ public static JObject TxLogToJson(Blockchain.ApplicationExecuted appExec) | |||||
} | ||||||
catch (Exception ex) | ||||||
{ | ||||||
stack.Add("error: " + ex); | ||||||
stack.Add("error: " + ex.Message); | ||||||
} | ||||||
} | ||||||
trigger["stack"] = stack; | ||||||
|
@@ -147,7 +147,7 @@ public static JObject BlockLogToJson(Block block, IReadOnlyList<Blockchain.Appli | |||||
} | ||||||
catch (Exception ex) | ||||||
{ | ||||||
stack.Add("error: " + ex); | ||||||
stack.Add("error: " + ex.Message); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The error means that there was a stackitem, but it can't be serialized and therefore can't be presented in JSON output. Replacing it with NULL or any other element (empty/string with a name) would be wrong because that's not what's on the stack. Proper stack item (like suggested) would be misinterpreted as a real output from the execution, it has to be some error string in case of serialization failure. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But the ones that can't be output to json are iterators (storage); at least what i have ran into (on testnet). |
||||||
} | ||||||
} | ||||||
trigger["stack"] = stack; | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -102,7 +102,7 @@ private JObject GetInvokeResult(byte[] script, Signer[] signers = null, Witness[ | |||||
} | ||||||
catch (Exception ex) | ||||||
{ | ||||||
stack.Add("error: " + ex); | ||||||
stack.Add("error: " + ex.Message); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
} | ||||||
} | ||||||
json["stack"] = stack; | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can break applicationlog getting the stack:


But you can see it's
on-chain
: