Skip to content

Commit

Permalink
Merge PR #3884: steak to stake
Browse files Browse the repository at this point in the history
  • Loading branch information
yangyanqing authored and rigelrozanski committed Mar 14, 2019
1 parent 648b432 commit 7e53da8
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion client/lcd/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,7 @@ definitions:
properties:
denom:
type: string
example: steak
example: stake
amount:
type: string
example: "50"
Expand Down
2 changes: 1 addition & 1 deletion client/lcd/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func InitClientHome(t *testing.T, dir string) string {
// TODO: Make InitializeTestLCD safe to call in multiple tests at the same time
// InitializeTestLCD starts Tendermint and the LCD in process, listening on
// their respective sockets where nValidators is the total number of validators
// and initAddrs are the accounts to initialize with some steak tokens. It
// and initAddrs are the accounts to initialize with some stake tokens. It
// returns a cleanup function, a set of validator public keys, and a port.
func InitializeTestLCD(t *testing.T, nValidators int, initAddrs []sdk.AccAddress, minting bool) (
cleanup func(), valConsPubKeys []crypto.PubKey, valOperAddrs []sdk.ValAddress, port string) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/gaia/app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func appStateRandomizedFn(r *rand.Rand, accs []simulation.Account, genesisTimest
numInitiallyBonded = numAccs
}
fmt.Printf("Selected randomly generated parameters for simulated genesis:\n"+
"\t{amount of steak per account: %v, initially bonded validators: %v}\n",
"\t{amount of stake per account: %v, initially bonded validators: %v}\n",
amount, numInitiallyBonded)

// randomly generate some genesis accounts
Expand Down
2 changes: 1 addition & 1 deletion docs/spec/auth/01_concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ signature verification, as well as costs proportional to the tx size. Operators
should set minimum gas prices when starting their nodes. They must set the unit
costs of gas in each token denomination they wish to support:

`gaiad start ... --minimum-gas-prices=0.00001steak;0.05photinos`
`gaiad start ... --minimum-gas-prices=0.00001stake;0.05photinos`

When adding transactions to mempool or gossipping transactions, validators check
if the transaction's gas prices, which are determined by the provided fees, meet
Expand Down
12 changes: 6 additions & 6 deletions docs/translations/kr/gaia/gaiacli.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,12 @@ gaiacli query staking validator <account_cosmosval(cosmosval 계정)>

#### 토큰 본딩하기

테스트넷의 경우 `atom`이 아닌 `steak`를 위임합니다. 특정 테스트넷 검증인에게 토큰을 본딩하기 위해서는:
테스트넷의 경우 `atom`이 아닌 `stake`를 위임합니다. 특정 테스트넷 검증인에게 토큰을 본딩하기 위해서는:


```bash
gaiacli tx staking delegate \
--amount=10steak \
--amount=10stake \
--validator=<validator(검증인 주소)> \
--from=<key_name(트랜잭션을 발생할 키/계정 이름)> \
--chain-id=<chain_id(체인 아이디)>
Expand All @@ -353,7 +353,7 @@ gaiacli keys show [name] --bech val


::: tip 참고
보유하고 있는 `steak` 이상을 사용하지 마세요. `steak`가 더 필요한 경우 [Faucet](https://faucetcosmos.network/)에서 추가로 받으실 수 있습니다!
보유하고 있는 `stake` 이상을 사용하지 마세요. `stake`가 더 필요한 경우 [Faucet](https://faucetcosmos.network/)에서 추가로 받으실 수 있습니다!
:::

##### 위임 조회
Expand Down Expand Up @@ -515,7 +515,7 @@ gaiacli tx gov submit-proposal \
--title=<title(프로포절 제목)> \
--description=<description(프로포절 설명)> \
--type=<Text/ParameterChange/SoftwareUpgrade(프로포절 타입)> \
--deposit=<40steak(예치금 수량)> \
--deposit=<40stake(예치금 수량)> \
--from=<name(트랜잭션을 발생시킬 키/계정 이름)> \
--chain-id=<chain_id(체인 아이디)>
```
Expand Down Expand Up @@ -544,10 +544,10 @@ gaiacli query gov proposer <proposal_id(프로포절 ID)>

#### 보증금 추가하기

프로포절이 네트워크에 전파되기 위해서는 해당 프로포절의 보증금이 `minDeposit` 값 이상이어야 합니다 (현재 기본 값은 `10 steak`입니다). 만약 사전에 생성한 프로포절이 해당 기준을 충족하지 못하였다면 추후에 보증금을 추가 예치하여 활성화할 수 있습니다. 프로포절의 보증금이 최소 값을 도달하면 해당 프로포절의 투표는 활성화 됩니다:
프로포절이 네트워크에 전파되기 위해서는 해당 프로포절의 보증금이 `minDeposit` 값 이상이어야 합니다 (현재 기본 값은 `10 stake`입니다). 만약 사전에 생성한 프로포절이 해당 기준을 충족하지 못하였다면 추후에 보증금을 추가 예치하여 활성화할 수 있습니다. 프로포절의 보증금이 최소 값을 도달하면 해당 프로포절의 투표는 활성화 됩니다:

```bash
gaiacli tx gov deposit <proposal_id(프로포절 ID)> <200steak(금액)> \
gaiacli tx gov deposit <proposal_id(프로포절 ID)> <200stake(금액)> \
--from=<name(트랜잭션을 발생시킬 키/계정 이름)> \
--chain-id=<chain_id(체인 아이디)>
```
Expand Down
2 changes: 1 addition & 1 deletion types/coin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestIsEqualCoin(t *testing.T) {
}{
{NewInt64Coin(testDenom1, 1), NewInt64Coin(testDenom1, 1), true, false},
{NewInt64Coin(testDenom1, 1), NewInt64Coin(testDenom2, 1), false, true},
{NewInt64Coin("steak", 1), NewInt64Coin("steak", 10), false, false},
{NewInt64Coin("stake", 1), NewInt64Coin("stake", 10), false, false},
}

for tcIndex, tc := range cases {
Expand Down
16 changes: 8 additions & 8 deletions x/bank/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ func TestVestingAccountSend(t *testing.T) {
ctx := input.ctx.WithBlockHeader(abci.Header{Time: now})
endTime := now.Add(24 * time.Hour)

origCoins := sdk.NewCoins(sdk.NewInt64Coin("steak", 100))
sendCoins := sdk.NewCoins(sdk.NewInt64Coin("steak", 50))
origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100))
sendCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50))
bankKeeper := NewBaseKeeper(input.ak, input.pk.Subspace(DefaultParamspace), DefaultCodespace)
bankKeeper.SetSendEnabled(ctx, true)

