Skip to content

Commit

Permalink
Update x/ccv/provider/keeper/punish_validator.go
Browse files Browse the repository at this point in the history
Co-authored-by: insumity <[email protected]>
  • Loading branch information
sainoe and insumity authored Oct 12, 2023
1 parent c858173 commit fb92af9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions x/ccv/provider/keeper/punish_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func (k Keeper) SlashValidator(ctx sdk.Context, providerAddr types.ProviderConsA
return errorsmod.Wrapf(slashingtypes.ErrNoValidatorForAddress, "provider consensus address: %s", providerAddr.String())
}

// check if the validator is unbonded to prevent panicking when slashing (see cosmos/cosmos-sdk/blob/v0.47.5/x/staking/keeper/slash.go#L61)

Check failure on line 88 in x/ccv/provider/keeper/punish_validator.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) -s prefix(github.com/cometbft/cometbft) -s prefix(github.com/cosmos/interchain-security) --custom-order (gci)
if validator.IsUnbonded() {
return fmt.Errorf("validator is unbonded. provider consensus address: %s", providerAddr.String())
}
Expand Down

0 comments on commit fb92af9

Please sign in to comment.