Skip to content

Commit

Permalink
Resolve staking endblock unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kiragpg committed Sep 22, 2023
1 parent afb5a54 commit 8b1b166
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions x/staking/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ func TestItUpdatesTheValidatorSetBasedOnPendingValidators(t *testing.T) {

// First checkings
validatorSet := app.CustomStakingKeeper.GetValidatorSet(ctx)
require.Len(t, validatorSet, 0)
require.Len(t, validatorSet, 1)
validatorSet = app.CustomStakingKeeper.GetPendingValidatorSet(ctx)
require.Len(t, validatorSet, 1)

updates := staking.EndBlocker(ctx, app.CustomStakingKeeper)
require.Len(t, updates, 1)

validatorSet = app.CustomStakingKeeper.GetValidatorSet(ctx)
require.Len(t, validatorSet, 1)
require.Len(t, validatorSet, 2)
validatorSet = app.CustomStakingKeeper.GetPendingValidatorSet(ctx)
require.Len(t, validatorSet, 0)
}
Expand All @@ -52,15 +52,15 @@ func TestItDoesNotReturnUpdatesIfThereIsNoPending(t *testing.T) {

// First checkings
validatorSet := app.CustomStakingKeeper.GetValidatorSet(ctx)
require.Len(t, validatorSet, 0)
require.Len(t, validatorSet, 1)
validatorSet = app.CustomStakingKeeper.GetPendingValidatorSet(ctx)
require.Len(t, validatorSet, 0)

updates := staking.EndBlocker(ctx, app.CustomStakingKeeper)
require.Len(t, updates, 0)

validatorSet = app.CustomStakingKeeper.GetValidatorSet(ctx)
require.Len(t, validatorSet, 0)
require.Len(t, validatorSet, 1)
validatorSet = app.CustomStakingKeeper.GetPendingValidatorSet(ctx)
require.Len(t, validatorSet, 0)
}
Expand Down

0 comments on commit 8b1b166

Please sign in to comment.