mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Lint peer classes
This commit is contained in:
@ -1,49 +1,50 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from .addrbook_interace import IAddrBook
|
||||
from .addrbook_interface import IAddrBook
|
||||
from .peermetadata_interface import IPeerMetadata
|
||||
|
||||
class IPeerStore(ABC, IAddrBook, IPeerMetadata):
|
||||
|
||||
def __init__(self, context):
|
||||
self.context = context
|
||||
def __init__(self, context):
|
||||
IPeerMetadata.__init__(self, context)
|
||||
IAddrBook.__init__(self, context)
|
||||
|
||||
@abstractmethod
|
||||
def peer_info(self, peerID):
|
||||
"""
|
||||
:param peerID: peer ID to get info for
|
||||
@abstractmethod
|
||||
def peer_info(self, peer_id):
|
||||
"""
|
||||
:param peer_id: peer ID to get info for
|
||||
:return: peer info object
|
||||
"""
|
||||
pass
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_protocols(self, peerID):
|
||||
"""
|
||||
:param peerID: peer ID to get protocols for
|
||||
@abstractmethod
|
||||
def get_protocols(self, peer_id):
|
||||
"""
|
||||
:param peer_id: peer ID to get protocols for
|
||||
:return: protocols (as strings), error
|
||||
"""
|
||||
pass
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def add_protocols(self, peerID, protocols):
|
||||
"""
|
||||
:param peerID: peer ID to add protocols for
|
||||
@abstractmethod
|
||||
def add_protocols(self, peer_id, protocols):
|
||||
"""
|
||||
:param peer_id: peer ID to add protocols for
|
||||
:param protocols: protocols to add
|
||||
:return: error
|
||||
"""
|
||||
pass
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def set_protocols(self, peerID, protocols):
|
||||
"""
|
||||
:param peerID: peer ID to set protocols for
|
||||
@abstractmethod
|
||||
def set_protocols(self, peer_id, protocols):
|
||||
"""
|
||||
:param peer_id: peer ID to set protocols for
|
||||
:param protocols: protocols to set
|
||||
:return: error
|
||||
"""
|
||||
pass
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def peers(self):
|
||||
"""
|
||||
@abstractmethod
|
||||
def peers(self):
|
||||
"""
|
||||
:return: all of the peer IDs stored in peer store
|
||||
"""
|
||||
pass
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user