You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
653 B

  1. package e2e_test
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/stretchr/testify/require"
  6. )
  7. // assert that all nodes that have blocks at the height of a misbehavior has evidence
  8. // for that misbehavior
  9. func TestEvidence_Misbehavior(t *testing.T) {
  10. ctx, cancel := context.WithCancel(context.Background())
  11. defer cancel()
  12. blocks := fetchBlockChain(ctx, t)
  13. testnet := loadTestnet(t)
  14. seenEvidence := 0
  15. for _, block := range blocks {
  16. if len(block.Evidence.Evidence) != 0 {
  17. seenEvidence += len(block.Evidence.Evidence)
  18. }
  19. }
  20. require.Equal(t, testnet.Evidence, seenEvidence,
  21. "difference between the amount of evidence produced and committed")
  22. }