-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Adopt YAML as human-readable text output #4433
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4433 +/- ##
=========================================
- Coverage 54.58% 54.5% -0.09%
=========================================
Files 248 248
Lines 15967 15987 +20
=========================================
- Hits 8716 8714 -2
- Misses 6617 6636 +19
- Partials 634 637 +3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change LGTM, but I fear we may have to update a lot of the structs that are returned as responses.
some examples:
$ gaiacli q staking validators
- operatoraddress:
- 145
- 123
- 100
- 232
- 248
- 88
- 243
- 130
- 213
- 110
- 29
- 190
- 208
- 108
- 105
- 202
- 24
- 133
- 105
- 95
conspubkey:
- 6
- 117
- 186
- 8
- 211
- 175
- 221
- 74
- 229
- 35
- 72
- 126
- 75
- 16
- 12
- 70
- 37
- 220
- 88
- 187
- 173
- 1
- 31
- 96
- 18
- 35
- 71
- 16
- 246
- 140
- 84
- 239
jailed: false
status: 2
tokens: {}
delegatorshares: "100000000000000000000000000"
description:
moniker: node0
identity: ""
website: ""
details: ""
unbondingheight: 0
unbondingcompletiontime: 1970-01-01T00:00:00Z
commission:
rate: "0"
maxrate: "0"
maxchangerate: "0"
updatetime: 2019-05-29T13:18:00.214626Z
minselfdelegation: {}
why doesn't it use snakecase ? eg |
I was playing around this, can be https://godoc.org/gopkg.in/yaml.v2#Marshal the cause of this weird naming? seems the correct name have to be specified. I think what @alexanderbez said will help with the naming too. Should we specify their |
Wow, quite ugly indeed - let's see what I can do for it |
@alexanderbez please test again - I think addresses now look alright |
Seems healthier now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK.
If we postpone the copy-pastable names to fix them later seems ok now
I'm not sure what I'm doing wrong, but I still see this (using the latest commit
|
@alessio this definitely resolved the addresses -- thanks! My concern is with types that are defined outside the SDK (eg. How do you suggest we go about these types? Only thing that comes to mind is alias types or embedding. Kind of annoying, but I think manageable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple comments
@@ -113,8 +110,6 @@ func runShowCmd(cmd *cobra.Command, args []string) (err error) { | |||
printKeyAddress(info, bechKeyOut) | |||
case isShowPubKey: | |||
printPubKey(info, bechKeyOut) | |||
case isShowMultiSig: | |||
printMultiSigKeyInfo(info, bechKeyOut) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are removing this btw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need an extra flag anymore to display a tree of multisig keys
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g. this comes out of the box
- name: multi
type: multi
address: cosmos195eza9hyjx9w4amt3he37hqdcv66tjx8uwpapw
pubkey: cosmospub1ytql0csgqyfzd666axrjzq3zqh4r75vtgxx2cndqpgy60yc9tfu9xxgwmqqnshgkdw79wnuv8ufzd666axrjzq39tr0mg9xyvelgmq4qxvm9ytvf2flduzwfmhd62fkvpjunfmzg0u8h900d
mnemonic: ""
threshold: 1
pubkeys:
- address: cosmos1dj4ghqevu9y788gkc6gafdpgx6umh8qplffye4
pubkey: cosmospub1addwnpepqg3qt63l2x95rr9vfksq5zd8jvz457znry8dsqfct5txh0zhf7xr7yssng9
weight: 1
- address: cosmos104ytdpvrx9284zd50v9ep8c6j7pua7dkk0x3ek
pubkey: cosmospub1addwnpepqgj43ha5znzxvl5ds2srxdjj9ky4ylk7p8yamka9ymxqewf5a3y870kwj76
weight: 1
@alexanderbez I haven't yet stumbled across funnily serialized types, e.g. PubKey serialization seems to work. Concerning upstream types, we generally embed them into our structures/types, I think the cheapest and quicketst solution would be writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TestedACK. We'll need to do some spring cleaning and add YAML tags to all the necessary types. I'm sure this can easily be done via tool.
Closes: #4371
docs/
)clog add [section] [stanza] [message]
Files changed
in the github PR explorerFor Admin Use: