Skip to content

Commit

Permalink
Rename stake/ to staking/ (cosmos#3280)
Browse files Browse the repository at this point in the history
  • Loading branch information
rigelrozanski authored and jackzampolin committed Jan 11, 2019
1 parent df56761 commit 78a2135
Show file tree
Hide file tree
Showing 132 changed files with 1,024 additions and 1,021 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ BREAKING CHANGES
* [\#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')
* [\#2943](https://github.com/cosmos/cosmos-sdk/pull/2943) Transaction action tags equal the message type. Stake EndBlocker tags are included.
* [\#2943](https://github.com/cosmos/cosmos-sdk/pull/2943) Transaction action tags equal the message type. Staking EndBlocker tags are included.

* Tendermint
* Update to Tendermint 0.27.0
Expand Down Expand Up @@ -1062,7 +1062,7 @@ BREAKING CHANGES
* All module keepers now require a codespace, see basecoin or democoin for usage
* Many changes to names throughout
* Type as a prefix naming convention applied (ex. BondMsg -> MsgBond)
* Removed redundancy in names (ex. stake.StakeKeeper -> stake.Keeper)
* Removed redundancy in names (ex. stake.StakingKeeper -> stake.Keeper)
* Removed SealedAccountMapper
* gaiad init now requires use of `--name` flag
* Removed Get from Msg interface
Expand Down
14 changes: 8 additions & 6 deletions PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,32 @@
BREAKING CHANGES

* Gaia REST API (`gaiacli advanced rest-server`)
* [gaia-lite] [\#2182] Renamed and merged all redelegations endpoints into `/stake/redelegations`
* [gaia-lite] [\#2182] Renamed and merged all redelegations endpoints into `/staking/redelegations`
* [\#3176](https://github.com/cosmos/cosmos-sdk/issues/3176) `tx/sign` endpoint now expects `BaseReq` fields as nested object.
* [\#2222] all endpoints renamed from `/stake` -> `/staking`

* Gaia CLI (`gaiacli`)
* [\#810](https://github.com/cosmos/cosmos-sdk/issues/810) Don't fallback to any default values for chain ID.
* Users need to supply chain ID either via config file or the `--chain-id` flag.
* Change `chain_id` and `trust_node` in `gaiacli` configuration to `chain-id` and `trust-node` respectively.
* [\#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`

* Gaia
* https://github.com/cosmos/cosmos-sdk/issues/2838 - Move store keys to constants
* [\#3162](https://github.com/cosmos/cosmos-sdk/issues/3162) The `--gas` flag now takes `auto` instead of `simulate`
in order to trigger a simulation of the tx before the actual execution.

* Gaia REST API
* [\#3176](https://github.com/cosmos/cosmos-sdk/issues/3176) `tx/sign` endpoint now expects `BaseReq` fields as nested object.

* SDK
* [stake] \#2513 Validator power type from Dec -> Int
* [stake] \#3233 key and value now contain duplicate fields to simplify code
* [staking] \#2513 Validator power type from Dec -> Int
* [staking] \#3233 key and value now contain duplicate fields to simplify code
* [\#3064](https://github.com/cosmos/cosmos-sdk/issues/3064) Sanitize `sdk.Coin` denom. Coins denoms are now case insensitive, i.e. 100fooToken equals to 100FOOTOKEN.
* [\#3195](https://github.com/cosmos/cosmos-sdk/issues/3195) Allows custom configuration for syncable strategy
* [\#3242](https://github.com/cosmos/cosmos-sdk/issues/3242) Fix infinite gas
meter utilization during aborted ante handler executions.
* [\#2222] [x/staking] `/stake` -> `/staking` module rename

* Tendermint
* \#3279 Upgrade to Tendermint 0.28.0-dev0
Expand All @@ -45,7 +47,7 @@ FEATURES
`query gov proposer [proposal-id]` to query for a proposal's proposer.

* Gaia
* [\#2182] [x/stake] Added querier for querying a single redelegation
* [\#2182] [x/staking] Added querier for querying a single redelegation

* SDK
* \#2996 Update the `AccountKeeper` to contain params used in the context of
Expand Down
52 changes: 26 additions & 26 deletions client/lcd/lcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest"
"github.com/cosmos/cosmos-sdk/x/gov"
"github.com/cosmos/cosmos-sdk/x/slashing"
"github.com/cosmos/cosmos-sdk/x/stake"
stakeTypes "github.com/cosmos/cosmos-sdk/x/stake/types"
"github.com/cosmos/cosmos-sdk/x/staking"
stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)

const (
Expand All @@ -41,7 +41,7 @@ const (
altPw = "12345678901"
)

var fees = sdk.Coins{sdk.NewInt64Coin(stakeTypes.DefaultBondDenom, 5)}
var fees = sdk.Coins{sdk.NewInt64Coin(stakingTypes.DefaultBondDenom, 5)}

func init() {
mintkey.BcryptSecurityParameter = 1
Expand Down Expand Up @@ -176,14 +176,14 @@ func TestCoinSend(t *testing.T) {
coins := acc.GetCoins()
expectedBalance := initialBalance[0].Minus(fees[0])

require.Equal(t, stakeTypes.DefaultBondDenom, coins[0].Denom)
require.Equal(t, stakingTypes.DefaultBondDenom, coins[0].Denom)
require.Equal(t, expectedBalance.Amount.SubRaw(1), coins[0].Amount)
expectedBalance = coins[0]

// query receiver
acc2 := getAccount(t, port, receiveAddr)
coins2 := acc2.GetCoins()
require.Equal(t, stakeTypes.DefaultBondDenom, coins2[0].Denom)
require.Equal(t, stakingTypes.DefaultBondDenom, coins2[0].Denom)
require.Equal(t, int64(1), coins2[0].Amount.Int64())

// test failure with too little gas
Expand Down Expand Up @@ -217,7 +217,7 @@ func TestCoinSend(t *testing.T) {
require.Nil(t, json.Unmarshal([]byte(body), &responseBody))

acc = getAccount(t, port, addr)
require.Equal(t, expectedBalance.Amount, acc.GetCoins().AmountOf(stakeTypes.DefaultBondDenom))
require.Equal(t, expectedBalance.Amount, acc.GetCoins().AmountOf(stakingTypes.DefaultBondDenom))

res, body, _ = doTransferWithGas(t, port, seed, name1, memo, pw, addr,
fmt.Sprintf("%d", responseBody.GasEstimate), 1.0, false, false, fees)
Expand All @@ -232,7 +232,7 @@ func TestCoinSend(t *testing.T) {

acc = getAccount(t, port, addr)
expectedBalance = expectedBalance.Minus(fees[0])
require.Equal(t, expectedBalance.Amount.SubRaw(1), acc.GetCoins().AmountOf(stakeTypes.DefaultBondDenom))
require.Equal(t, expectedBalance.Amount.SubRaw(1), acc.GetCoins().AmountOf(stakingTypes.DefaultBondDenom))
}

func TestCoinSendGenerateSignAndBroadcast(t *testing.T) {
Expand Down Expand Up @@ -338,14 +338,14 @@ func TestPoolParamsQuery(t *testing.T) {
cleanup, _, _, port := InitializeTestLCD(t, 1, []sdk.AccAddress{addr})
defer cleanup()

defaultParams := stake.DefaultParams()
defaultParams := staking.DefaultParams()

params := getStakeParams(t, port)
params := getStakingParams(t, port)
require.True(t, defaultParams.Equal(params))

pool := getStakePool(t, port)
pool := getStakingPool(t, port)

initialPool := stake.InitialPool()
initialPool := staking.InitialPool()
initialPool.LooseTokens = initialPool.LooseTokens.Add(sdk.NewInt(100))
initialPool.BondedTokens = initialPool.BondedTokens.Add(sdk.NewInt(100)) // Delegate tx on GaiaAppGenState
initialPool.LooseTokens = initialPool.LooseTokens.Add(sdk.NewInt(50)) // freeFermionsAcc = 50 on GaiaAppGenState
Expand Down Expand Up @@ -418,7 +418,7 @@ func TestBonding(t *testing.T) {
acc = getAccount(t, port, addr)
coins := acc.GetCoins()
expectedBalance := initialBalance[0].Minus(fees[0])
require.Equal(t, expectedBalance.Amount.SubRaw(60), coins.AmountOf(stakeTypes.DefaultBondDenom))
require.Equal(t, expectedBalance.Amount.SubRaw(60), coins.AmountOf(stakingTypes.DefaultBondDenom))
expectedBalance = coins[0]

// query delegation
Expand Down Expand Up @@ -453,8 +453,8 @@ func TestBonding(t *testing.T) {
coins = acc.GetCoins()
expectedBalance = expectedBalance.Minus(fees[0])
require.True(t,
expectedBalance.Amount.LT(coins.AmountOf(stakeTypes.DefaultBondDenom)) ||
expectedBalance.Amount.Equal(coins.AmountOf(stakeTypes.DefaultBondDenom)),
expectedBalance.Amount.LT(coins.AmountOf(stakingTypes.DefaultBondDenom)) ||
expectedBalance.Amount.Equal(coins.AmountOf(stakingTypes.DefaultBondDenom)),
"should get tokens back from automatic withdrawal after an unbonding delegation",
)
expectedBalance = coins[0]
Expand All @@ -481,8 +481,8 @@ func TestBonding(t *testing.T) {
acc = getAccount(t, port, addr)
expectedBalance = expectedBalance.Minus(fees[0])
require.True(t,
expectedBalance.Amount.LT(coins.AmountOf(stakeTypes.DefaultBondDenom)) ||
expectedBalance.Amount.Equal(coins.AmountOf(stakeTypes.DefaultBondDenom)),
expectedBalance.Amount.LT(coins.AmountOf(stakingTypes.DefaultBondDenom)) ||
expectedBalance.Amount.Equal(coins.AmountOf(stakingTypes.DefaultBondDenom)),
"should get tokens back from automatic withdrawal after an unbonding delegation",
)

Expand Down Expand Up @@ -559,7 +559,7 @@ func TestSubmitProposal(t *testing.T) {
// verify balance
acc = getAccount(t, port, addr)
expectedBalance := initialBalance[0].Minus(fees[0])
require.Equal(t, expectedBalance.Amount.SubRaw(5), acc.GetCoins().AmountOf(stakeTypes.DefaultBondDenom))
require.Equal(t, expectedBalance.Amount.SubRaw(5), acc.GetCoins().AmountOf(stakingTypes.DefaultBondDenom))

// query proposal
proposal := getProposal(t, port, proposalID)
Expand Down Expand Up @@ -593,7 +593,7 @@ func TestDeposit(t *testing.T) {
acc = getAccount(t, port, addr)
coins := acc.GetCoins()
expectedBalance := initialBalance[0].Minus(fees[0])
require.Equal(t, expectedBalance.Amount.SubRaw(5), coins.AmountOf(stakeTypes.DefaultBondDenom))
require.Equal(t, expectedBalance.Amount.SubRaw(5), coins.AmountOf(stakingTypes.DefaultBondDenom))
expectedBalance = coins[0]

// query proposal
Expand All @@ -607,7 +607,7 @@ func TestDeposit(t *testing.T) {
// verify balance after deposit and fee
acc = getAccount(t, port, addr)
expectedBalance = expectedBalance.Minus(fees[0])
require.Equal(t, expectedBalance.Amount.SubRaw(5), acc.GetCoins().AmountOf(stakeTypes.DefaultBondDenom))
require.Equal(t, expectedBalance.Amount.SubRaw(5), acc.GetCoins().AmountOf(stakingTypes.DefaultBondDenom))

// query tx
txs := getTransactions(t, port, fmt.Sprintf("action=deposit&depositor=%s", addr))
Expand All @@ -616,11 +616,11 @@ func TestDeposit(t *testing.T) {

// query proposal
proposal = getProposal(t, port, proposalID)
require.True(t, proposal.GetTotalDeposit().IsEqual(sdk.Coins{sdk.NewInt64Coin(stakeTypes.DefaultBondDenom, 10)}))
require.True(t, proposal.GetTotalDeposit().IsEqual(sdk.Coins{sdk.NewInt64Coin(stakingTypes.DefaultBondDenom, 10)}))

// query deposit
deposit := getDeposit(t, port, proposalID, addr)
require.True(t, deposit.Amount.IsEqual(sdk.Coins{sdk.NewInt64Coin(stakeTypes.DefaultBondDenom, 10)}))
require.True(t, deposit.Amount.IsEqual(sdk.Coins{sdk.NewInt64Coin(stakingTypes.DefaultBondDenom, 10)}))
}

func TestVote(t *testing.T) {
Expand All @@ -646,7 +646,7 @@ func TestVote(t *testing.T) {
acc = getAccount(t, port, addr)
coins := acc.GetCoins()
expectedBalance := initialBalance[0].Minus(fees[0])
require.Equal(t, expectedBalance.Amount.SubRaw(10), coins.AmountOf(stakeTypes.DefaultBondDenom))
require.Equal(t, expectedBalance.Amount.SubRaw(10), coins.AmountOf(stakingTypes.DefaultBondDenom))
expectedBalance = coins[0]

// query proposal
Expand All @@ -662,7 +662,7 @@ func TestVote(t *testing.T) {
acc = getAccount(t, port, addr)
coins = acc.GetCoins()
expectedBalance = expectedBalance.Minus(fees[0])
require.Equal(t, expectedBalance.Amount, coins.AmountOf(stakeTypes.DefaultBondDenom))
require.Equal(t, expectedBalance.Amount, coins.AmountOf(stakingTypes.DefaultBondDenom))
expectedBalance = coins[0]

// query tx
Expand All @@ -685,7 +685,7 @@ func TestVote(t *testing.T) {
acc = getAccount(t, port, addr)
coins = acc.GetCoins()
expectedBalance = expectedBalance.Minus(fees[0])
require.Equal(t, expectedBalance.Amount.SubRaw(60), coins.AmountOf(stakeTypes.DefaultBondDenom))
require.Equal(t, expectedBalance.Amount.SubRaw(60), coins.AmountOf(stakingTypes.DefaultBondDenom))
expectedBalance = coins[0]

tally = getTally(t, port, proposalID)
Expand All @@ -698,7 +698,7 @@ func TestVote(t *testing.T) {
// verify balance
acc = getAccount(t, port, addr)
expectedBalance = expectedBalance.Minus(fees[0])
require.Equal(t, expectedBalance.Amount, acc.GetCoins().AmountOf(stakeTypes.DefaultBondDenom))
require.Equal(t, expectedBalance.Amount, acc.GetCoins().AmountOf(stakingTypes.DefaultBondDenom))

tally = getTally(t, port, proposalID)
require.Equal(t, sdk.ZeroDec(), tally.Yes, "tally should be 0 the user changed the option")
Expand Down Expand Up @@ -727,7 +727,7 @@ func TestProposalsQuery(t *testing.T) {
defer cleanup()

depositParam := getDepositParam(t, port)
halfMinDeposit := depositParam.MinDeposit.AmountOf(stakeTypes.DefaultBondDenom).Int64() / 2
halfMinDeposit := depositParam.MinDeposit.AmountOf(stakingTypes.DefaultBondDenom).Int64() / 2
getVotingParam(t, port)
getTallyingParam(t, port)

Expand Down
30 changes: 15 additions & 15 deletions client/lcd/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ paths:
description: No content about this account address
500:
description: Server internel error
/stake/delegators/{delegatorAddr}/delegations:
/staking/delegators/{delegatorAddr}/delegations:
parameters:
- in: path
name: delegatorAddr
Expand Down Expand Up @@ -669,7 +669,7 @@ paths:
description: Key password is wrong
500:
description: Internal Server Error
/stake/delegators/{delegatorAddr}/delegations/{validatorAddr}:
/staking/delegators/{delegatorAddr}/delegations/{validatorAddr}:
parameters:
- in: path
name: delegatorAddr
Expand All @@ -696,7 +696,7 @@ paths:
description: Invalid delegator address or validator address
500:
description: Internal Server Error
/stake/delegators/{delegatorAddr}/unbonding_delegations:
/staking/delegators/{delegatorAddr}/unbonding_delegations:
parameters:
- in: path
name: delegatorAddr
Expand Down Expand Up @@ -765,7 +765,7 @@ paths:
description: Key password is wrong
500:
description: Internal Server Error
/stake/delegators/{delegatorAddr}/unbonding_delegations/{validatorAddr}:
/staking/delegators/{delegatorAddr}/unbonding_delegations/{validatorAddr}:
parameters:
- in: path
name: delegatorAddr
Expand Down Expand Up @@ -794,7 +794,7 @@ paths:
description: Invalid delegator address or validator address
500:
description: Internal Server Error
/stake/redelegations:
/staking/redelegations:
parameters:
- in: query
name: delegator
Expand Down Expand Up @@ -826,7 +826,7 @@ paths:
$ref: "#/definitions/Redelegation"
500:
description: Internal Server Error
/stake/delegators/{delegatorAddr}/redelegations:
/staking/delegators/{delegatorAddr}/redelegations:
parameters:
- in: path
name: delegatorAddr
Expand Down Expand Up @@ -880,7 +880,7 @@ paths:
description: Key password is wrong
500:
description: Internal Server Error
/stake/delegators/{delegatorAddr}/validators:
/staking/delegators/{delegatorAddr}/validators:
parameters:
- in: path
name: delegatorAddr
Expand All @@ -904,7 +904,7 @@ paths:
description: Invalid delegator address
500:
description: Internal Server Error
/stake/delegators/{delegatorAddr}/validators/{validatorAddr}:
/staking/delegators/{delegatorAddr}/validators/{validatorAddr}:
parameters:
- in: path
name: delegatorAddr
Expand All @@ -931,7 +931,7 @@ paths:
description: Invalid delegator address or validator address
500:
description: Internal Server Error
/stake/delegators/{delegatorAddr}/txs:
/staking/delegators/{delegatorAddr}/txs:
parameters:
- in: path
name: delegatorAddr
Expand All @@ -957,7 +957,7 @@ paths:
description: Invalid delegator address
500:
description: Internal Server Error
/stake/validators:
/staking/validators:
get:
summary: Get all validator candidates
tags:
Expand All @@ -973,7 +973,7 @@ paths:
$ref: "#/definitions/Validator"
500:
description: Internal Server Error
/stake/validators/{validatorAddr}:
/staking/validators/{validatorAddr}:
parameters:
- in: path
name: validatorAddr
Expand All @@ -995,7 +995,7 @@ paths:
description: Invalid validator address
500:
description: Internal Server Error
/stake/validators/{validatorAddr}/delegations:
/staking/validators/{validatorAddr}/delegations:
parameters:
- in: path
name: validatorAddr
Expand All @@ -1019,7 +1019,7 @@ paths:
description: Invalid validator address
500:
description: Internal Server Error
/stake/validators/{validatorAddr}/unbonding_delegations:
/staking/validators/{validatorAddr}/unbonding_delegations:
parameters:
- in: path
name: validatorAddr
Expand All @@ -1043,7 +1043,7 @@ paths:
description: Invalid validator address
500:
description: Internal Server Error
/stake/pool:
/staking/pool:
get:
summary: Get the current state of the staking pool
tags:
Expand All @@ -1070,7 +1070,7 @@ paths:
type: string
500:
description: Internal Server Error
/stake/parameters:
/staking/parameters:
get:
summary: Get the current staking parameter values
tags:
Expand Down
Loading

0 comments on commit 78a2135

Please sign in to comment.