Skip to content

Commit 62162db

Browse files
committed
Fix type hints
1 parent f1bb85f commit 62162db

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

trinity/protocol/bcc/peer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
BasePeerFactory,
66
BasePeerPool,
77
)
8-
# noinspection PyProtectedMember
98
from p2p.protocol import (
109
Command,
1110
_DecodedMsgType,

trinity/protocol/bcc/servers.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
cast,
3232
Any,
3333
Dict,
34+
Iterable,
3435
Set,
3536
Type,
3637
)
@@ -60,7 +61,7 @@ async def _handle_msg(self, base_peer: BasePeer, cmd: Command,
6061
else:
6162
raise Exception("Invariant: Only subscribed to GetBeaconBlocks")
6263

63-
async def _handle_get_beacon_blocks(self, peer: BCCPeer, msg: Dict[str, Any]):
64+
async def _handle_get_beacon_blocks(self, peer: BCCPeer, msg: Dict[str, Any]) -> None:
6465
if not peer.is_operational:
6566
return
6667

@@ -99,7 +100,9 @@ async def _handle_get_beacon_blocks(self, peer: BCCPeer, msg: Dict[str, Any]):
99100
peer.sub_proto.send_blocks(blocks)
100101

101102
@to_tuple
102-
def _get_blocks(self, start_block: BaseBeaconBlock, max_blocks: int):
103+
def _get_blocks(self,
104+
start_block: BaseBeaconBlock,
105+
max_blocks: int) -> Iterable[BaseBeaconBlock]:
103106
if max_blocks <= 0:
104107
return
105108

trinity/protocol/common/servers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from p2p.service import BaseService
2626

2727
from trinity.db.header import AsyncHeaderDB
28-
from trinity.protocol.common.peer import BaseChainPeerPool
28+
from trinity.protocol.common.peer import BasePeerPool
2929
from trinity.protocol.common.requests import BaseHeaderRequest
3030
from trinity.utils.logging import HasExtendedDebugLogger
3131

@@ -42,7 +42,7 @@ class BaseRequestServer(BaseService, PeerSubscriber):
4242

4343
def __init__(
4444
self,
45-
peer_pool: BaseChainPeerPool,
45+
peer_pool: BasePeerPool,
4646
token: CancelToken = None) -> None:
4747
super().__init__(token)
4848
self._peer_pool = peer_pool

0 commit comments

Comments
 (0)