gaia/genesis.go: rename bondDenom to defaultBondDenom to avoid confusion
This commit is contained in:
parent
1a4816bc57
commit
cb07f13672
|
@ -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
|
||||
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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, "")
|
||||
}
|
||||
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue