Proof using.
intros. unfold doGenericServer in *.
repeat break_match; find_inversion;
use_applyEntries_spec; simpl in *;
subst; auto.
Qed.

Lemma handleRequestVoteReply_spec :
forall h st h' t r st',
st' = handleRequestVoteReply h st h' t r ->
log st' = log st /\
(forall v, In v (votesReceived st) -> In v (votesReceived st')) /\
((currentTerm st' = currentTerm st /\ type st' = type st)
\/ type st' <> Candidate) /\
(type st <> Leader /\ type st' = Leader ->
(type st = Candidate /\ wonElection (dedup name_eq_dec
(votesReceived st')) = true)).