diff --git a/network/stream.py b/network/stream.py index bc33f03..161a5a7 100644 --- a/network/stream.py +++ b/network/stream.py @@ -3,12 +3,13 @@ import asyncio class Stream(IStream): - def __init__(self, peer_id, maddr): + def __init__(self, peer_id, multi_addr): + IStream.__init__(self, peer_id, multi_addr) self.peer_id = peer_id - ip = maddr.get_protocol_value("ip4") - port = maddr.get_protocol_value("tcp") - + ip = multi_addr.get_protocol_value("ip4") + port = multi_addr.get_protocol_value("tcp") + self.open_connection(ip, port) async def open_connection(self, ip, port): diff --git a/network/stream_interface.py b/network/stream_interface.py index b6ab342..124bb45 100644 --- a/network/stream_interface.py +++ b/network/stream_interface.py @@ -2,9 +2,9 @@ from abc import ABC, abstractmethod class IStream(ABC): - def __init__(self, peer_id, maddr): + def __init__(self, peer_id, multi_addr): self.peer_id = peer_id - self.maddr = maddr + self.multi_addr = multi_addr @abstractmethod def protocol(self):