feat: add endblocker with valsetupdate type (#15829)

This commit is contained in:
Marko
2023-04-14 09:41:29 +00:00
committed by GitHub
parent 722bea5b40
commit 8d6c23faa4
18 changed files with 200 additions and 73 deletions
+2 -3
View File
@@ -15,7 +15,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/slashing"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
"github.com/cosmos/cosmos-sdk/x/slashing/testutil"
"github.com/cosmos/cosmos-sdk/x/staking"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtestutil "github.com/cosmos/cosmos-sdk/x/staking/testutil"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
@@ -46,7 +45,7 @@ func TestBeginBlocker(t *testing.T) {
// bond the validator
power := int64(100)
amt := tstaking.CreateValidatorWithValPower(addr, pk, power, true)
staking.EndBlocker(ctx, stakingKeeper)
stakingKeeper.EndBlocker(ctx)
require.Equal(
t, bankKeeper.GetAllBalances(ctx, sdk.AccAddress(addr)),
sdk.NewCoins(sdk.NewCoin(stakingKeeper.GetParams(ctx).BondDenom, InitTokens.Sub(amt))),
@@ -97,7 +96,7 @@ func TestBeginBlocker(t *testing.T) {
}
// end block
staking.EndBlocker(ctx, stakingKeeper)
stakingKeeper.EndBlocker(ctx)
// validator should be jailed
validator, found := stakingKeeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pk))