latest.ipv8.attestation.wallet.database

Module Contents

Classes

SecretKeyProtocol

Protocol to detect key-like objects.

AttestationsDB

Database to store attestations.

Attributes

DATABASE_DIRECTORY

latest.ipv8.attestation.wallet.database.DATABASE_DIRECTORY
class latest.ipv8.attestation.wallet.database.SecretKeyProtocol

Bases: typing_extensions.Protocol

Protocol to detect key-like objects.

public_key() Any

Get the associated public key.

serialize() bytes

Serialize to bytes.

class latest.ipv8.attestation.wallet.database.AttestationsDB(working_directory: str, db_name: str)

Bases: latest.ipv8.database.Database

Database to store attestations.

LATEST_DB_VERSION = 2
_get(query: str, params: _typeshed.SupportsLenAndGetItem | collections.abc.Mapping[str, Any]) list[bytes]
get_attestation_by_hash(attestation_hash: bytes) list[bytes]

Retrieve a serialized attestation by hash.

get_all() list[Sequence[bytes]]

Get all serialized attestations we know of.

insert_attestation(attestation: latest.ipv8.attestation.identity_formats.Attestation, attestation_hash: bytes, secret_key: SecretKeyProtocol, id_format: str) None

Insert an attestation into the database.

get_schema(version: int) str

Return the schema for the database.

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.

check_database(database_version: bytes) int

Ensure the proper schema is used by the database.

Parameters:

database_version – Current version of the database.

Returns:

None.