use on-chain params on tests + fix tests + add new tests for power reduction change

This commit is contained in:
psaradev
2021-01-28 23:54:39 +10:00
parent 4f476d6890
commit cb17feddc0
38 changed files with 322 additions and 268 deletions
+3 -3
View File
@@ -72,7 +72,7 @@ func (suite *SimTestSuite) TestWeightedOperations() {
func (suite *SimTestSuite) getTestingAccounts(r *rand.Rand, n int) []simtypes.Account {
accounts := simtypes.RandomAccounts(r, n)
initAmt := sdk.TokensFromConsensusPower(200000, sdk.DefaultPowerReduction)
initAmt := suite.app.StakingKeeper.TokensFromConsensusPower(suite.ctx, 200000)
initCoins := sdk.NewCoins(sdk.NewCoin("foo", initAmt))
// add coins to the accounts
@@ -132,7 +132,7 @@ func (suite *SimTestSuite) TestSimulateRevokeAuthorization() {
AppHash: suite.app.LastCommitID().Hash,
}})
initAmt := sdk.TokensFromConsensusPower(200000, sdk.DefaultPowerReduction)
initAmt := suite.app.StakingKeeper.TokensFromConsensusPower(suite.ctx, 200000)
initCoins := sdk.NewCoins(sdk.NewCoin("foo", initAmt))
granter := accounts[0]
@@ -167,7 +167,7 @@ func (suite *SimTestSuite) TestSimulateExecAuthorization() {
// begin a new block
suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}})
initAmt := sdk.TokensFromConsensusPower(200000, sdk.DefaultPowerReduction)
initAmt := suite.app.StakingKeeper.TokensFromConsensusPower(suite.ctx, 200000)
initCoins := sdk.NewCoins(sdk.NewCoin("foo", initAmt))
granter := accounts[0]