Jelajahi Sumber

run black on updated files

Denis Mazur 4 tahun lalu
induk
melakukan
632c20ce93
1 mengubah file dengan 9 tambahan dan 11 penghapusan
  1. 9 11
      hivemind/p2p/p2p_daemon.py

+ 9 - 11
hivemind/p2p/p2p_daemon.py

@@ -424,12 +424,11 @@ class P2P:
 
     # only registers request-response handlers
     async def _add_protobuf_unary_handler(
-            self,
-            handle_name: str,
-            handler: Callable[[TInputProtobuf, P2PContext], Awaitable[TOutputProtobuf]],
-            input_protobuf_type: type,
+        self,
+        handle_name: str,
+        handler: Callable[[TInputProtobuf, P2PContext], Awaitable[TOutputProtobuf]],
+        input_protobuf_type: type,
     ) -> None:
-
         async def _unary_handler(request: bytes) -> bytes:
             input_serialized = input_protobuf_type().FromString(request)
             context = P2PContext(
@@ -464,17 +463,16 @@ class P2P:
         return response
 
     async def _call_unary_protobuf_handler(
-            self,
-            peer_id: PeerID,
-            handle_name: str,
-            input: TInputProtobuf,
-            output_protobuf_type: type,
+        self,
+        peer_id: PeerID,
+        handle_name: str,
+        input: TInputProtobuf,
+        output_protobuf_type: type,
     ) -> Awaitable[TOutputProtobuf]:
         serialized_input = input.SerializeToString()
         response = await self.unary_call(peer_id, handle_name, serialized_input)
         return output_protobuf_type().FromString(response)
 
-
     def iterate_protobuf_handler(
         self,
         peer_id: PeerID,