Skip to content

Commit cbb9aab

Browse files
committed
PR feedback
1 parent 5c06aac commit cbb9aab

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

tests/p2p/test_peer_collect_sub_proto_msgs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async def test_peer_subscriber_filters_messages(request, event_loop):
3636

3737
assert collector not in peer._subscribers
3838

39-
# yeild to let remote and peer transmit.
39+
# yield to let remote and peer transmit.
4040

4141
all_messages = collector.get_messages()
4242
assert len(all_messages) == 5

trinity/protocol/common/managers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,16 @@ def _normalize_response(self, msg: ResponseType) -> ReturnType:
9999
pass
100100

101101
@abstractmethod
102-
def __call__(self) -> ReturnType: # type: ignore
102+
def __call__(self) -> ReturnType:
103103
"""
104104
Subclasses must both implement this method and override the call
105105
signature to properly construct the `Request` object and pass it into
106106
`get_from_peer`
107+
108+
NOTE: It is expected that subclasses will override this method and
109+
change the signature. The change in signature is expected to result in
110+
a type checking failure, and thus all subclasses will also be required
111+
to add an `# type: ignore` comment to make the type checker happy.
107112
"""
108113
pass
109114

trinity/protocol/eth/managers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ class GetBlockHeadersRequestManager(BaseRequestManager):
3636

3737
_response_msg_type: Type[Command] = BlockHeaders
3838

39+
# All `RequestManager` classes are expected to implement the `__call__`
40+
# method, including changing the function signature, thus the
41+
# `# type: ignore` here is both expected and required.
3942
async def __call__(self, # type: ignore
4043
block_number_or_hash: BlockIdentifier,
4144
max_headers: int = None,

trinity/protocol/les/managers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ class GetBlockHeadersRequestManager(BaseRequestManager):
4343

4444
_response_msg_type: Type[Command] = BlockHeaders
4545

46+
# All `RequestManager` classes are expected to implement the `__call__`
47+
# method, including changing the function signature, thus the
48+
# `# type: ignore` here is both expected and required.
4649
async def __call__(self, # type: ignore
4750
block_number_or_hash: BlockIdentifier,
4851
max_headers: int = None,

0 commit comments

Comments
 (0)