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

Improve CLI tx output #7978

Closed
4 tasks
robert-zaremba opened this issue Nov 18, 2020 · 1 comment · Fixed by #11818
Closed
4 tasks

Improve CLI tx output #7978

robert-zaremba opened this issue Nov 18, 2020 · 1 comment · Fixed by #11818
Assignees

Comments

@robert-zaremba
Copy link
Collaborator

Summary

Currently CLI tx command output doesn't display a MsgService result.
User experience is as good as easy it is to interact with the system.

Problem Definition

CLI query output is pretty informative and well formatted.

CLI tx output is not well formatted and doesn't display the msg processing result. Below is an example of tx bank send:

{"height":"607","txhash":"E9FEB1E120A900716413CFB5F6EDFFFB96E751B148A9692DB933A22951ABC801","codespace":"","code":0,"data":"0A060A0473656E64","raw_log":"[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"send\"},{\"key\":\"sender\",\"value\":\"regen:18yrp8exmrp396enlawyjau8ldsvm55mfwn0q5g\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"regen:1ky29knsw3l9veuvw6ehk9s0jxqkdpuuaet0tlz\"},{\"key\":\"sender\",\"value\":\"regen:18yrp8exmrp396enlawyjau8ldsvm55mfwn0q5g\"},{\"key\":\"amount\",\"value\":\"1000stake\"}]}]}]","logs":[{"msg_index":0,"log":"","events":[{"type":"message","attributes":[{"key":"action","value":"send"},{"key":"sender","value":"regen:18yrp8exmrp396enlawyjau8ldsvm55mfwn0q5g"},{"key":"module","value":"bank"}]},{"type":"transfer","attributes":[{"key":"recipient","value":"regen:1ky29knsw3l9veuvw6ehk9s0jxqkdpuuaet0tlz"},{"key":"sender","value":"regen:18yrp8exmrp396enlawyjau8ldsvm55mfwn0q5g"},{"key":"amount","value":"1000stake"}]}]}],"info":"","gas_wanted":"200000","gas_used":"57493","tx":null,"timestamp":""}

In contrast, querying for the transaction above will display a nicely formatted output:

./simapp q tx E9FEB1E120A900716413CFB5F6EDFFFB96E751B148A9692DB933A22951ABC801

code: 0
codespace: ""
data: 0A060A0473656E64
gas_used: "57493"
gas_wanted: "200000"
height: "607"
info: ""
logs:
- events:
  - attributes:
    - key: action
      value: send
    - key: sender
      value: regen:18yrp8exmrp396enlawyjau8ldsvm55mfwn0q5g
...

Proposal

In Stargate MsgService transactions have a well defined result. Proposals:

  1. Let's add message results to the transaction output
  2. Let's add a new flag: --json-out . When set to false (default) it will display the transaction output using nicely formatted YAML - in the same way we display cli q results. When --json-out=true it will display the output using machine readable JSON (as it's today) wit the message results.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@clevinson clevinson added this to the v0.41 milestone Nov 19, 2020
@alexanderbez
Copy link
Contributor

ACK. But no need to introduce a new flag. We already have an output flag.

@aaronc aaronc modified the milestones: v0.41, v0.42 Jan 6, 2021
@julienrbrt julienrbrt self-assigned this Apr 25, 2022
@julienrbrt julienrbrt linked a pull request Apr 28, 2022 that will close this issue
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants