Skip to content

Commit

Permalink
pass first jailing integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
sainoe committed Jun 16, 2023
1 parent 5d5fa21 commit 8a722e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/e2e/misbehaviour.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

}
Expand Down
2 changes: 2 additions & 0 deletions x/ccv/provider/keeper/misbehaviour.go
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 8a722e4

Please sign in to comment.