gno icon indicating copy to clipboard operation
gno copied to clipboard

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

Open linhpn99 opened this issue 1 year ago • 3 comments

From issue of @leohhhn : https://github.com/gnolang/gno/issues/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.

linhpn99 avatar May 31 '24 04:05 linhpn99

Codecov Report

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

Files with missing lines Patch % Lines
tm2/pkg/crypto/keys/client/utils.go 0.00% 43 Missing :warning:
tm2/pkg/crypto/keys/client/maketx.go 31.57% 13 Missing :warning:
tm2/pkg/crypto/keys/client/query.go 42.85% 8 Missing :warning:
tm2/pkg/crypto/keys/client/broadcast.go 50.00% 6 Missing :warning:

:loudspeaker: Thoughts on this report? Let us know!

codecov[bot] avatar May 31 '24 04:05 codecov[bot]

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.

linhpn99 avatar Jun 01 '24 02:06 linhpn99

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 avatar Jun 04 '24 08:06 moul

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[bot] avatar Nov 14 '24 01:11 github-actions[bot]

I'm closing this PR as the author has not been contributing to Gno for a while.

Feel free to re-open this PR, or fork this PR and propose a new one, considering the latest comments and any surrounding discussion.

thehowl avatar Apr 08 '25 16:04 thehowl