diff --git a/tests/e2e/misbehaviour.go b/tests/e2e/misbehaviour.go index 8b2e96f501..342f33e67a 100644 --- a/tests/e2e/misbehaviour.go +++ b/tests/e2e/misbehaviour.go @@ -68,8 +68,10 @@ func (s *CCVTestSuite) TestHandleConsumerMisbehaviour() { for _, v := range altValset.Validators { consuAddr := sdk.ConsAddress(v.Address.Bytes()) provAddr := s.providerApp.GetProviderKeeper().GetProviderAddrFromConsumerAddr(s.providerCtx(), s.consumerChain.ChainID, consuAddr) - s.providerApp.GetE2eStakingKeeper().ValidatorByConsAddr(s.providerCtx(), consuAddr) - val, ok := s.providerApp.GetProviderKeeper().stakingKeeper.GetValidatorByConsAddr(s.providerCtx(), provAddr) + val, ok := s.providerApp.GetE2eStakingKeeper().GetValidatorByConsAddr(s.providerCtx(), provAddr) + s.Require().True(ok) + s.Require().True(val.Jailed) + s.Require().True(s.providerApp.GetE2eSlashingKeeper().IsTombstoned(s.providerCtx(), provAddr)) } } diff --git a/x/ccv/provider/keeper/misbehaviour.go b/x/ccv/provider/keeper/misbehaviour.go index 93e4e6985f..5a612ca57e 100644 --- a/x/ccv/provider/keeper/misbehaviour.go +++ b/x/ccv/provider/keeper/misbehaviour.go @@ -36,6 +36,8 @@ func (k Keeper) HandleConsumerMisbehaviour(ctx sdk.Context, misbehaviour ibctmty k.Logger(ctx).Error("validator not found or is unbonded", provAddr.String()) continue } + // TODO: continue if validator is already tombstoned/jailed + log + k.stakingKeeper.Jail(ctx, provAddr) k.slashingKeeper.JailUntil(ctx, provAddr, evidencetypes.DoubleSignJailEndTime) k.slashingKeeper.Tombstone(ctx, provAddr) // store misbehaviour?