code: def Serialize(self, writer):
          
          try:
              writer.WriteByte(self.Type)
              writer.WriteHashes(self.Hashes)
          except Exception as e:
              logger.error(f"COULD NOT WRITE INVENTORY HASHES ({self.Type} {self.Hashes}) {e}")
docs: Serialize object.
  
          Raises:
              Exception: if hash writing fails.
  
          Args:
              writer (neo.IO.BinaryWriter):