Expand Down Expand Up @@ -247,8 +247,8 @@ func TestVestingAccountReceive(t *testing.T) {
ctx := input.ctx.WithBlockHeader(abci.Header{Time: now})
endTime := now.Add(24 * time.Hour)

origCoins := sdk.NewCoins(sdk.NewInt64Coin("steak", 100))
sendCoins := sdk.NewCoins(sdk.NewInt64Coin("steak", 50))
origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100))
sendCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50))
bankKeeper := NewBaseKeeper(input.ak, input.pk.Subspace(DefaultParamspace), DefaultCodespace)
bankKeeper.SetSendEnabled(ctx, true)

Expand Down Expand Up @@ -281,8 +281,8 @@ func TestDelegateCoins(t *testing.T) {
ctx := input.ctx.WithBlockHeader(abci.Header{Time: now})
endTime := now.Add(24 * time.Hour)

origCoins := sdk.NewCoins(sdk.NewInt64Coin("steak", 100))
delCoins := sdk.NewCoins(sdk.NewInt64Coin("steak", 50))
origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100))
delCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50))
bankKeeper := NewBaseKeeper(input.ak, input.pk.Subspace(DefaultParamspace), DefaultCodespace)
bankKeeper.SetSendEnabled(ctx, true)

Expand Down Expand Up @@ -318,8 +318,8 @@ func TestUndelegateCoins(t *testing.T) {
ctx := input.ctx.WithBlockHeader(abci.Header{Time: now})
endTime := now.Add(24 * time.Hour)

origCoins := sdk.NewCoins(sdk.NewInt64Coin("steak", 100))
delCoins := sdk.NewCoins(sdk.NewInt64Coin("steak", 50))
origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100))
delCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50))
bankKeeper := NewBaseKeeper(input.ak, input.pk.Subspace(DefaultParamspace), DefaultCodespace)
bankKeeper.SetSendEnabled(ctx, true)

Expand Down
34 changes: 17 additions & 17 deletions x/gov/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ func TestDeposits(t *testing.T) {
proposal := keeper.NewTextProposal(ctx, "Test", "description", ProposalTypeText)
proposalID := proposal.GetProposalID()

fourSteak := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromTendermintPower(4)))
fiveSteak := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromTendermintPower(5)))
fourStake := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromTendermintPower(4)))
fiveStake := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromTendermintPower(5)))

