From b6bea2b9c40a3829609f4337534e3096820e29c2 Mon Sep 17 00:00:00 2001 From: Jack Zampolin Date: Fri, 18 Jan 2019 09:14:50 -0800 Subject: [PATCH] Address @fedekunze PR comments --- PENDING.md | 3 ++- docs/gaia/gaiacli.md | 5 +++++ x/gov/client/utils/query.go | 9 +++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/PENDING.md b/PENDING.md index 4091a5ef666d..53bca949be03 100644 --- a/PENDING.md +++ b/PENDING.md @@ -18,7 +18,8 @@ BREAKING CHANGES * [\#3069](https://github.com/cosmos/cosmos-sdk/pull/3069) `--fee` flag renamed to `--fees` to support multiple coins * [\#3156](https://github.com/cosmos/cosmos-sdk/pull/3156) Remove unimplemented `gaiacli init` command * [\#2222] `gaiacli tx stake` -> `gaiacli tx staking`, `gaiacli query stake` -> `gaiacli query staking` - * [\#3320](https://github.com/cosmos/cosmos-sdk/pull/3320) Ensure all `gaiacli query` commands respect the `--output` and `--indent` flags + * [\#3320](https://github.com/cosmos/cosmos-sdk/pull/3320) Ensure all `gaiacli query` commands respect the `--output` and `--indent` flags + * [\#3268](https://github.com/cosmos/cosmos-sdk/issues/3268) Unify `params` queries call * Gaia * https://github.com/cosmos/cosmos-sdk/issues/2838 - Move store keys to constants diff --git a/docs/gaia/gaiacli.md b/docs/gaia/gaiacli.md index e60371c0a9c7..e1f629fb2019 100644 --- a/docs/gaia/gaiacli.md +++ b/docs/gaia/gaiacli.md @@ -624,6 +624,11 @@ To check the current governance parameters run: ```bash gaiacli query gov params +``` + +To query subsets of the governance parameters run: + +```bash gaiacli query gov param voting gaiacli query gov param tallying gaiacli query gov param deposit diff --git a/x/gov/client/utils/query.go b/x/gov/client/utils/query.go index d221ce6d715c..6bba2a17f162 100644 --- a/x/gov/client/utils/query.go +++ b/x/gov/client/utils/query.go @@ -22,6 +22,10 @@ type Proposer struct { Proposer string `json:"proposer"` } +func NewProposer(proposalID uint64, proposer string) Proposer { + return Proposer{proposalID, proposer} +} + func (p Proposer) String() string { return fmt.Sprintf(`ProposalID: %d Proposer: %s`, p.ProposalID, p.Proposer) @@ -225,10 +229,7 @@ func QueryProposerByTxQuery( // there should only be a single proposal under the given conditions if msg.Type() == gov.TypeMsgSubmitProposal { subMsg := msg.(gov.MsgSubmitProposal) - return Proposer{ - ProposalID: proposalID, - Proposer: subMsg.Proposer.String(), - }, nil + return NewProposer(proposalID, subMsg.Proposer.String()), nil } } }