- fn serialize(&self, for_local_storage: bool) -> Vec<u8> {
- let mut res = Vec::new();
- res.push(SERIALIZATION_VERSION);
- res.push(MIN_SERIALIZATION_VERSION);
+ fn write<W: Writer>(&self, writer: &mut W, for_local_storage: bool) -> Result<(), ::std::io::Error> {
+ //TODO: We still write out all the serialization here manually instead of using the fancy
+ //serialization framework we have, we should migrate things over to it.
+ writer.write_all(&[SERIALIZATION_VERSION; 1])?;
+ writer.write_all(&[MIN_SERIALIZATION_VERSION; 1])?;