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

fix(gnokey): JSON-ify the query results from the 'gnokey' query #2249

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

linhpn99
Copy link
Contributor

@linhpn99 linhpn99 commented May 31, 2024

From issue of @leohhhn : #2232

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

Copy link

codecov bot commented May 31, 2024

Codecov Report

Attention: Patch coverage is 20.45455% with 70 lines in your changes missing coverage. Please review.

Project coverage is 54.65%. Comparing base (f6235fd) to head (49fe6af).

Files Patch % Lines
tm2/pkg/crypto/keys/client/utils.go 0.00% 38 Missing ⚠️
tm2/pkg/crypto/keys/client/broadcast.go 33.33% 12 Missing ⚠️
tm2/pkg/crypto/keys/client/maketx.go 33.33% 12 Missing ⚠️
tm2/pkg/crypto/keys/client/query.go 42.85% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2249      +/-   ##
==========================================
- Coverage   54.68%   54.65%   -0.03%     
==========================================
  Files         583      584       +1     
  Lines       78503    78570      +67     
==========================================
+ Hits        42930    42946      +16     
- Misses      32364    32416      +52     
+ Partials     3209     3208       -1     
Flag Coverage Δ
contribs/gnodev 23.81% <ø> (ø)
contribs/gnofaucet 14.46% <ø> (ø)
contribs/gnokeykc 0.00% <ø> (ø)
contribs/gnomd 0.00% <ø> (ø)
gno.land 62.54% <ø> (ø)
tm2 54.29% <20.45%> (-0.08%) ⬇️

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.

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.

I don't like this. The default output for vm/qeval should be simple and human-readable; JSON is helpful for working with scripting but harms readability. Ie. I want the result of vm/qeval to be simple to understand and close to what I get reading the result of maketx call.

I suggest having a -output flag, defaulting to text, but which can be set to json, for the gnokey query, maketx -broadcast and broadcast commands. This should print the JSON response from the node, with little modification. In the case of qeval, this can be simply qres.Response.

tm2/pkg/crypto/keys/client/query.go Outdated Show resolved Hide resolved
@linhpn99 linhpn99 requested a review from thehowl June 1, 2024 02:14
@linhpn99 linhpn99 requested a review from moul as a code owner June 1, 2024 02:50
@linhpn99
Copy link
Contributor Author

linhpn99 commented Jun 1, 2024

I don't like this. The default output for vm/qeval should be simple and human-readable; JSON is helpful for working with scripting but harms readability. Ie. I want the result of vm/qeval to be simple to understand and close to what I get reading the result of maketx call.

I suggest having a -output flag, defaulting to text, but which can be set to json, for the gnokey query, maketx -broadcast and broadcast commands. This should print the JSON response from the node, with little modification. In the case of qeval, this can be simply qres.Response.

agree with u, so that i will also format response when calling maketx --broadcast.

@moul
Copy link
Member

moul commented Jun 4, 2024

We need to align this pull request with #1776 to ensure consistency and idiomatic usage.

I suggest waiting for #1776 to be merged before merging this one.

cc @gfanton

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: In Progress
Status: In Review
Development

Successfully merging this pull request may close these issues.

None yet

3 participants