Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R4R: power reduction for Tendermint #3400

Merged
merged 38 commits into from
Feb 6, 2019
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4ea3477
add uncompiled power functionality
rigelrozanski Jan 25, 2019
3b0f7c6
fix some compile errors
rigelrozanski Jan 25, 2019
1bd2fbf
Merge remote-tracking branch 'origin/develop' into rigel/tmint-power-…
rigelrozanski Jan 29, 2019
874f065
Power -> TendermintPower
rigelrozanski Jan 29, 2019
af5a1e3
tests rename GetTendermintPower
rigelrozanski Jan 29, 2019
5ec0826
test fix
rigelrozanski Jan 30, 2019
b792be6
working
rigelrozanski Jan 30, 2019
bce1ff0
fix delegation tests
rigelrozanski Jan 30, 2019
5fb7d78
fix slash tests
rigelrozanski Jan 30, 2019
31c2b8e
staking/keeper tests passing
rigelrozanski Jan 30, 2019
753e71b
docs reversion
rigelrozanski Jan 30, 2019
0a71ae3
debuggin workin
rigelrozanski Jan 30, 2019
500ae2d
x/staking test pass
rigelrozanski Jan 31, 2019
93a9d66
fix gov tests
rigelrozanski Jan 31, 2019
2f5ae44
fix x/slashing tests
rigelrozanski Jan 31, 2019
328b7bf
working distribution test fixes
rigelrozanski Jan 31, 2019
7958a14
fix distribution tests
rigelrozanski Jan 31, 2019
f7c7a1d
lint
rigelrozanski Jan 31, 2019
836e963
fix lcd tests
rigelrozanski Feb 1, 2019
bba4591
fix gov test
rigelrozanski Feb 1, 2019
079b4ad
lint
rigelrozanski Feb 1, 2019
ffff826
CLI fixes, rm stakingTypes
rigelrozanski Feb 1, 2019
1ab4597
typos
rigelrozanski Feb 1, 2019
6ac2afd
working cli fixes
rigelrozanski Feb 1, 2019
9f42196
Merge remote-tracking branch 'origin/develop' into rigel/tmint-power-…
rigelrozanski Feb 1, 2019
239f145
cli test fix
rigelrozanski Feb 1, 2019
8dcf0d7
cli tests fixed
rigelrozanski Feb 1, 2019
49c1a3c
testnet creation modification
rigelrozanski Feb 1, 2019
b1db0f4
typo
rigelrozanski Feb 1, 2019
d2cc658
pending
rigelrozanski Feb 1, 2019
b2241ef
Sanitize Dec.Roundint64 (#3475)
rigelrozanski Feb 2, 2019
7df1018
Merge remote-tracking branch 'origin/develop' into rigel/tmint-power-…
rigelrozanski Feb 6, 2019
cefba46
merge fixes
rigelrozanski Feb 6, 2019
5e95340
@cwgoes comments
rigelrozanski Feb 6, 2019
a952a41
fix tests
rigelrozanski Feb 6, 2019
a984da1
change power reduction to 10^-6
rigelrozanski Feb 6, 2019
450cad0
option to turn off minting for LCD tests
rigelrozanski Feb 6, 2019
f8c1ffc
Merge branch 'develop' into rigel/tmint-power-reduce
cwgoes Feb 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ BREAKING CHANGES
* [\#3457](https://github.com/cosmos/cosmos-sdk/issues/3457) Changed governance tally validatorGovInfo to use sdk.Int power instead of sdk.Dec

* SDK
* \#2513 Tendermint updates are adjusted by 10^-6 relative to staking tokens,
* [\#3487](https://github.com/cosmos/cosmos-sdk/pull/3487) Move HTTP/REST utilities out of client/utils into a new dedicated client/rest package.
* [\#3490](https://github.com/cosmos/cosmos-sdk/issues/3490) ReadRESTReq() returns bool to avoid callers to write error responses twice.

Expand Down Expand Up @@ -74,6 +75,7 @@ IMPROVEMENTS
* [\#2605] x/params add subkey accessing
* [\#2986](https://github.com/cosmos/cosmos-sdk/pull/2986) Store Refactor
* \#3435 Test that store implementations do not allow nil values
* \#2509 Sanitize all usage of Dec.RoundInt64()

* Tendermint

Expand Down
166 changes: 91 additions & 75 deletions client/lcd/lcd_test.go

Large diffs are not rendered by default.

102 changes: 57 additions & 45 deletions client/lcd/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import (
"strings"
"testing"

"github.com/spf13/viper"
"github.com/stretchr/testify/require"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/keys"
"github.com/cosmos/cosmos-sdk/client/rest"
Expand All @@ -23,26 +26,22 @@ import (
gapp "github.com/cosmos/cosmos-sdk/cmd/gaia/app"
"github.com/cosmos/cosmos-sdk/codec"
crkeys "github.com/cosmos/cosmos-sdk/crypto/keys"
cryptoKeys "github.com/cosmos/cosmos-sdk/crypto/keys"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/tests"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
authRest "github.com/cosmos/cosmos-sdk/x/auth/client/rest"
authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest"
txbuilder "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
bankRest "github.com/cosmos/cosmos-sdk/x/bank/client/rest"
bankrest "github.com/cosmos/cosmos-sdk/x/bank/client/rest"
distr "github.com/cosmos/cosmos-sdk/x/distribution"
distrrest "github.com/cosmos/cosmos-sdk/x/distribution/client/rest"
"github.com/cosmos/cosmos-sdk/x/gov"
govRest "github.com/cosmos/cosmos-sdk/x/gov/client/rest"
govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest"
gcutils "github.com/cosmos/cosmos-sdk/x/gov/client/utils"
"github.com/cosmos/cosmos-sdk/x/slashing"
slashingRest "github.com/cosmos/cosmos-sdk/x/slashing/client/rest"
slashingrest "github.com/cosmos/cosmos-sdk/x/slashing/client/rest"
"github.com/cosmos/cosmos-sdk/x/staking"
stakingRest "github.com/cosmos/cosmos-sdk/x/staking/client/rest"
stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/spf13/viper"
"github.com/stretchr/testify/require"
stakingrest "github.com/cosmos/cosmos-sdk/x/staking/client/rest"

abci "github.com/tendermint/tendermint/abci/types"
tmcfg "github.com/tendermint/tendermint/config"
Expand All @@ -59,9 +58,6 @@ import (
ctypes "github.com/tendermint/tendermint/rpc/core/types"
tmrpc "github.com/tendermint/tendermint/rpc/lib/server"
tmtypes "github.com/tendermint/tendermint/types"

distr "github.com/cosmos/cosmos-sdk/x/distribution"
distrRest "github.com/cosmos/cosmos-sdk/x/distribution/client/rest"
)

// makePathname creates a unique pathname for each test. It will panic if it
Expand Down Expand Up @@ -202,9 +198,8 @@ func (b AddrSeedSlice) Swap(i, j int) {
// their respective sockets where nValidators is the total number of validators
// and initAddrs are the accounts to initialize with some steak 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,
) (cleanup func(), valConsPubKeys []crypto.PubKey, valOperAddrs []sdk.ValAddress, port string) {
func InitializeTestLCD(t *testing.T, nValidators int, initAddrs []sdk.AccAddress, minting bool) (
cleanup func(), valConsPubKeys []crypto.PubKey, valOperAddrs []sdk.ValAddress, port string) {

if nValidators < 1 {
panic("InitializeTestLCD must use at least one validator")
Expand Down Expand Up @@ -239,16 +234,19 @@ func InitializeTestLCD(
operPrivKey := secp256k1.GenPrivKey()
operAddr := operPrivKey.PubKey().Address()
pubKey := privVal.GetPubKey()
delegation := 100

power := int64(100)
if i > 0 {
pubKey = ed25519.GenPrivKey().PubKey()
delegation = 1
power = 1
}
startTokens := staking.TokensFromTendermintPower(power)

msg := staking.NewMsgCreateValidator(
sdk.ValAddress(operAddr),
pubKey,
sdk.NewCoin(stakingTypes.DefaultBondDenom, sdk.NewInt(int64(delegation))),
staking.Description{Moniker: fmt.Sprintf("validator-%d", i+1)},
sdk.NewCoin(staking.DefaultBondDenom, startTokens),
staking.NewDescription(fmt.Sprintf("validator-%d", i+1), "", "", ""),
staking.NewCommissionMsg(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()),
)
stdSignMsg := txbuilder.StdSignMsg{
Expand All @@ -260,12 +258,14 @@ func InitializeTestLCD(
tx := auth.NewStdTx([]sdk.Msg{msg}, auth.StdFee{}, []auth.StdSignature{{Signature: sig, PubKey: operPrivKey.PubKey()}}, "")
txBytes, err := cdc.MarshalJSON(tx)
require.Nil(t, err)

genTxs = append(genTxs, txBytes)
valConsPubKeys = append(valConsPubKeys, pubKey)
valOperAddrs = append(valOperAddrs, sdk.ValAddress(operAddr))

accAuth := auth.NewBaseAccountWithAddress(sdk.AccAddress(operAddr))
accAuth.Coins = sdk.Coins{sdk.NewInt64Coin(stakingTypes.DefaultBondDenom, 150)}
accTokens := staking.TokensFromTendermintPower(150)
accAuth.Coins = sdk.Coins{sdk.NewCoin(staking.DefaultBondDenom, accTokens)}
accs = append(accs, gapp.NewGenesisAccount(&accAuth))
}

Expand All @@ -279,15 +279,21 @@ func InitializeTestLCD(
// add some tokens to init accounts
for _, addr := range initAddrs {
accAuth := auth.NewBaseAccountWithAddress(addr)
accAuth.Coins = sdk.Coins{sdk.NewInt64Coin(stakingTypes.DefaultBondDenom, 100)}
accTokens := staking.TokensFromTendermintPower(100)
accAuth.Coins = sdk.Coins{sdk.NewCoin(staking.DefaultBondDenom, accTokens)}
acc := gapp.NewGenesisAccount(&accAuth)
genesisState.Accounts = append(genesisState.Accounts, acc)
genesisState.StakingData.Pool.NotBondedTokens = genesisState.StakingData.Pool.NotBondedTokens.Add(sdk.NewInt(100))
genesisState.StakingData.Pool.NotBondedTokens = genesisState.StakingData.Pool.NotBondedTokens.Add(accTokens)
}

inflationMin := sdk.MustNewDecFromStr("10000.0")
inflationMin := sdk.ZeroDec()
if minting {
inflationMin = sdk.MustNewDecFromStr("10000.0")
genesisState.MintData.Params.InflationMax = sdk.MustNewDecFromStr("15000.0")
} else {
genesisState.MintData.Params.InflationMax = inflationMin
}
genesisState.MintData.Minter.Inflation = inflationMin
genesisState.MintData.Params.InflationMax = sdk.MustNewDecFromStr("15000.0")
genesisState.MintData.Params.InflationMin = inflationMin

appState, err := codec.MarshalJSONIndent(cdc, genesisState)
Expand Down Expand Up @@ -335,6 +341,7 @@ func startTM(
tmcfg *tmcfg.Config, logger log.Logger, genDoc *tmtypes.GenesisDoc,
privVal tmtypes.PrivValidator, app abci.Application,
) (*nm.Node, error) {

genDocProvider := func() (*tmtypes.GenesisDoc, error) { return genDoc, nil }
dbProvider := func(*nm.DBContext) (dbm.DB, error) { return dbm.NewMemDB(), nil }
nodeKey, err := p2p.LoadOrGenNodeKey(tmcfg.NodeKeyFile())
Expand Down Expand Up @@ -384,12 +391,12 @@ func registerRoutes(rs *RestServer) {
keys.RegisterRoutes(rs.Mux, rs.CliCtx.Indent)
rpc.RegisterRoutes(rs.CliCtx, rs.Mux)
tx.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc)
authRest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, auth.StoreKey)
bankRest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, rs.KeyBase)
distrRest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, distr.StoreKey)
stakingRest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, rs.KeyBase)
slashingRest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, rs.KeyBase)
govRest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc)
authrest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, auth.StoreKey)
bankrest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, rs.KeyBase)
distrrest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, distr.StoreKey)
stakingrest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, rs.KeyBase)
slashingrest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, rs.KeyBase)
govrest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc)
}

// Request makes a test LCD test request. It returns a response object and a
Expand Down Expand Up @@ -678,7 +685,7 @@ func doTransferWithGas(
kb := client.MockKeyBase()

receiveInfo, _, err := kb.CreateMnemonic(
"receive_address", cryptoKeys.English, gapp.DefaultKeyPass, cryptoKeys.SigningAlgo("secp256k1"),
"receive_address", crkeys.English, gapp.DefaultKeyPass, crkeys.SigningAlgo("secp256k1"),
)
require.Nil(t, err)

Expand All @@ -700,7 +707,7 @@ func doTransferWithGas(
)

sr := rest.SendReq{
Amount: sdk.Coins{sdk.NewInt64Coin(stakingTypes.DefaultBondDenom, 1)},
Amount: sdk.Coins{sdk.NewInt64Coin(staking.DefaultBondDenom, 1)},
BaseReq: baseReq,
}

Expand All @@ -720,7 +727,7 @@ func doTransferWithGasAccAuto(
kb := client.MockKeyBase()

receiveInfo, _, err := kb.CreateMnemonic(
"receive_address", cryptoKeys.English, gapp.DefaultKeyPass, cryptoKeys.SigningAlgo("secp256k1"),
"receive_address", crkeys.English, gapp.DefaultKeyPass, crkeys.SigningAlgo("secp256k1"),
)
require.Nil(t, err)

Expand All @@ -733,7 +740,7 @@ func doTransferWithGasAccAuto(
)

sr := rest.SendReq{
Amount: sdk.Coins{sdk.NewInt64Coin(stakingTypes.DefaultBondDenom, 1)},
Amount: sdk.Coins{sdk.NewInt64Coin(staking.DefaultBondDenom, 1)},
BaseReq: baseReq,
}

Expand All @@ -755,7 +762,8 @@ type sendReq struct {

// POST /staking/delegators/{delegatorAddr}/delegations Submit delegation
func doDelegate(t *testing.T, port, name, password string,
delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount int64, fees sdk.Coins) (resultTx sdk.TxResponse) {
delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Int, fees sdk.Coins) (resultTx sdk.TxResponse) {

acc := getAccount(t, port, delAddr)
accnum := acc.GetAccountNumber()
sequence := acc.GetSequence()
Expand All @@ -765,7 +773,7 @@ func doDelegate(t *testing.T, port, name, password string,
BaseReq: baseReq,
DelegatorAddr: delAddr,
ValidatorAddr: valAddr,
Delegation: sdk.NewInt64Coin(stakingTypes.DefaultBondDenom, amount),
Delegation: sdk.NewCoin(staking.DefaultBondDenom, amount),
}
req, err := cdc.MarshalJSON(msg)
require.NoError(t, err)
Expand All @@ -788,7 +796,7 @@ type msgDelegationsInput struct {

// POST /staking/delegators/{delegatorAddr}/delegations Submit delegation
func doUndelegate(t *testing.T, port, name, password string,
delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount int64, fees sdk.Coins) (resultTx sdk.TxResponse) {
delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Int, fees sdk.Coins) (resultTx sdk.TxResponse) {

acc := getAccount(t, port, delAddr)
accnum := acc.GetAccountNumber()
Expand All @@ -799,7 +807,7 @@ func doUndelegate(t *testing.T, port, name, password string,
BaseReq: baseReq,
DelegatorAddr: delAddr,
ValidatorAddr: valAddr,
SharesAmount: sdk.NewDec(amount),
SharesAmount: sdk.NewDecFromInt(amount),
}
req, err := cdc.MarshalJSON(msg)
require.NoError(t, err)
Expand All @@ -823,7 +831,8 @@ type msgUndelegateInput struct {

// POST /staking/delegators/{delegatorAddr}/delegations Submit delegation
func doBeginRedelegation(t *testing.T, port, name, password string,
delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, amount int64, fees sdk.Coins) (resultTx sdk.TxResponse) {
delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, amount sdk.Int,
fees sdk.Coins) (resultTx sdk.TxResponse) {

acc := getAccount(t, port, delAddr)
accnum := acc.GetAccountNumber()
Expand All @@ -837,7 +846,7 @@ func doBeginRedelegation(t *testing.T, port, name, password string,
DelegatorAddr: delAddr,
ValidatorSrcAddr: valSrcAddr,
ValidatorDstAddr: valDstAddr,
SharesAmount: sdk.NewDec(amount),
SharesAmount: sdk.NewDecFromInt(amount),
}
req, err := cdc.MarshalJSON(msg)
require.NoError(t, err)
Expand Down Expand Up @@ -1056,7 +1065,9 @@ func getStakingParams(t *testing.T, port string) staking.Params {
// ICS 22 - Gov
// ----------------------------------------------------------------------
// POST /gov/proposals Submit a proposal
func doSubmitProposal(t *testing.T, port, seed, name, password string, proposerAddr sdk.AccAddress, amount int64, fees sdk.Coins) (resultTx sdk.TxResponse) {
func doSubmitProposal(t *testing.T, port, seed, name, password string, proposerAddr sdk.AccAddress,
amount sdk.Int, fees sdk.Coins) (resultTx sdk.TxResponse) {

acc := getAccount(t, port, proposerAddr)
accnum := acc.GetAccountNumber()
sequence := acc.GetSequence()
Expand All @@ -1068,7 +1079,7 @@ func doSubmitProposal(t *testing.T, port, seed, name, password string, proposerA
Description: "test",
ProposalType: "Text",
Proposer: proposerAddr,
InitialDeposit: sdk.Coins{sdk.NewCoin(stakingTypes.DefaultBondDenom, sdk.NewInt(amount))},
InitialDeposit: sdk.Coins{sdk.NewCoin(staking.DefaultBondDenom, amount)},
BaseReq: baseReq,
}

Expand Down Expand Up @@ -1151,7 +1162,8 @@ func getProposalsFilterStatus(t *testing.T, port string, status gov.ProposalStat
}

// POST /gov/proposals/{proposalId}/deposits Deposit tokens to a proposal
func doDeposit(t *testing.T, port, seed, name, password string, proposerAddr sdk.AccAddress, proposalID uint64, amount int64, fees sdk.Coins) (resultTx sdk.TxResponse) {
func doDeposit(t *testing.T, port, seed, name, password string, proposerAddr sdk.AccAddress, proposalID uint64,
amount sdk.Int, fees sdk.Coins) (resultTx sdk.TxResponse) {

acc := getAccount(t, port, proposerAddr)
accnum := acc.GetAccountNumber()
Expand All @@ -1161,7 +1173,7 @@ func doDeposit(t *testing.T, port, seed, name, password string, proposerAddr sdk

dr := rest.DepositReq{
Depositor: proposerAddr,
Amount: sdk.Coins{sdk.NewCoin(stakingTypes.DefaultBondDenom, sdk.NewInt(amount))},
Amount: sdk.Coins{sdk.NewCoin(staking.DefaultBondDenom, amount)},
BaseReq: baseReq,
}

Expand Down
6 changes: 2 additions & 4 deletions cmd/gaia/app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ import (
"github.com/cosmos/cosmos-sdk/x/mint"
"github.com/cosmos/cosmos-sdk/x/slashing"
"github.com/cosmos/cosmos-sdk/x/staking"
stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)

var (
// bonded tokens given to genesis validators/accounts
freeFermionVal = int64(100)
freeFermionsAcc = sdk.NewInt(150)
bondDenom = stakingTypes.DefaultBondDenom
freeFermionsAcc = staking.TokensFromTendermintPower(150)
bondDenom = staking.DefaultBondDenom
)

// State to Unmarshal
Expand Down
9 changes: 4 additions & 5 deletions cmd/gaia/app/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/staking"
stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)

var (
Expand Down Expand Up @@ -104,7 +103,7 @@ func TestGaiaAppGenState(t *testing.T) {

func makeMsg(name string, pk crypto.PubKey) auth.StdTx {
desc := staking.NewDescription(name, "", "", "")
comm := stakingTypes.CommissionMsg{}
comm := staking.CommissionMsg{}
msg := staking.NewMsgCreateValidator(sdk.ValAddress(pk.Address()), pk, sdk.NewInt64Coin(bondDenom,
50), desc, comm)
return auth.NewStdTx([]sdk.Msg{msg}, auth.StdFee{}, nil, "")
Expand All @@ -131,7 +130,7 @@ func TestGaiaGenesisValidation(t *testing.T) {

// require bonded + jailed validator fails validation
genesisState = makeGenesisState(t, genTxs)
val1 := stakingTypes.NewValidator(addr1, pk1, stakingTypes.Description{Moniker: "test #2"})
val1 := staking.NewValidator(addr1, pk1, staking.NewDescription("test #2", "", "", ""))
val1.Jailed = true
val1.Status = sdk.Bonded
genesisState.StakingData.Validators = append(genesisState.StakingData.Validators, val1)
Expand All @@ -141,7 +140,7 @@ func TestGaiaGenesisValidation(t *testing.T) {
// require duplicate validator fails validation
val1.Jailed = false
genesisState = makeGenesisState(t, genTxs)
val2 := stakingTypes.NewValidator(addr1, pk1, stakingTypes.Description{Moniker: "test #3"})
val2 := staking.NewValidator(addr1, pk1, staking.NewDescription("test #3", "", "", ""))
genesisState.StakingData.Validators = append(genesisState.StakingData.Validators, val1)
genesisState.StakingData.Validators = append(genesisState.StakingData.Validators, val2)
err = GaiaValidateGenesisState(genesisState)
Expand All @@ -152,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, sdk.NewInt(150), acc.Coins.AmountOf(bondDenom))
require.Equal(t, staking.TokensFromTendermintPower(150), acc.Coins.AmountOf(bondDenom))
}

func TestGenesisStateSanitize(t *testing.T) {
Expand Down
Loading