INetworkService implement ServiceAPI

This commit is contained in:
mhchia 2020-01-26 23:55:31 +08:00
parent ddfbf9ffc8
commit 42bc4d5d06
No known key found for this signature in database
GPG Key ID: 389EFBEA1362589A
2 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Dict, Sequence from typing import TYPE_CHECKING, Dict, Sequence
from async_service import Service from async_service import ServiceAPI
from multiaddr import Multiaddr from multiaddr import Multiaddr
from libp2p.network.connection.net_connection_interface import INetConn from libp2p.network.connection.net_connection_interface import INetConn
@ -73,5 +73,5 @@ class INetwork(ABC):
pass pass
class INetworkService(INetwork, Service): class INetworkService(INetwork, ServiceAPI):
... ...

View File

@ -1,6 +1,7 @@
import logging import logging
from typing import Dict, List, Optional from typing import Dict, List, Optional
from async_service import Service
from multiaddr import Multiaddr from multiaddr import Multiaddr
from libp2p.io.abc import ReadWriteCloser from libp2p.io.abc import ReadWriteCloser
@ -30,7 +31,7 @@ from .stream.net_stream_interface import INetStream
logger = logging.getLogger("libp2p.network.swarm") logger = logging.getLogger("libp2p.network.swarm")
class Swarm(INetworkService): class Swarm(Service, INetworkService):
self_id: ID self_id: ID
peerstore: IPeerStore peerstore: IPeerStore