use on-chain params on tests + fix tests + add new tests for power reduction change
This commit is contained in:
@@ -77,7 +77,7 @@ func TestSimulateMsgUnjail(t *testing.T) {
|
||||
app.StakingKeeper.Jail(ctx, val0ConsAddress)
|
||||
|
||||
// setup self delegation
|
||||
delTokens := sdk.TokensFromConsensusPower(2, sdk.DefaultPowerReduction)
|
||||
delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 2)
|
||||
validator0, issuedShares := validator0.AddTokensFromDel(delTokens)
|
||||
val0AccAddress, err := sdk.ValAddressFromBech32(validator0.OperatorAddress)
|
||||
require.NoError(t, err)
|
||||
@@ -116,7 +116,7 @@ func createTestApp(isCheckTx bool) (*simapp.SimApp, sdk.Context) {
|
||||
func getTestingAccounts(t *testing.T, r *rand.Rand, app *simapp.SimApp, ctx sdk.Context, n int) []simtypes.Account {
|
||||
accounts := simtypes.RandomAccounts(r, n)
|
||||
|
||||
initAmt := sdk.TokensFromConsensusPower(200, sdk.DefaultPowerReduction)
|
||||
initAmt := app.StakingKeeper.TokensFromConsensusPower(ctx, 200)
|
||||
initCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, initAmt))
|
||||
|
||||
// add coins to the accounts
|
||||
|
||||
Reference in New Issue
Block a user