Skip to content

Commit

Permalink
Merge PR #2802: Correct the usage of misspelling of English word 'dep…
Browse files Browse the repository at this point in the history
…ositor'.

Throughout the codebase the misspelling 'depositer' of the English word
'depositor' has been used. This commit applies a global search and
replace to correct the misspelling.
  • Loading branch information
John McDowall authored and cwgoes committed Nov 21, 2018
1 parent 3e68e44 commit f09fa33
Show file tree
Hide file tree
Showing 21 changed files with 116 additions and 112 deletions.
1 change: 1 addition & 0 deletions PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ BREAKING CHANGES
* [\#2752](https://github.com/cosmos/cosmos-sdk/pull/2752) Don't hardcode bondable denom.
* [\#2019](https://github.com/cosmos/cosmos-sdk/issues/2019) Cap total number of signatures. Current per-transaction limit is 7, and if that is exceeded transaction is rejected.
* [\#2801](https://github.com/cosmos/cosmos-sdk/pull/2801) Remove AppInit structure.
* [\#2798](https://github.com/cosmos/cosmos-sdk/issues/2798) Governance API has miss-spelled English word in JSON response ('depositer' -> 'depositor')

* Tendermint

Expand Down
20 changes: 10 additions & 10 deletions client/lcd/lcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -830,11 +830,11 @@ func TestProposalsQuery(t *testing.T) {
require.Equal(t, proposalID3, (proposals[2]).GetProposalID())

// Test query deposited by addr1
proposals = getProposalsFilterDepositer(t, port, addrs[0])
proposals = getProposalsFilterDepositor(t, port, addrs[0])
require.Equal(t, proposalID1, (proposals[0]).GetProposalID())

// Test query deposited by addr2
proposals = getProposalsFilterDepositer(t, port, addrs[1])
proposals = getProposalsFilterDepositor(t, port, addrs[1])
require.Equal(t, proposalID2, (proposals[0]).GetProposalID())
require.Equal(t, proposalID3, (proposals[1]).GetProposalID())

Expand All @@ -848,7 +848,7 @@ func TestProposalsQuery(t *testing.T) {
require.Equal(t, proposalID3, (proposals[0]).GetProposalID())

// Test query voted and deposited by addr1
proposals = getProposalsFilterVoterDepositer(t, port, addrs[0], addrs[0])
proposals = getProposalsFilterVoterDepositor(t, port, addrs[0], addrs[0])
require.Equal(t, proposalID2, (proposals[0]).GetProposalID())

// Test query votes on Proposal 2
Expand Down Expand Up @@ -1315,8 +1315,8 @@ func getDeposits(t *testing.T, port string, proposalID uint64) []gov.Deposit {
return deposits
}

func getDeposit(t *testing.T, port string, proposalID uint64, depositerAddr sdk.AccAddress) gov.Deposit {
res, body := Request(t, port, "GET", fmt.Sprintf("/gov/proposals/%d/deposits/%s", proposalID, depositerAddr), nil)
func getDeposit(t *testing.T, port string, proposalID uint64, depositorAddr sdk.AccAddress) gov.Deposit {
res, body := Request(t, port, "GET", fmt.Sprintf("/gov/proposals/%d/deposits/%s", proposalID, depositorAddr), nil)
require.Equal(t, http.StatusOK, res.StatusCode, body)
var deposit gov.Deposit
err := cdc.UnmarshalJSON([]byte(body), &deposit)
Expand Down Expand Up @@ -1361,8 +1361,8 @@ func getProposalsAll(t *testing.T, port string) []gov.Proposal {
return proposals
}

func getProposalsFilterDepositer(t *testing.T, port string, depositerAddr sdk.AccAddress) []gov.Proposal {
res, body := Request(t, port, "GET", fmt.Sprintf("/gov/proposals?depositer=%s", depositerAddr), nil)
func getProposalsFilterDepositor(t *testing.T, port string, depositorAddr sdk.AccAddress) []gov.Proposal {
res, body := Request(t, port, "GET", fmt.Sprintf("/gov/proposals?depositor=%s", depositorAddr), nil)
require.Equal(t, http.StatusOK, res.StatusCode, body)

var proposals []gov.Proposal
Expand All @@ -1381,8 +1381,8 @@ func getProposalsFilterVoter(t *testing.T, port string, voterAddr sdk.AccAddress
return proposals
}

func getProposalsFilterVoterDepositer(t *testing.T, port string, voterAddr, depositerAddr sdk.AccAddress) []gov.Proposal {
res, body := Request(t, port, "GET", fmt.Sprintf("/gov/proposals?depositer=%s&voter=%s", depositerAddr, voterAddr), nil)
func getProposalsFilterVoterDepositor(t *testing.T, port string, voterAddr, depositorAddr sdk.AccAddress) []gov.Proposal {
res, body := Request(t, port, "GET", fmt.Sprintf("/gov/proposals?depositor=%s&voter=%s", depositorAddr, voterAddr), nil)
require.Equal(t, http.StatusOK, res.StatusCode, body)

var proposals []gov.Proposal
Expand Down Expand Up @@ -1444,7 +1444,7 @@ func doDeposit(t *testing.T, port, seed, name, password string, proposerAddr sdk

// deposit on proposal
jsonStr := []byte(fmt.Sprintf(`{
"depositer": "%s",
"depositor": "%s",
"amount": [{ "denom": "%s", "amount": "%d" }],
"base_req": {
"name": "%s",
Expand Down
18 changes: 9 additions & 9 deletions client/lcd/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1226,8 +1226,8 @@ paths:
required: false
type: string
- in: query
name: depositer
description: depositer address
name: depositor
description: depositor address
required: false
type: string
- in: query
Expand Down Expand Up @@ -1281,7 +1281,7 @@ paths:
properties:
base_req:
"$ref": "#/definitions/BaseReq"
depositer:
depositor:
"$ref": "#/definitions/Address"
amount:
type: array
Expand Down Expand Up @@ -1441,10 +1441,10 @@ paths:
description: Invalid proposal id
500:
description: Internal Server Error
/gov/proposals/{proposalId}/deposits/{depositer}:
/gov/proposals/{proposalId}/deposits/{depositor}:
get:
summary: Query deposit
description: Query deposit by proposalId and depositer address
description: Query deposit by proposalId and depositor address
produces:
- application/json
tags:
Expand All @@ -1456,8 +1456,8 @@ paths:
required: true
in: path
- type: string
description: Bech32 depositer address
name: depositer
description: Bech32 depositor address
name: depositor
required: true
in: path
responses:
Expand All @@ -1466,7 +1466,7 @@ paths:
schema:
$ref: "#/definitions/Deposit"
400:
description: Invalid proposal id or depositer address
description: Invalid proposal id or depositor address
404:
description: Found no deposit
500:
Expand Down Expand Up @@ -1934,7 +1934,7 @@ definitions:
"$ref": "#/definitions/Coin"
proposal_id:
type: integer
depositer:
depositor:
"$ref": "#/definitions/Address"
TallyResult:
type: object
Expand Down
4 changes: 2 additions & 2 deletions cmd/gaia/cli_test/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func TestGaiaCLISubmitProposal(t *testing.T) {
require.Equal(t, " 1 - Test", proposalsQuery)

deposit := executeGetDeposit(t,
fmt.Sprintf("gaiacli query gov deposit --proposal-id=1 --depositer=%s --output=json %v",
fmt.Sprintf("gaiacli query gov deposit --proposal-id=1 --depositor=%s --output=json %v",
fooAddr, flags))
require.Equal(t, int64(5), deposit.Amount.AmountOf(stakeTypes.DefaultBondDenom).Int64())

Expand Down Expand Up @@ -394,7 +394,7 @@ func TestGaiaCLISubmitProposal(t *testing.T) {
require.Equal(t, int64(15), deposits[0].Amount.AmountOf(stakeTypes.DefaultBondDenom).Int64())

deposit = executeGetDeposit(t,
fmt.Sprintf("gaiacli query gov deposit --proposal-id=1 --depositer=%s --output=json %v",
fmt.Sprintf("gaiacli query gov deposit --proposal-id=1 --depositor=%s --output=json %v",
fooAddr, flags))
require.Equal(t, int64(15), deposit.Amount.AmountOf(stakeTypes.DefaultBondDenom).Int64())

Expand Down
19 changes: 11 additions & 8 deletions docs/gaia/gaiacli.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ There are three types of key representations that are used:
- Derived from account keys generated by `gaiacli keys add`
- Used to receive funds
- e.g. `cosmos15h6vd5f0wqps26zjlwrc6chah08ryu4hzzdwhc`

* `cosmosvaloper`
* Used to associate a validator to it's operator
* Used to invoke staking commands
* e.g. `cosmosvaloper1carzvgq3e6y3z5kz5y6gxp3wpy3qdrv928vyah`
- Used to associate a validator to it's operator
- Used to invoke staking commands
- e.g. `cosmosvaloper1carzvgq3e6y3z5kz5y6gxp3wpy3qdrv928vyah`

- `cosmospub`
- Derived from account keys generated by `gaiacli keys add`
- e.g. `cosmospub1zcjduc3q7fu03jnlu2xpl75s2nkt7krm6grh4cc5aqth73v0zwmea25wj2hsqhlqzm`
Expand Down Expand Up @@ -72,7 +74,7 @@ View the validator pubkey for your node by typing:
gaiad tendermint show-validator
```

Note that this is the Tendermint signing key, *not* the operator key you will use in delegation transactions.
Note that this is the Tendermint signing key, _not_ the operator key you will use in delegation transactions.

::: danger Warning
We strongly recommend _NOT_ using the same passphrase for multiple keys. The Tendermint team and the Interchain Foundation will not be responsible for the loss of funds.
Expand Down Expand Up @@ -211,7 +213,7 @@ gaiacli query stake validator <account_cosmosval>

#### Bond Tokens

On the testnet, we delegate `steak` instead of `atom`. Here's how you can bond tokens to a testnet validator (*i.e.* delegate):
On the testnet, we delegate `steak` instead of `atom`. Here's how you can bond tokens to a testnet validator (_i.e._ delegate):

```bash
gaiacli tx stake delegate \
Expand Down Expand Up @@ -304,7 +306,7 @@ gaiacli tx stake redelegate \
--chain-id=<chain_id>
```

Here you can also redelegate a specific `shares-amount` or a `shares-fraction` with the corresponding flags.
Here you can also redelegate a specific `shares-amount` or a `shares-fraction` with the corresponding flags.

The redelegation will be automatically completed when the unbonding period has passed.

Expand Down Expand Up @@ -367,6 +369,7 @@ With the `pool` command you will get the values for:
##### Query Delegations To Validator

You can also query all of the delegations to a particular validator:

```bash
gaiacli query delegations-to <account_cosmosval>
```
Expand Down Expand Up @@ -418,7 +421,7 @@ Or query all available proposals:
gaiacli query gov proposals
```

You can also query proposals filtered by `voter` or `depositer` by using the corresponding flags.
You can also query proposals filtered by `voter` or `depositor` by using the corresponding flags.

#### Increase deposit

Expand Down Expand Up @@ -447,7 +450,7 @@ You can also query a deposit submitted by a specific address:
```bash
gaiacli query gov deposit \
--proposal-id=<proposal_id> \
--depositer=<account_cosmos>
--depositor=<account_cosmos>
```

#### Vote on a proposal
Expand Down
2 changes: 1 addition & 1 deletion docs/spec/governance/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ If proposal's deposit does not reach `MinDeposit` before `MaxDepositPeriod`, pro
There is one instance where Atom holders that deposits can be refunded:
* If the proposal is accepted.

Then, deposits will automatically be refunded to their respective depositer.
Then, deposits will automatically be refunded to their respective depositor.

### Proposal types

Expand Down
8 changes: 4 additions & 4 deletions docs/spec/governance/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ const (

```go
type Deposit struct {
Amount sdk.Coins // Amount of coins deposited by depositer
Depositer crypto.address // Address of depositer
Amount sdk.Coins // Amount of coins deposited by depositor
Depositor crypto.address // Address of depositor
}
```

Expand Down Expand Up @@ -185,8 +185,8 @@ And the pseudocode for the `ProposalProcessingQueue`:
// proposal was accepted at the end of the voting period
// refund deposits (non-voters already punished)
proposal.CurrentStatus = ProposalStatusAccepted
for each (amount, depositer) in proposal.Deposits
depositer.AtomBalance += amount
for each (amount, depositor) in proposal.Deposits
depositor.AtomBalance += amount

else
// proposal was rejected
Expand Down
20 changes: 10 additions & 10 deletions x/gov/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ func GetCmdQueryProposals(queryRoute string, cdc *codec.Codec) *cobra.Command {
Use: "proposals",
Short: "Query proposals with optional filters",
RunE: func(cmd *cobra.Command, args []string) error {
bechDepositerAddr := viper.GetString(flagDepositer)
bechDepositorAddr := viper.GetString(flagDepositor)
bechVoterAddr := viper.GetString(flagVoter)
strProposalStatus := viper.GetString(flagStatus)
numLimit := uint64(viper.GetInt64(flagNumLimit))

var depositerAddr sdk.AccAddress
var depositorAddr sdk.AccAddress
var voterAddr sdk.AccAddress
var proposalStatus gov.ProposalStatus

params := gov.NewQueryProposalsParams(proposalStatus, numLimit, voterAddr, depositerAddr)
params := gov.NewQueryProposalsParams(proposalStatus, numLimit, voterAddr, depositorAddr)

if len(bechDepositerAddr) != 0 {
depositerAddr, err := sdk.AccAddressFromBech32(bechDepositerAddr)
if len(bechDepositorAddr) != 0 {
depositorAddr, err := sdk.AccAddressFromBech32(bechDepositorAddr)
if err != nil {
return err
}
params.Depositer = depositerAddr
params.Depositor = depositorAddr
}

if len(bechVoterAddr) != 0 {
Expand Down Expand Up @@ -115,7 +115,7 @@ func GetCmdQueryProposals(queryRoute string, cdc *codec.Codec) *cobra.Command {
}

cmd.Flags().String(flagNumLimit, "", "(optional) limit to latest [number] proposals. Defaults to all proposals")
cmd.Flags().String(flagDepositer, "", "(optional) filter by proposals deposited on by depositer")
cmd.Flags().String(flagDepositor, "", "(optional) filter by proposals deposited on by depositor")
cmd.Flags().String(flagVoter, "", "(optional) filter by proposals voted on by voted")
cmd.Flags().String(flagStatus, "", "(optional) filter proposals by proposal status, status: deposit_period/voting_period/passed/rejected")

Expand Down Expand Up @@ -199,12 +199,12 @@ func GetCmdQueryDeposit(queryRoute string, cdc *codec.Codec) *cobra.Command {
cliCtx := context.NewCLIContext().WithCodec(cdc)
proposalID := uint64(viper.GetInt64(flagProposalID))

depositerAddr, err := sdk.AccAddressFromBech32(viper.GetString(flagDepositer))
depositorAddr, err := sdk.AccAddressFromBech32(viper.GetString(flagDepositor))
if err != nil {
return err
}

params := gov.NewQueryDepositParams(proposalID, depositerAddr)
params := gov.NewQueryDepositParams(proposalID, depositorAddr)
bz, err := cdc.MarshalJSON(params)
if err != nil {
return err
Expand All @@ -221,7 +221,7 @@ func GetCmdQueryDeposit(queryRoute string, cdc *codec.Codec) *cobra.Command {
}

cmd.Flags().String(flagProposalID, "", "proposalID of proposal deposited on")
cmd.Flags().String(flagDepositer, "", "bech32 depositer address")
cmd.Flags().String(flagDepositor, "", "bech32 depositor address")

return cmd
}
Expand Down
6 changes: 3 additions & 3 deletions x/gov/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
flagDeposit = "deposit"
flagVoter = "voter"
flagOption = "option"
flagDepositer = "depositer"
flagDepositor = "depositor"
flagStatus = "status"
flagNumLimit = "limit"
flagProposal = "proposal"
Expand Down Expand Up @@ -165,7 +165,7 @@ func GetCmdDeposit(cdc *codec.Codec) *cobra.Command {
WithCodec(cdc).
WithAccountDecoder(cdc)

depositerAddr, err := cliCtx.GetFromAddress()
depositorAddr, err := cliCtx.GetFromAddress()
if err != nil {
return err
}
Expand All @@ -177,7 +177,7 @@ func GetCmdDeposit(cdc *codec.Codec) *cobra.Command {
return err
}

msg := gov.NewMsgDeposit(depositerAddr, proposalID, amount)
msg := gov.NewMsgDeposit(depositorAddr, proposalID, amount)
err = msg.ValidateBasic()
if err != nil {
return err
Expand Down
Loading

0 comments on commit f09fa33

Please sign in to comment.