Skip to content
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

Implement lossless stackitem to json conversion #1242

Merged
merged 9 commits into from
Aug 4, 2020
Merged

Conversation

fyrchik
Copy link
Contributor

@fyrchik fyrchik commented Jul 29, 2020

Close #1190 .

@codecov
Copy link

codecov bot commented Jul 29, 2020

Codecov Report

Merging #1242 into master will increase coverage by 3.69%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1242      +/-   ##
==========================================
+ Coverage   62.86%   66.55%   +3.69%     
==========================================
  Files         200      200              
  Lines       17251    17304      +53     
==========================================
+ Hits        10844    11516     +672     
+ Misses       5823     5175     -648     
- Partials      584      613      +29     
Impacted Files Coverage Δ
pkg/vm/stack.go 95.95% <100.00%> (+0.10%) ⬆️
pkg/vm/stackitem/json.go 100.00% <100.00%> (ø)
pkg/vm/stackitem/type.go 100.00% <100.00%> (+13.33%) ⬆️
pkg/rpc/client/wsclient.go 84.56% <0.00%> (+1.34%) ⬆️
pkg/core/storage/memory_store.go 100.00% <0.00%> (+6.55%) ⬆️
pkg/network/server.go 26.85% <0.00%> (+15.01%) ⬆️
pkg/core/storage/store.go 42.30% <0.00%> (+15.38%) ⬆️
pkg/network/tcp_transport.go 40.00% <0.00%> (+20.00%) ⬆️
pkg/vm/emit/emit.go 92.30% <0.00%> (+23.07%) ⬆️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f24e707...7b4118b. Read the comment docs.

pkg/vm/stackitem/json.go Outdated Show resolved Hide resolved
pkg/vm/stackitem/json.go Outdated Show resolved Hide resolved
pkg/rpc/response/result/application_log.go Outdated Show resolved Hide resolved
Adjust only string representation.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
There are 2 kinds of JSON marshaling:
1. Lossy raw marshaling, when type information is lost and
    map keys are expected to be valid utf-8 strings.
2. Almost lossless marshaling, which can handle any non-recursive item.
    Interop value preserves only type.

This commit implements the second.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Name is now a separate field.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
@roman-khimov roman-khimov merged commit fa5ff8d into master Aug 4, 2020
@roman-khimov roman-khimov deleted the fix/json branch August 4, 2020 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check stackitem jsonization
3 participants