mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-03 10:32:05 +00:00
* types: replaced EvidenceData in block structure with EvidenceList * types: introduced toProto, fromProto functions to EvidenceList * updated Changelog * Removed comments from tests
27 lines
635 B
Go
27 lines
635 B
Go
package e2e_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
// assert that all nodes that have blocks at the height of a misbehavior has evidence
|
|
// for that misbehavior
|
|
func TestEvidence_Misbehavior(t *testing.T) {
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
defer cancel()
|
|
|
|
blocks := fetchBlockChain(ctx, t)
|
|
testnet := loadTestnet(t)
|
|
seenEvidence := 0
|
|
for _, block := range blocks {
|
|
if len(block.Evidence) != 0 {
|
|
seenEvidence += len(block.Evidence)
|
|
}
|
|
}
|
|
require.Equal(t, testnet.Evidence, seenEvidence,
|
|
"difference between the amount of evidence produced and committed")
|
|
}
|