diff --git a/x/bank/types/balance_test.go b/x/bank/types/balance_test.go index 9736c847ba..f328314910 100644 --- a/x/bank/types/balance_test.go +++ b/x/bank/types/balance_test.go @@ -106,7 +106,7 @@ func TestBalance_GetAddress(t *testing.T) { func TestSanitizeBalances(t *testing.T) { // 1. Generate balances - tokens := sdk.TokensFromConsensusPower(81) + tokens := sdk.TokensFromConsensusPower(81, sdk.DefaultPowerReduction) coin := sdk.NewCoin("benchcoin", tokens) coins := sdk.Coins{coin} addrs, _ := makeRandomAddressesAndPublicKeys(20) @@ -158,7 +158,7 @@ func BenchmarkSanitizeBalances1000(b *testing.B) { func benchmarkSanitizeBalances(b *testing.B, nAddresses int) { b.ReportAllocs() - tokens := sdk.TokensFromConsensusPower(81) + tokens := sdk.TokensFromConsensusPower(81, sdk.DefaultPowerReduction) coin := sdk.NewCoin("benchcoin", tokens) coins := sdk.Coins{coin} addrs, _ := makeRandomAddressesAndPublicKeys(nAddresses) diff --git a/x/feegrant/simulation/operations_test.go b/x/feegrant/simulation/operations_test.go index 5d6560b26c..d9c0fffaeb 100644 --- a/x/feegrant/simulation/operations_test.go +++ b/x/feegrant/simulation/operations_test.go @@ -39,7 +39,7 @@ func (suite *SimTestSuite) SetupTest() { func (suite *SimTestSuite) getTestingAccounts(r *rand.Rand, n int) []simtypes.Account { accounts := simtypes.RandomAccounts(r, n) - initAmt := app.StakingKeeper.TokensFromConsensusPower(ctx, 200) + initAmt := sdk.TokensFromConsensusPower(200, sdk.DefaultPowerReduction) initCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, initAmt)) // add coins to the accounts diff --git a/x/staking/legacy/v040/migrate.go b/x/staking/legacy/v040/migrate.go index b0746fa363..1ade9288ec 100644 --- a/x/staking/legacy/v040/migrate.go +++ b/x/staking/legacy/v040/migrate.go @@ -129,6 +129,7 @@ func Migrate(stakingState v038staking.GenesisState) *v040staking.GenesisState { MaxEntries: uint32(stakingState.Params.MaxEntries), HistoricalEntries: uint32(stakingState.Params.HistoricalEntries), BondDenom: stakingState.Params.BondDenom, + PowerReduction: v040staking.DefaultParams().PowerReduction, }, LastTotalPower: stakingState.LastTotalPower, LastValidatorPowers: newLastValidatorPowers, diff --git a/x/staking/legacy/v040/migrate_test.go b/x/staking/legacy/v040/migrate_test.go index 2be5e80dbc..16bb4374b5 100644 --- a/x/staking/legacy/v040/migrate_test.go +++ b/x/staking/legacy/v040/migrate_test.go @@ -55,6 +55,7 @@ func TestMigrate(t *testing.T) { "historical_entries": 0, "max_entries": 0, "max_validators": 0, + "power_reduction": "1000000", "unbonding_time": "0s" }, "redelegations": [], diff --git a/x/staking/legacy/v043/store_test.go b/x/staking/legacy/v043/store_test.go index 0abe8f3b1e..32b6bb181e 100644 --- a/x/staking/legacy/v043/store_test.go +++ b/x/staking/legacy/v043/store_test.go @@ -61,7 +61,7 @@ func TestStoreMigration(t *testing.T) { { "ValidatorsByPowerIndexKey", v040staking.GetValidatorsByPowerIndexKey(val), - types.GetValidatorsByPowerIndexKey(val), + types.GetValidatorsByPowerIndexKey(val, sdk.DefaultPowerReduction), }, { "DelegationKey",