diff --git a/swh/vault/cache.py b/swh/vault/cache.py --- a/swh/vault/cache.py +++ b/swh/vault/cache.py @@ -19,11 +19,11 @@ def __init__(self, **objstorage): self.objstorage = get_objstorage(**objstorage) - def add(self, bundle_type, swhid: CoreSWHID, content): + def add(self, bundle_type, swhid: CoreSWHID, content) -> None: sid = self._get_internal_id(bundle_type, swhid) - return self.objstorage.add(content, sid) + self.objstorage.add(content, sid) - def get(self, bundle_type, swhid: CoreSWHID): + def get(self, bundle_type, swhid: CoreSWHID) -> bytes: sid = self._get_internal_id(bundle_type, swhid) return self.objstorage.get(hashutil.hash_to_bytes(sid)) @@ -31,7 +31,7 @@ sid = self._get_internal_id(bundle_type, swhid) return self.objstorage.delete(hashutil.hash_to_bytes(sid)) - def is_cached(self, bundle_type, swhid: CoreSWHID): + def is_cached(self, bundle_type, swhid: CoreSWHID) -> bool: sid = self._get_internal_id(bundle_type, swhid) return hashutil.hash_to_bytes(sid) in self.objstorage