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

Draft
wants to merge 42 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.74%. Comparing base (fa98780) to head (94f0872).
Report is 201 commits behind head on master.

Files with missing lines Patch % Lines
tm2/pkg/crypto/keys/client/utils.go 0.00% 43 Missing ⚠️
tm2/pkg/crypto/keys/client/maketx.go 31.57% 13 Missing ⚠️
tm2/pkg/crypto/keys/client/query.go 42.85% 8 Missing ⚠️
tm2/pkg/crypto/keys/client/broadcast.go 50.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2249      +/-   ##
==========================================
- Coverage   55.01%   54.74%   -0.27%     
==========================================
  Files         595      594       -1     
  Lines       79731    79308     -423     
==========================================
- Hits        43866    43420     -446     
- Misses      32548    32622      +74     
+ Partials     3317     3266      -51     
Flag Coverage Δ
contribs/gnodev 26.00% <ø> (ø)
contribs/gnofaucet 14.46% <ø> (ø)
contribs/gnokeykc 0.00% <ø> (ø)
contribs/gnomd 0.00% <ø> (ø)
gno.land 64.24% <ø> (ø)
tm2 54.33% <20.45%> (-0.13%) ⬇️

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

@moul moul marked this pull request as draft July 16, 2024 04:54
Copy link

This PR is stale because it has been open 3 months with no activity. Remove stale label or comment or this will be closed in 3 months.

@github-actions github-actions bot added Stale and removed Stale labels Nov 14, 2024
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: Backlog
Development

Successfully merging this pull request may close these issues.

3 participants