Skip to content

Commit

Permalink
add integration tests for misbehaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
sainoe committed Nov 17, 2023
1 parent 86fb5cd commit 6ebcec4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/integration/misbehaviour.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,14 @@ func (s *CCVTestSuite) TestCheckMisbehaviour() {
altSigners2,
)

// Set the equivocation evidence min height to a the previous block height
equivocationEvidenceMinHeight := clientHeight.RevisionHeight + 1
s.providerApp.GetProviderKeeper().SetEquivocationEvidenceMinHeight(
s.providerCtx(),
s.consumerChain.ChainID,
equivocationEvidenceMinHeight,
)

testCases := []struct {
name string
misbehaviour *ibctmtypes.Misbehaviour
Expand Down Expand Up @@ -476,6 +484,24 @@ func (s *CCVTestSuite) TestCheckMisbehaviour() {
},
false,
},
{
"invalid misbehaviour older than min equivocation evidence height - shouldn't pass",
&ibctmtypes.Misbehaviour{
ClientId: s.path.EndpointA.ClientID,
Header1: s.consumerChain.CreateTMClientHeader(
s.consumerChain.ChainID,
int64(equivocationEvidenceMinHeight-1),
clientHeight,
headerTs,
altValset,
altValset,
clientTMValset,
altSigners,
),
Header2: clientHeader,
},
false,
},
{
"one header of the misbehaviour has insufficient voting power - shouldn't pass",
&ibctmtypes.Misbehaviour{
Expand Down

0 comments on commit 6ebcec4

Please sign in to comment.