Skip to content

Commit

Permalink
Resolve slashing and evidence unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kiragpg committed Sep 22, 2023
1 parent 8b1b166 commit 24aa23f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion x/evidence/types/evidence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestEquivocation_Valid(t *testing.T) {
require.Equal(t, types.TypeEquivocation, e.Type())
require.Equal(t, types.RouteEquivocation, e.Route())
require.Equal(t, "1E10F9267BEA3A9A4AB5302C2C510CC1AFD7C54E232DA5B2E3360DFAFACF7A76", e.Hash().String())
require.Equal(t, "consensus_address: cosmosvalcons1vehk7h6lta047h6lta047h6lta047h6l8m4r53\nheight: 100\npower: 1000000\ntime: \"2006-01-02T15:04:05Z\"\n", e.String())
require.Equal(t, "height: 100\ntime: 2006-01-02T15:04:05Z\npower: 1000000\nconsensus_address: cosmosvalcons1vehk7h6lta047h6lta047h6lta047h6l8m4r53\n", e.String())
require.NoError(t, e.ValidateBasic())
}

Expand Down
8 changes: 4 additions & 4 deletions x/slashing/keeper/rank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestResetWholeValidatorRank(t *testing.T) {
infos = append(infos, info)
return false
})
require.Len(t, infos, 1)
require.Len(t, infos, 2)

tt.prepareScenario(app, ctx, validators[0])

Expand All @@ -79,7 +79,7 @@ func TestResetWholeValidatorRank(t *testing.T) {
infos = append(infos, info)
return false
})
require.Len(t, infos, 1)
require.Len(t, infos, 2)

err := app.CustomSlashingKeeper.ResetWholeValidatorRank(ctx)
require.NoError(t, err)
Expand All @@ -89,7 +89,7 @@ func TestResetWholeValidatorRank(t *testing.T) {
validators = append(validators, *validator)
return false
})
require.Equal(t, 1, len(validators))
require.Equal(t, 2, len(validators))
require.Equal(t, stakingtypes.Active, validators[0].Status)
require.Equal(t, int64(0), validators[0].Rank)
require.Equal(t, int64(0), validators[0].Streak)
Expand All @@ -99,7 +99,7 @@ func TestResetWholeValidatorRank(t *testing.T) {
infos = append(infos, info)
return false
})
require.Len(t, infos, 1)
require.Len(t, infos, 2)
require.Equal(t, ctx.BlockHeight(), infos[0].StartHeight)
require.Equal(t, time.Unix(0, 0).UTC(), infos[0].InactiveUntil.UTC())
require.Equal(t, int64(0), infos[0].MischanceConfidence)
Expand Down

0 comments on commit 24aa23f

Please sign in to comment.