-
Notifications
You must be signed in to change notification settings - Fork 82
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
smartcontract: escape non-ascii characters for manifest.Extra SI #2174
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2174 +/- ##
==========================================
+ Coverage 83.75% 83.79% +0.04%
==========================================
Files 295 295
Lines 28217 28228 +11
==========================================
+ Hits 23633 23655 +22
+ Misses 3242 3227 -15
- Partials 1342 1346 +4
Continue to review full report at Codecov.
|
@roman-khimov, I wasn't able to find standard library solution of how to escape non-ascii characters (https://golang.org/pkg/strconv/?m=old#QuoteToASCII is similar to what we're looking for, but we don't need to apply it to the whole string and don't need quotes also). golang/go#39137 is somehow related to that. This PR contains a cludge, so could you review it and tell whether it is appropriate for us to solve the problem this way? |
Hi, neo-project/neo#2345. |
#2026 related. |
I found out that escaping non-ASCII characters is the wrong solution. The problem is in |
Unescaping during decoding is actually a correct behaviour. The funny thing is that we've tried to avoid this decoding/encoding, but we've got #2026. Now we decode/encode and get this. C# compatibility costs a lot... |
We can fork |
Escape non-ASCII characters while JSON encoding.
e9cf2f0
to
dfc0b25
Compare
Finally, the issue is fixed in nspcc-dev/go-ordered-json#1, so just update the dependencies. |
Problem
States diff at 284177 block of testnet.
Solution
Escape non-ASCII characters during manifest.Extra to stackitem conversion. This PR makes us compatible up to 290k of testnet.
Manifest bytes (got from transaction script):
Items diff:
String representation of manifest.Extra bytes for NeoGo node:

String representation of manifest.Extra bytes for C# node:
