diff --git a/tests/e2e/steps_inactive_vals.go b/tests/e2e/steps_inactive_vals.go index 81b511ce51..7e6f7a3b4a 100644 --- a/tests/e2e/steps_inactive_vals.go +++ b/tests/e2e/steps_inactive_vals.go @@ -13,8 +13,8 @@ import ( // high-level, this test does: // - start the provider chain // - start a consumer chain -// - check that non-consensus validators do not get slashed for downtime; and that they don't get rewards -// - check that active validators *do* get slashed for downtime, and don't get rewards while they are down +// - check that non-consensus validators do not get slashed for downtime on the provider; and that they don't get rewards +// - check that active validators *do* get slashed for downtime on the provider, and don't get rewards while they are down // - check that non-consensus validators *do* get jailed for downtime on consumer chains // - check that non-consensus validators *become* consensus validators when they have enough power func stepsInactiveProviderValidators() []Step { @@ -144,7 +144,6 @@ func stepsInactiveProviderValidators() []Step { }, State: State{ ChainID("provi"): ChainState{ - // check that now every validator got rewarded since the first block Rewards: &Rewards{ IsNativeDenom: true, // check for rewards in the provider denom IsIncrementalReward: true, // check rewards for currently produced blocks only diff --git a/x/ccv/no_valupdates_genutil/doc.go b/x/ccv/no_valupdates_genutil/doc.go index 466804b6cc..08ad53a8cb 100644 --- a/x/ccv/no_valupdates_genutil/doc.go +++ b/x/ccv/no_valupdates_genutil/doc.go @@ -1,8 +1,8 @@ /* Package staking defines a "wrapper" module around the Cosmos SDK's native -x/staking module. In other words, it provides the exact same functionality as +x/genutil module. In other words, it provides the exact same functionality as the native module in that it simply embeds the native module. However, it -overrides `EndBlock` which will return no validator set updates. Instead, +overrides `InitGenesis` which will return no validator set updates. Instead, it is assumed that some other module will provide the validator set updates. */ package genutil diff --git a/x/ccv/provider/keeper/genesis_test.go b/x/ccv/provider/keeper/genesis_test.go index 179c741959..07fd2ba229 100644 --- a/x/ccv/provider/keeper/genesis_test.go +++ b/x/ccv/provider/keeper/genesis_test.go @@ -154,7 +154,6 @@ func TestInitAndExportGenesis(t *testing.T) { ) mocks.MockStakingKeeper.EXPECT().GetBondedValidatorsByPower(gomock.Any()).Return( - // return an empty set of validators, since they are not tested against here []stakingtypes.Validator{ provVal, }, nil).AnyTimes() diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index 2ae796adfa..9254347c3d 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -180,9 +180,9 @@ func (k Keeper) EndBlockVSU(ctx sdk.Context) ([]abci.ValidatorUpdate, error) { // The function returns the difference between the current validator set and the next validator set as a list of `abci.ValidatorUpdate` objects. func (k Keeper) ProviderValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { // get the bonded validators from the staking module - bondedValidators, error := k.stakingKeeper.GetBondedValidatorsByPower(ctx) - if error != nil { - panic(fmt.Errorf("failed to get bonded validators: %w", error)) + bondedValidators, err := k.stakingKeeper.GetBondedValidatorsByPower(ctx) + if err != nil { + panic(fmt.Errorf("failed to get bonded validators: %w", err)) } // get the last validator set sent to consensus diff --git a/x/ccv/provider/keeper/relay_test.go b/x/ccv/provider/keeper/relay_test.go index 3d4e2ca7a5..98ddaab3fe 100644 --- a/x/ccv/provider/keeper/relay_test.go +++ b/x/ccv/provider/keeper/relay_test.go @@ -775,7 +775,7 @@ func TestEndBlockVSU(t *testing.T) { testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 5, lastValidators, powers, -1) sort.Slice(lastValidators, func(i, j int) bool { - return lastValidators[i].ConsensusPower(sdk.DefaultPowerReduction) > + return lastValidators[i].GetConsensusPower(sdk.DefaultPowerReduction) > lastValidators[j].GetConsensusPower(sdk.DefaultPowerReduction) }) mocks.MockStakingKeeper.EXPECT().GetBondedValidatorsByPower(gomock.Any()).Return(lastValidators, nil).AnyTimes()