latest.ipv8.attestation.wallet.caches

Module Contents

Classes

HashCache

Cache tied to a hash.

PeerCache

Cache tied to a peer (mid).

ReceiveAttestationVerifyCache

Pending attestation transfer, after request for attestation verification.

ReceiveAttestationRequestCache

Pending attestation transfer, after request for a new attestation.

ProvingAttestationCache

Pending attestation verification, stores expected relmap, hashed challenges and completion callback.

PendingChallengeCache

Single pending challenge for a ProvingAttestationCache.

class latest.ipv8.attestation.wallet.caches.HashCache(request_cache: latest.ipv8.requestcache.RequestCache, prefix: str, cache_hash: bytes, id_format: str)

Bases: latest.ipv8.requestcache.NumberCache

Cache tied to a hash.

classmethod id_from_hash(prefix: str, cache_hash: bytes) tuple[str, int]

Get a cache prefix and identifier from a hash.

class latest.ipv8.attestation.wallet.caches.PeerCache(request_cache: latest.ipv8.requestcache.RequestCache, prefix: str, mid: bytes, id_format: str)

Bases: latest.ipv8.requestcache.NumberCache

Cache tied to a peer (mid).

property timeout_delay: float

The default timeout is two minutes.

classmethod id_from_address(prefix: str, mid: bytes) tuple[str, int]

Get a cache prefix and identifier from an mid.

class latest.ipv8.attestation.wallet.caches.ReceiveAttestationVerifyCache(community: latest.ipv8.types.AttestationCommunity, cache_hash: bytes, id_format: str)

Bases: HashCache

Pending attestation transfer, after request for attestation verification.

property timeout_delay: float

The default timeout is two minutes.

on_timeout() None

Too bad, nothing gained and nothing lost: log and drop the cache.

class latest.ipv8.attestation.wallet.caches.ReceiveAttestationRequestCache(community: latest.ipv8.types.AttestationCommunity, mid: bytes, key: Any, name: str, id_format: str)

Bases: PeerCache

Pending attestation transfer, after request for a new attestation. Stores one-time key for this attribute attestation.

on_timeout() None

Too bad, nothing gained and nothing lost: log and drop the cache.

class latest.ipv8.attestation.wallet.caches.ProvingAttestationCache(community: latest.ipv8.types.AttestationCommunity, cache_hash: bytes, id_format: str, public_key: Any | None = None, on_complete: Callable[[bytes, dict], None] = lambda x, y: ...)

Bases: HashCache

Pending attestation verification, stores expected relmap, hashed challenges and completion callback.

property timeout_delay: float

The default timeout is two minutes.

on_timeout() None

Too bad, nothing gained and nothing lost: log and drop the cache.

class latest.ipv8.attestation.wallet.caches.PendingChallengeCache(community: latest.ipv8.types.AttestationCommunity, cache_hash: bytes, proving_cache: ProvingAttestationCache, id_format: str, honesty_check: int = -1)

Bases: HashCache

Single pending challenge for a ProvingAttestationCache.

on_timeout() None

Too bad, nothing gained and nothing lost: log and drop the cache.