3.0.ipv8.attestation.wallet.database ==================================== .. py:module:: 3.0.ipv8.attestation.wallet.database Attributes ---------- .. autoapisummary:: 3.0.ipv8.attestation.wallet.database.DATABASE_DIRECTORY Classes ------- .. autoapisummary:: 3.0.ipv8.attestation.wallet.database.SecretKeyProtocol 3.0.ipv8.attestation.wallet.database.AttestationsDB Module Contents --------------- .. py:data:: DATABASE_DIRECTORY .. py:class:: SecretKeyProtocol Bases: :py:obj:`typing_extensions.Protocol` Protocol to detect key-like objects. .. py:method:: public_key() -> Any Get the associated public key. .. py:method:: serialize() -> bytes Serialize to bytes. .. py:class:: AttestationsDB(working_directory: str, db_name: str) Bases: :py:obj:`3.0.ipv8.database.Database` Database to store attestations. .. py:attribute:: LATEST_DB_VERSION :value: 2 .. py:attribute:: db_name .. py:method:: _get(query: str, params: _typeshed.SupportsLenAndGetItem | collections.abc.Mapping[str, Any]) -> list[bytes] .. py:method:: get_attestation_by_hash(attestation_hash: bytes) -> list[bytes] Retrieve a serialized attestation by hash. .. py:method:: get_all() -> list[collections.abc.Sequence[bytes]] Get all serialized attestations we know of. .. py:method:: insert_attestation(attestation: 3.0.ipv8.attestation.identity_formats.Attestation, attestation_hash: bytes, secret_key: SecretKeyProtocol, id_format: str) -> None Insert an attestation into the database. .. py:method:: get_schema(version: int) -> str Return the schema for the database. .. py:method:: get_upgrade_script(current_version: int) -> str | None Return the upgrade script for a specific version. :param current_version: the version of the script to return. .. py:method:: check_database(database_version: bytes) -> int Ensure the proper schema is used by the database. :param database_version: Current version of the database. :returns: None.