@patch('bigchaindb.voting.Voting.verify_vote_signature', return_value=True)
def test_duplicate_vote_throws_critical_error(b):
    keyring = 'abc'
    block = {'id': 'xyz', 'block': {'voters': 'ab'}}
    votes = [{'node_pubkey': c, 'vote': {'is_block_valid': True, 'previous_block': 'a'}} for c in 'aabc']
    with pytest.raises(CriticalDuplicateVote):
        Voting.block_election(block, votes, keyring)
@patch('bigchaindb.voting.Voting.verify_vote_signature', return_value=True)
def test_duplicate_vote_throws_critical_error(b):
    keyring = 'abc'
    block = {'id': 'xyz', 'block': {'voters': 'ab'}}
    votes = [{'node_pubkey': c, 'vote': {'is_block_valid': True, 'previous_block': 'a'}} for c in 'aabc']
    with pytest.raises(CriticalDuplicateVote):
        Voting.block_election(block, votes, keyring)