Skip to content

Commit

Permalink
Merge pull request cosmos#3576 from cosmos/master
Browse files Browse the repository at this point in the history
Merge master back into develop for v0.31.1
  • Loading branch information
ebuchman authored Feb 9, 2019
2 parents e199604 + af93506 commit ed2b427
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions cmd/gaia/app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (

var (
// bonded tokens given to genesis validators/accounts
freeFermionsAcc = staking.TokensFromTendermintPower(150)
bondDenom = staking.DefaultBondDenom
freeFermionsAcc = staking.TokensFromTendermintPower(150)
defaultBondDenom = staking.DefaultBondDenom
)

// State to Unmarshal
Expand Down Expand Up @@ -401,7 +401,7 @@ func NewDefaultGenesisAccount(addr sdk.AccAddress) GenesisAccount {
accAuth := auth.NewBaseAccountWithAddress(addr)
coins := sdk.Coins{
sdk.NewCoin("footoken", sdk.NewInt(1000)),
sdk.NewCoin(bondDenom, freeFermionsAcc),
sdk.NewCoin(defaultBondDenom, freeFermionsAcc),
}

coins.Sort()
Expand Down
8 changes: 4 additions & 4 deletions cmd/gaia/app/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func makeGenesisState(t *testing.T, genTxs []auth.StdTx) GenesisState {
msg := msgs[0].(staking.MsgCreateValidator)

acc := auth.NewBaseAccountWithAddress(sdk.AccAddress(msg.ValidatorAddr))
acc.Coins = sdk.Coins{sdk.NewInt64Coin(bondDenom, 150)}
acc.Coins = sdk.Coins{sdk.NewInt64Coin(defaultBondDenom, 150)}
genAccs[i] = NewGenesisAccount(&acc)
stakingData.Pool.NotBondedTokens = stakingData.Pool.NotBondedTokens.Add(sdk.NewInt(150)) // increase the supply
}
Expand All @@ -55,7 +55,7 @@ func TestToAccount(t *testing.T) {
priv := ed25519.GenPrivKey()
addr := sdk.AccAddress(priv.PubKey().Address())
authAcc := auth.NewBaseAccountWithAddress(addr)
authAcc.SetCoins(sdk.Coins{sdk.NewInt64Coin(bondDenom, 150)})
authAcc.SetCoins(sdk.Coins{sdk.NewInt64Coin(defaultBondDenom, 150)})
genAcc := NewGenesisAccount(&authAcc)
acc := genAcc.ToAccount()
require.IsType(t, &auth.BaseAccount{}, acc)
Expand Down Expand Up @@ -104,7 +104,7 @@ func TestGaiaAppGenState(t *testing.T) {
func makeMsg(name string, pk crypto.PubKey) auth.StdTx {
desc := staking.NewDescription(name, "", "", "")
comm := staking.CommissionMsg{}
msg := staking.NewMsgCreateValidator(sdk.ValAddress(pk.Address()), pk, sdk.NewInt64Coin(bondDenom,
msg := staking.NewMsgCreateValidator(sdk.ValAddress(pk.Address()), pk, sdk.NewInt64Coin(defaultBondDenom,
50), desc, comm, sdk.OneInt())
return auth.NewStdTx([]sdk.Msg{msg}, auth.StdFee{}, nil, "")
}
Expand Down Expand Up @@ -151,7 +151,7 @@ func TestNewDefaultGenesisAccount(t *testing.T) {
addr := secp256k1.GenPrivKeySecp256k1([]byte("")).PubKey().Address()
acc := NewDefaultGenesisAccount(sdk.AccAddress(addr))
require.Equal(t, sdk.NewInt(1000), acc.Coins.AmountOf("footoken"))
require.Equal(t, staking.TokensFromTendermintPower(150), acc.Coins.AmountOf(bondDenom))
require.Equal(t, staking.TokensFromTendermintPower(150), acc.Coins.AmountOf(defaultBondDenom))
}

func TestGenesisStateSanitize(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions x/staking/simulation/invariants.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ func SupplyInvariants(ck bank.Keeper, k staking.Keeper,
feePool := d.GetFeePool(ctx)

// add outstanding fees
loose = loose.Add(sdk.NewDecFromInt(f.GetCollectedFees(ctx).AmountOf(staking.DefaultBondDenom)))
loose = loose.Add(sdk.NewDecFromInt(f.GetCollectedFees(ctx).AmountOf(k.BondDenom(ctx))))

// add community pool
loose = loose.Add(feePool.CommunityPool.AmountOf(staking.DefaultBondDenom))
loose = loose.Add(feePool.CommunityPool.AmountOf(k.BondDenom(ctx)))

// add yet-to-be-withdrawn
loose = loose.Add(d.GetOutstandingRewards(ctx).AmountOf(staking.DefaultBondDenom))
loose = loose.Add(d.GetOutstandingRewards(ctx).AmountOf(k.BondDenom(ctx)))

// Not-bonded tokens should equal coin supply plus unbonding delegations
// plus tokens on unbonded validators
Expand Down

0 comments on commit ed2b427

Please sign in to comment.