Proof using.
intros.
unfold serialize_output, deserialize_output.
destruct a;
repeat (cheerios_crush; simpl).
Qed.
Global Instance output_Serializer : Serializer output :=
{| serialize := serialize_output;
deserialize := deserialize_output;
serialize_deserialize_id := output_serialize_deserialize_id |}.
Definition serialize_raft_data (d : raft_data) :=
serialize (currentTerm d) +$+
serialize (votedFor d) +$+
serialize (leaderId d) +$+
serialize (log d) +$+
serialize (commitIndex d) +$+
serialize (lastApplied d) +$+
serialize (stateMachine d) +$+
serialize (nextIndex d) +$+
serialize (matchIndex d) +$+
serialize (shouldSend d) +$+
serialize (votesReceived d) +$+
serialize (type d) +$+
serialize (clientCache d) +$+
serialize (electoralVictories d).
Definition deserialize_raft_data : ByteListReader.t raft_data :=
cT <- deserialize;;
lI <- deserialize;;
l <- deserialize;;
vF <- deserialize;;
cI <- deserialize;;
lA <- deserialize;;
sM <- deserialize;;
nI <- deserialize;;
mI <- deserialize;;
sS <- deserialize;;
vR <- deserialize;;
t <- deserialize;;
cC <- deserialize;;
eV <- deserialize;;
ByteListReader.ret (mkRaft_data cT lI l vF cI lA sM nI mI sS vR t cC eV).

(* Specifications: *)
Lemma raft_data_serialize_deserialize_id :
serialize_deserialize_id_spec serialize_raft_data deserialize_raft_data.