3.0.ipv8.test.messaging.anonymization.mock

Attributes

Classes

Module Contents

3.0.ipv8.test.messaging.anonymization.mock.global_dht_services
class 3.0.ipv8.test.messaging.anonymization.mock.MockDHTProvider(peer: 3.0.ipv8.types.Peer)

Bases: 3.0.ipv8.dht.provider.DHTCommunityProvider

A mocked provider for DHT info.

peer
async peer_lookup(mid: bytes, peer: 3.0.ipv8.types.Peer | None = None) None

Look for peers with the corresponding mid.

async lookup(info_hash: bytes) tuple[bytes, list[3.0.ipv8.messaging.anonymization.tunnel.IntroductionPoint]] | None

Look for peers providing generic SHA-1 resources.

async announce(info_hash: bytes, intro_point: 3.0.ipv8.messaging.anonymization.tunnel.IntroductionPoint) None

Announce that a certain peer is serving a given SHA-1 resource.