expects high synchrony!
(block *types.Block, activeVals map[string]struct{})
| 666 | |
| 667 | // expects high synchrony! |
| 668 | func validateBlock(block *types.Block, activeVals map[string]struct{}) error { |
| 669 | if block.LastCommit.Size() != len(activeVals) { |
| 670 | return fmt.Errorf( |
| 671 | "commit size doesn't match number of active validators. Got %d, expected %d", |
| 672 | block.LastCommit.Size(), |
| 673 | len(activeVals)) |
| 674 | } |
| 675 | |
| 676 | for _, commitSig := range block.LastCommit.Signatures { |
| 677 | if _, ok := activeVals[string(commitSig.ValidatorAddress)]; !ok { |
| 678 | return fmt.Errorf("found vote for inactive validator %X", commitSig.ValidatorAddress) |
| 679 | } |
| 680 | } |
| 681 | return nil |
| 682 | } |
| 683 | |
| 684 | func timeoutWaitGroup(t *testing.T, n int, f func(int), css []*State) { |
| 685 | wg := new(sync.WaitGroup) |
no test coverage detected