Skip to content

Commit

Permalink
call ValidateBasic on SlashPacket
Browse files Browse the repository at this point in the history
  • Loading branch information
MSalopek committed Dec 23, 2022
1 parent b61ce3b commit f30ecf6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions x/ccv/provider/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ func (k Keeper) OnRecvSlashPacket(ctx sdk.Context, packet channeltypes.Packet, d
func (k Keeper) ValidateSlashPacket(ctx sdk.Context, chainID string,
packet channeltypes.Packet, data ccv.SlashPacketData) error {

if err := data.ValidateBasic(); err != nil {
return err
}

// return error if we cannot find infraction height matching the validator update id
if _, found := k.getMappedInfractionHeight(ctx, chainID, data.ValsetUpdateId); !found {
return providertypes.ErrSlashPacketInfractionHeightInvalid
Expand Down
1 change: 0 additions & 1 deletion x/ccv/provider/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ var (
ErrInvalidConsumerParams = sdkerrors.Register(ModuleName, 11, "invalid consumer params")
ErrSlashPacketInfractionHeightInvalid = sdkerrors.Register(ModuleName, 12, "cannot find infraction height")
ErrSlashPacketInfractionTypeInvalid = sdkerrors.Register(ModuleName, 13, "infraction type invalid")
ErrSlashPacketOutdated = sdkerrors.Register(ModuleName, 14, "slash packet out of date")
)

0 comments on commit f30ecf6

Please sign in to comment.