addr0Initial := keeper.ck.GetCoins(ctx, addrs[0])
addr1Initial := keeper.ck.GetCoins(ctx, addrs[1])
Expand All @@ -95,37 +95,37 @@ func TestDeposits(t *testing.T) {
require.True(t, keeper.GetProposal(ctx, proposalID).GetVotingStartTime().Equal(time.Time{}))

// Check first deposit
err, votingStarted := keeper.AddDeposit(ctx, proposalID, addrs[0], fourSteak)
err, votingStarted := keeper.AddDeposit(ctx, proposalID, addrs[0], fourStake)
require.Nil(t, err)
require.False(t, votingStarted)
deposit, found = keeper.GetDeposit(ctx, proposalID, addrs[0])
require.True(t, found)
require.Equal(t, fourSteak, deposit.Amount)
require.Equal(t, fourStake, deposit.Amount)
require.Equal(t, addrs[0], deposit.Depositor)
require.Equal(t, fourSteak, keeper.GetProposal(ctx, proposalID).GetTotalDeposit())
require.Equal(t, addr0Initial.Sub(fourSteak), keeper.ck.GetCoins(ctx, addrs[0]))
require.Equal(t, fourStake, keeper.GetProposal(ctx, proposalID).GetTotalDeposit())
require.Equal(t, addr0Initial.Sub(fourStake), keeper.ck.GetCoins(ctx, addrs[0]))

// Check a second deposit from same address
err, votingStarted = keeper.AddDeposit(ctx, proposalID, addrs[0], fiveSteak)
err, votingStarted = keeper.AddDeposit(ctx, proposalID, addrs[0], fiveStake)
require.Nil(t, err)
require.False(t, votingStarted)
deposit, found = keeper.GetDeposit(ctx, proposalID, addrs[0])
require.True(t, found)
require.Equal(t, fourSteak.Add(fiveSteak), deposit.Amount)
require.Equal(t, fourStake.Add(fiveStake), deposit.Amount)
require.Equal(t, addrs[0], deposit.Depositor)
require.Equal(t, fourSteak.Add(fiveSteak), keeper.GetProposal(ctx, proposalID).GetTotalDeposit())
require.Equal(t, addr0Initial.Sub(fourSteak).Sub(fiveSteak), keeper.ck.GetCoins(ctx, addrs[0]))
require.Equal(t, fourStake.Add(fiveStake), keeper.GetProposal(ctx, proposalID).GetTotalDeposit())
require.Equal(t, addr0Initial.Sub(fourStake).Sub(fiveStake), keeper.ck.GetCoins(ctx, addrs[0]))

// Check third deposit from a new address
err, votingStarted = keeper.AddDeposit(ctx, proposalID, addrs[1], fourSteak)
err, votingStarted = keeper.AddDeposit(ctx, proposalID, addrs[1], fourStake)
require.Nil(t, err)
require.True(t, votingStarted)
deposit, found = keeper.GetDeposit(ctx, proposalID, addrs[1])
require.True(t, found)
require.Equal(t, addrs[1], deposit.Depositor)
require.Equal(t, fourSteak, deposit.Amount)
require.Equal(t, fourSteak.Add(fiveSteak).Add(fourSteak), keeper.GetProposal(ctx, proposalID).GetTotalDeposit())
require.Equal(t, addr1Initial.Sub(fourSteak), keeper.ck.GetCoins(ctx, addrs[1]))
require.Equal(t, fourStake, deposit.Amount)
require.Equal(t, fourStake.Add(fiveStake).Add(fourStake), keeper.GetProposal(ctx, proposalID).GetTotalDeposit())
require.Equal(t, addr1Initial.Sub(fourStake), keeper.ck.GetCoins(ctx, addrs[1]))

// Check that proposal moved to voting period
require.True(t, keeper.GetProposal(ctx, proposalID).GetVotingStartTime().Equal(ctx.BlockHeader().Time))
Expand All @@ -135,19 +135,19 @@ func TestDeposits(t *testing.T) {
require.True(t, depositsIterator.Valid())
keeper.cdc.MustUnmarshalBinaryLengthPrefixed(depositsIterator.Value(), &deposit)
require.Equal(t, addrs[0], deposit.Depositor)
require.Equal(t, fourSteak.Add(fiveSteak), deposit.Amount)
require.Equal(t, fourStake.Add(fiveStake), deposit.Amount)
depositsIterator.Next()
keeper.cdc.MustUnmarshalBinaryLengthPrefixed(depositsIterator.Value(), &deposit)
require.Equal(t, addrs[1], deposit.Depositor)
require.Equal(t, fourSteak, deposit.Amount)
require.Equal(t, fourStake, deposit.Amount)
depositsIterator.Next()
require.False(t, depositsIterator.Valid())
depositsIterator.Close()

// Test Refund Deposits
deposit, found = keeper.GetDeposit(ctx, proposalID, addrs[1])
require.True(t, found)
require.Equal(t, fourSteak, deposit.Amount)
require.Equal(t, fourStake, deposit.Amount)
keeper.RefundDeposits(ctx, proposalID)
deposit, found = keeper.GetDeposit(ctx, proposalID, addrs[1])
require.False(t, found)
Expand Down

0 comments on commit 7e53da8

Please sign in to comment.