Skip to content

pcli query governance list-proposals is hard to read #4480

Open
@plaidfinch

Description

@plaidfinch

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-clientArea: Design and implementation for client functionalityA-governanceArea: GovernanceC-enhancementCategory: an enhancement to the codebaseE-easyEffort: Easy_P-lowPriority: lowneeds-refinementunclear, incomplete, or stub issue that needs work

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions