mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
WIP CI Build Errors (#76)
* ignore TODO and kademlia * remove unnecessary pass * fixed swarm warnings * fixed peerdata_interface warnings * fixed peer warnings * fixed rest of linting errors * trying to fix last error * fixed dup errors
This commit is contained in:
@ -45,7 +45,6 @@ class Mplex(IMuxedConn):
|
||||
check connection is fully closed
|
||||
:return: true if successful
|
||||
"""
|
||||
pass
|
||||
|
||||
async def read_buffer(self, stream_id):
|
||||
# Empty buffer or nonexistent stream
|
||||
@ -119,7 +118,8 @@ class Mplex(IMuxedConn):
|
||||
message = data[end_index:end_index + length + 1]
|
||||
|
||||
# Deal with other types of messages
|
||||
flag = header & 0x07
|
||||
# TODO use flag
|
||||
# flag = header & 0x07
|
||||
stream_id = header >> 3
|
||||
|
||||
if stream_id not in self.buffers:
|
||||
|
||||
@ -4,6 +4,7 @@ from ..muxed_stream_interface import IMuxedStream
|
||||
|
||||
|
||||
class MplexStream(IMuxedStream):
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
"""
|
||||
reference: https://github.com/libp2p/go-mplex/blob/master/stream.go
|
||||
"""
|
||||
|
||||
@ -12,7 +12,6 @@ class IMuxedConn(ABC):
|
||||
close connection
|
||||
:return: true if successful
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def is_closed(self):
|
||||
@ -20,7 +19,6 @@ class IMuxedConn(ABC):
|
||||
check connection is fully closed
|
||||
:return: true if successful
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def open_stream(self, protocol_id, peer_id, multi_addr):
|
||||
@ -32,7 +30,6 @@ class IMuxedConn(ABC):
|
||||
:param multi_addr: multi_addr that stream connects to
|
||||
:return: a new stream
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def accept_stream(self):
|
||||
@ -40,4 +37,3 @@ class IMuxedConn(ABC):
|
||||
accepts a muxed stream opened by the other end
|
||||
:return: the accepted stream
|
||||
"""
|
||||
pass
|
||||
|
||||
@ -1,31 +1,27 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class IMuxedStream(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def read(self):
|
||||
"""
|
||||
read from stream
|
||||
reads from the underlying muxed_conn
|
||||
:return: bytes of input
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def write(self, _bytes):
|
||||
"""
|
||||
write to stream
|
||||
writes to the underlying muxed_conn
|
||||
:return: number of bytes written
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def close(self):
|
||||
"""
|
||||
close stream
|
||||
close the underlying muxed_conn
|
||||
:return: true if successful
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def reset(self):
|
||||
@ -34,7 +30,6 @@ class IMuxedStream(ABC):
|
||||
tells this remote side to hang up
|
||||
:return: error/exception
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def set_deadline(self, ttl):
|
||||
@ -42,4 +37,3 @@ class IMuxedStream(ABC):
|
||||
set deadline for muxed stream
|
||||
:return: a new stream
|
||||
"""
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user