From c3afb3d48ad1701ed0998b6aab2a9abf0d6b7657 Mon Sep 17 00:00:00 2001 From: Robert Zajac Date: Fri, 26 Oct 2018 15:51:25 -0400 Subject: [PATCH] Removing notion of context from peerstore --- peer/addrbook_interface.py | 4 ++-- peer/peermetadata_interface.py | 4 ++-- peer/peerstore.py | 4 ++-- peer/peerstore_interface.py | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/peer/addrbook_interface.py b/peer/addrbook_interface.py index c27bd67..af76189 100644 --- a/peer/addrbook_interface.py +++ b/peer/addrbook_interface.py @@ -2,8 +2,8 @@ from abc import ABC, abstractmethod class IAddrBook(ABC): - def __init__(self, context): - self.context = context + def __init__(self): + pass @abstractmethod def add_addr(self, peer_id, addr, ttl): diff --git a/peer/peermetadata_interface.py b/peer/peermetadata_interface.py index 6fda82f..4f62359 100644 --- a/peer/peermetadata_interface.py +++ b/peer/peermetadata_interface.py @@ -2,8 +2,8 @@ from abc import ABC, abstractmethod class IPeerMetadata(ABC): - def __init__(self, context): - self.context = context + def __init__(self): + pass @abstractmethod def get(self, peer_id, key): diff --git a/peer/peerstore.py b/peer/peerstore.py index 3922b7f..5f17782 100644 --- a/peer/peerstore.py +++ b/peer/peerstore.py @@ -3,8 +3,8 @@ from .peerdata import PeerData class PeerStore(IPeerStore): - def __init__(self, context): - IPeerStore.__init__(self, context) + def __init__(self): + IPeerStore.__init__(self) self.peer_map = {} def __create_or_get_peer(self, peer_id): diff --git a/peer/peerstore_interface.py b/peer/peerstore_interface.py index 67f75c1..3ce33f2 100644 --- a/peer/peerstore_interface.py +++ b/peer/peerstore_interface.py @@ -4,9 +4,9 @@ from .peermetadata_interface import IPeerMetadata class IPeerStore(ABC, IAddrBook, IPeerMetadata): - def __init__(self, context): - IPeerMetadata.__init__(self, context) - IAddrBook.__init__(self, context) + def __init__(self): + IPeerMetadata.__init__(self) + IAddrBook.__init__(self) @abstractmethod def peer_info(self, peer_id):