penumbra icon indicating copy to clipboard operation
penumbra copied to clipboard

`pcli query governance list-proposals` is hard to read

Open plaidfinch opened this issue 9 months ago • 2 comments

Describe the bug

$ pcli query governance list-proposals -i
#0 ProposalState { state: Some(Finished(Finished { outcome: Some(ProposalOutcome { outcome: Some(Passed(Passed)) }) })) }    lower proposal voting duration to 4h
#1 ProposalState { state: Some(Finished(Finished { outcome: Some(ProposalOutcome { outcome: Some(Slashed(Slashed { withdrawn: None })) }) })) }    lower proposal voting duration to 4h (#2)
#2 ProposalState { state: Some(Finished(Finished { outcome: Some(ProposalOutcome { outcome: Some(Passed(Passed)) }) })) }    lower proposal voting duration to 1h
#3 ProposalState { state: Some(Finished(Finished { outcome: Some(ProposalOutcome { outcome: Some(Failed(Failed { withdrawn: None })) }) })) }    coffee or tea?
#4 ProposalState { state: Some(Finished(Finished { outcome: Some(ProposalOutcome { outcome: Some(Passed(Passed)) }) })) }    upgrade to 0.76.0

This presents information in a way that is very hard to scan because it uses the debug representation of the proposal outcome.

Expected behavior

It should probably look something like this:

$ pcli query governance list-proposals -i
#0 [PASSED] lower proposal voting duration to 4h
#1 [SLASHED] lower proposal voting duration to 4h (#2)
#2 [PASSED] lower proposal voting duration to 1h
#3 [FAILED] coffee or tea?
#4 [PASSED] upgrade to 0.76.0

To do this, likely the most expedient way is to make a Display impl for ProposalState and use it.

plaidfinch avatar May 25 '24 01:05 plaidfinch