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

WIP: CLI Response Formatting #3301

Closed
wants to merge 6 commits into from
Closed

WIP: CLI Response Formatting #3301

wants to merge 6 commits into from

Conversation

jackzampolin
Copy link
Member

(Replaces #3275)

Three are currently a number of issues about properly formatting CLI responses:

There are two major issues underlying the above reports:

  1. Calls to cliCtx.QueryWithData return bytes, many places in the cli don't respect --indent or -o json because the code isn't there
  2. Calls to utils.CompleteAndBroadcastTxCli don't respect the -o json or --indent flags either, and the human readable text format returned is not really readable by humans.

The first commit here unifies the params calls across the modules. Subsequent commits will generalize the approach for printing developed there to all other query CLI calls. Then the same will be done with the Tx calls. Testing will be added as well.

  • Wrote tests
  • Updated relevant documentation (docs/)
  • Added entries in PENDING.md with issue #
  • rereviewed Files changed in the github PR explorer

For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@codecov
Copy link

codecov bot commented Jan 15, 2019

Codecov Report

Merging #3301 into develop will decrease coverage by 0.6%.
The diff coverage is 3.9%.

@@             Coverage Diff             @@
##           develop    #3301      +/-   ##
===========================================
- Coverage    55.65%   55.04%   -0.61%     
===========================================
  Files          134      134              
  Lines         9716     9826     +110     
===========================================
+ Hits          5407     5409       +2     
- Misses        3965     4073     +108     
  Partials       344      344

@jackzampolin
Copy link
Member Author

I tried to bite off too much here. Also there were a large number of PRs merged that will make rebasing this difficult. I've decided to break the CLI output refactor into 3 PRs:

  • Query output - lowest hanging fruit. The meat of this PR. Replacement incoming
  • Refactor of CLIContext - Moving the Utils package in to avoid import cycles, moving the getters and setters to one file, making the CLIContext handle the creation and use of TxBuilder, moving these calls out of CLI commands.
  • Refactor Tx output - another small PR that will touch all the tx CLI commands.

@jackzampolin
Copy link
Member Author

Closed in favor of #3320

@jackzampolin jackzampolin mentioned this pull request Jan 18, 2019
7 tasks
@cwgoes cwgoes deleted the jack/cli-resp branch January 18, 2019 10:10
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.

1 participant