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.

22 lines
563 B

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