-
Notifications
You must be signed in to change notification settings - Fork 81
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
vm: minor C# compatibility fixes #1874
Conversation
It's convinient to know the failing syscall without dumping smartcontract instructions.
We should match the C# behaviour.
14ca0d3
to
e8e13da
Compare
Codecov Report
@@ Coverage Diff @@
## master #1874 +/- ##
==========================================
+ Coverage 83.03% 83.11% +0.08%
==========================================
Files 286 286
Lines 22661 22676 +15
==========================================
+ Hits 18816 18847 +31
+ Misses 2657 2639 -18
- Partials 1188 1190 +2
Continue to review full report at Codecov.
|
The result is the same HALT state, but the exception message is the real one got from user. Changes ported from C#: 1. Throw exception: https://github.com/neo-project/neo-vm/blob/59b8ac73d285aa9d607aee53eeadde82fcba9324/src/neo-vm/ExecutionEngine.cs#L1448 2. Prettify message: https://github.com/neo-project/neo-vm/blob/master/src/neo-vm/VMUnhandledException.cs#L28 The result is that instead of ``` 2021-03-31T17:02:54.508+0300 WARN contract invocation failed {"tx": "2aefeb705f3a609df8767d9b45e036b9dd1eb77407e5732375981915668889b8", "block": 30640, "error": "error encountered at instruction 970 (THROW): runtime error: invalid memory address or nil pointer dereference"} ``` we'll get ``` 2021-03-31T17:33:56.299+0300 WARN contract invocation failed {"tx": "2aefeb705f3a609df8767d9b45e036b9dd1eb77407e5732375981915668889b8", "block": 30640, "error": "error encountered at instruction 970 (THROW): unhandled exception: No authorization."} ``` in the node logs.
e8e13da
to
f57187e
Compare
Does not affects states.
This PR includes the following fixes: