3.0.ipv8.attestation.wallet.caches ================================== .. py:module:: 3.0.ipv8.attestation.wallet.caches Classes ------- .. autoapisummary:: 3.0.ipv8.attestation.wallet.caches.HashCache 3.0.ipv8.attestation.wallet.caches.PeerCache 3.0.ipv8.attestation.wallet.caches.ReceiveAttestationVerifyCache 3.0.ipv8.attestation.wallet.caches.ReceiveAttestationRequestCache 3.0.ipv8.attestation.wallet.caches.ProvingAttestationCache 3.0.ipv8.attestation.wallet.caches.PendingChallengeCache Module Contents --------------- .. py:class:: HashCache(request_cache: 3.0.ipv8.requestcache.RequestCache, prefix: str, cache_hash: bytes, id_format: str) Bases: :py:obj:`3.0.ipv8.requestcache.NumberCache` Cache tied to a hash. .. py:attribute:: id_format .. py:method:: id_from_hash(prefix: str, cache_hash: bytes) -> tuple[str, int] :classmethod: Get a cache prefix and identifier from a hash. .. py:class:: PeerCache(request_cache: 3.0.ipv8.requestcache.RequestCache, prefix: str, mid: bytes, id_format: str) Bases: :py:obj:`3.0.ipv8.requestcache.NumberCache` Cache tied to a peer (mid). .. py:attribute:: id_format .. py:method:: id_from_address(prefix: str, mid: bytes) -> tuple[str, int] :classmethod: Get a cache prefix and identifier from an mid. .. py:property:: timeout_delay :type: float The default timeout is two minutes. .. py:class:: ReceiveAttestationVerifyCache(community: 3.0.ipv8.types.AttestationCommunity, cache_hash: bytes, id_format: str) Bases: :py:obj:`HashCache` Pending attestation transfer, after request for attestation verification. .. py:attribute:: attestation_map :type: set[tuple[int, bytes]] .. py:method:: on_timeout() -> None Too bad, nothing gained and nothing lost: log and drop the cache. .. py:property:: timeout_delay :type: float The default timeout is two minutes. .. py:class:: ReceiveAttestationRequestCache(community: 3.0.ipv8.types.AttestationCommunity, mid: bytes, key: Any, name: str, id_format: str) Bases: :py:obj:`PeerCache` Pending attestation transfer, after request for a new attestation. Stores one-time key for this attribute attestation. .. py:attribute:: attestation_map :type: set[tuple[int, bytes]] .. py:attribute:: key .. py:attribute:: name .. py:method:: on_timeout() -> None Too bad, nothing gained and nothing lost: log and drop the cache. .. py:class:: ProvingAttestationCache(community: 3.0.ipv8.types.AttestationCommunity, cache_hash: bytes, id_format: str, public_key: Any | None = None, on_complete: Callable[[bytes, dict], None] = lambda x, y: None) Bases: :py:obj:`HashCache` Pending attestation verification, stores expected relmap, hashed challenges and completion callback. .. py:attribute:: hash .. py:attribute:: public_key .. py:attribute:: relativity_map :type: dict[int, int] .. py:attribute:: hashed_challenges :type: list[bytes] :value: [] .. py:attribute:: challenges :type: list[bytes] :value: [] .. py:attribute:: attestation_callbacks .. py:method:: on_timeout() -> None Too bad, nothing gained and nothing lost: log and drop the cache. .. py:property:: timeout_delay :type: float The default timeout is two minutes. .. py:class:: PendingChallengeCache(community: 3.0.ipv8.types.AttestationCommunity, cache_hash: bytes, proving_cache: ProvingAttestationCache, id_format: str, honesty_check: int = -1) Bases: :py:obj:`HashCache` Single pending challenge for a ProvingAttestationCache. .. py:attribute:: proving_cache .. py:attribute:: honesty_check .. py:method:: on_timeout() -> None Too bad, nothing gained and nothing lost: log and drop the cache.