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

chore(tm2): crypto.Address json Marshal #2756

Merged
merged 2 commits into from
Sep 6, 2024
Merged

Conversation

albttx
Copy link
Member

@albttx albttx commented Sep 4, 2024

Currently, on any sdk.Message, when doing a json.Marshal, the result look like:

{"amount": [{"denom": "ugnot", "amount": 10000000}], "to_address": [109, 116, 186, 231, 239, 107, 120, 148, 194, 146, 166, 150, 161, 244, 93, 201, 25, 61, 216, 223], "from_address": [70, 139, 48, 165, 116, 79, 88, 170, 84, 108, 231, 73, 227, 127, 127, 98, 252, 214, 167, 152]}

Now it's returning

{"from_address":"g1g69npft5fav254rvuay7xlmlvt7ddfucgvx8xf","to_address":"g1d46t4el0dduffs5j56t2razaeyvnmkxlduduuw","amount":[{"denom":"ugnot","amount":10000000}]}

This is already done for amino Marshalling, it's not for json.

@albttx albttx self-assigned this Sep 4, 2024
@albttx albttx requested review from jaekwon, moul and a team as code owners September 4, 2024 12:47
@github-actions github-actions bot added the 📦 🌐 tendermint v2 Issues or PRs tm2 related label Sep 4, 2024
Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 60.42%. Comparing base (65ee7a5) to head (de84f46).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
tm2/pkg/crypto/crypto.go 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2756      +/-   ##
==========================================
+ Coverage   60.24%   60.42%   +0.18%     
==========================================
  Files         562      563       +1     
  Lines       75031    75513     +482     
==========================================
+ Hits        45200    45631     +431     
- Misses      26458    26492      +34     
- Partials     3373     3390      +17     
Flag Coverage Δ
contribs/gnodev 61.46% <ø> (+0.06%) ⬆️
contribs/gnofaucet 14.46% <ø> (-0.86%) ⬇️
gno.land 67.21% <ø> (+2.64%) ⬆️
gnovm 64.46% <ø> (+0.12%) ⬆️
misc/genstd 80.54% <ø> (ø)
misc/logos 19.88% <ø> (ø)
tm2 62.08% <75.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ltzmaxwell
Copy link
Contributor

It looks good, but it would be better if there was a clear explanation of a specific use case.

@albttx
Copy link
Member Author

albttx commented Sep 4, 2024

@ltzmaxwell I've update the Issue message for better understanding of the situation.

Copy link
Contributor

@deelawn deelawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay to me 👍

Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible, let's go for it.

@thehowl thehowl merged commit 9396400 into master Sep 6, 2024
119 checks passed
@thehowl thehowl deleted the tm2/crypto-addr-json branch September 6, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants