Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
insumity committed Feb 13, 2024
1 parent 61a4052 commit 4bc4887
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion x/ccv/provider/keeper/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func (k Keeper) BeginBlockInit(ctx sdk.Context) {
// then someone could create a bogus ConsumerAdditionProposal to override the Top N for a specific chain.
k.SetTopN(ctx, prop.ChainId, prop.Top_N)

if !k.IsTopN(ctx, prop.ChainId) && len(k.GetToBeOptedIn(ctx, prop.ChainId)) == 0 {
if k.IsOptIn(ctx, prop.ChainId) && len(k.GetToBeOptedIn(ctx, prop.ChainId)) == 0 {
// drop the proposal
ctx.Logger().Info("could not start Opt In consumer chain (%s) because no validator has opted in",
prop.ChainId)
Expand Down
2 changes: 1 addition & 1 deletion x/ccv/provider/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ func (k Keeper) EndBlockCCR(ctx sdk.Context) {
}
}

// getMappedInfractionHeight gets the infraction height mapped from validator set ID for the given chain ID
// getMappedInfractionHeight gets the infraction height mapped from val set ID for the given chain ID
func (k Keeper) getMappedInfractionHeight(ctx sdk.Context,
chainID string, valsetUpdateID uint64,
) (height uint64, found bool) {
Expand Down
4 changes: 2 additions & 2 deletions x/ccv/provider/keeper/relay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func TestHandleSlashPacket(t *testing.T) {
return testkeeper.GetMocksForHandleSlashPacket(
ctx, mocks,
providerConsAddr, // expected provider cons addr returned from GetProviderAddrFromConsumerAddr
stakingtypes.Validator{Jailed: false}, // staking keeper validator to return
stakingtypes.Validator{Jailed: false}, // staking keeper val to return
true) // expectJailing = true
},
1,
Expand All @@ -402,7 +402,7 @@ func TestHandleSlashPacket(t *testing.T) {
return testkeeper.GetMocksForHandleSlashPacket(
ctx, mocks,
providerConsAddr, // expected provider cons addr returned from GetProviderAddrFromConsumerAddr
stakingtypes.Validator{Jailed: true}, // staking keeper validator to return
stakingtypes.Validator{Jailed: true}, // staking keeper val to return
false) // expectJailing = false, validator is already jailed.
},
1,
Expand Down
2 changes: 1 addition & 1 deletion x/ccv/provider/keeper/throttle.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
func (k Keeper) GetEffectiveValPower(ctx sdktypes.Context,
valConsAddr providertypes.ProviderConsAddress,
) math.Int {
// Obtain staking module validator object from the provider's consensus address.
// Obtain staking module val object from the provider's consensus address.
// Note: if validator is not found or unbonded, this will be handled appropriately in HandleSlashPacket
val, found := k.stakingKeeper.GetValidatorByConsAddr(ctx, valConsAddr.ToSdkConsAddr())

Expand Down

0 comments on commit 4bc4887

Please sign in to comment.