Proof using.
intros.
unfold serialize_raft_data, deserialize_raft_data.
cheerios_crush.
destruct a.
reflexivity.
Qed.
Global Instance raft_data_Serializer : Serializer raft_data :=
{| serialize := serialize_raft_data;
deserialize := deserialize_raft_data;
serialize_deserialize_id := raft_data_serialize_deserialize_id |}.
Definition serialize_raft_input (ri : raft_input) :=
match ri with
| Timeout => serialize x00
| ClientRequest n1 n2 i =>
serialize x01 +$+ serialize n1 +$+ serialize n2 +$+ serialize i
end.
Definition deserialize_raft_input : ByteListReader.t raft_input :=
tag <- deserialize;;
match tag with
| x00 => ByteListReader.ret Timeout
| x01 =>
n1 <- deserialize;;
n2 <- deserialize;;
i <- deserialize;;
ByteListReader.ret (ClientRequest n1 n2 i)
| _ => ByteListReader.error
end.

Lemma raft_input_serialize_deserialize_id :
serialize_deserialize_id_spec serialize_raft_input deserialize_raft_input.