mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
chore: fix linting issues
This commit is contained in:
@ -1,5 +1,3 @@
|
||||
from typing import Literal
|
||||
|
||||
"""
|
||||
Configuration classes for QUIC transport.
|
||||
"""
|
||||
@ -9,7 +7,7 @@ from dataclasses import (
|
||||
field,
|
||||
)
|
||||
import ssl
|
||||
from typing import Any, TypedDict
|
||||
from typing import Any, Literal, TypedDict
|
||||
|
||||
from libp2p.custom_types import TProtocol
|
||||
|
||||
|
||||
@ -500,7 +500,7 @@ class QUICListener(IListener):
|
||||
try:
|
||||
quic_conn.tls._request_client_certificate = True
|
||||
logger.debug(
|
||||
"request_client_certificate set to True in server TLS context"
|
||||
"request_client_certificate set to True in server TLS"
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"FAILED to apply request_client_certificate: {e}")
|
||||
@ -694,7 +694,7 @@ class QUICListener(IListener):
|
||||
|
||||
if dest_cid in self._connections:
|
||||
logger.debug(
|
||||
f"⚠️ PROMOTE: Connection {dest_cid.hex()} already exists in _connections!"
|
||||
f"⚠️ Connection {dest_cid.hex()} already exists in _connections!"
|
||||
)
|
||||
connection = self._connections[dest_cid]
|
||||
else:
|
||||
|
||||
@ -292,15 +292,15 @@ class LibP2PExtensionHandler:
|
||||
return signature
|
||||
else:
|
||||
logger.debug(
|
||||
f"❌ Cannot extract 64 bytes from {len(signature_data)} byte signature"
|
||||
f"Cannot extract 64 bytes from {len(signature_data)} byte signature"
|
||||
)
|
||||
return signature_data
|
||||
|
||||
@staticmethod
|
||||
def _extract_secp256k1_signature(signature_data: bytes) -> bytes:
|
||||
"""
|
||||
Extract Secp256k1 signature.
|
||||
Secp256k1 can use either DER-encoded or raw format depending on the implementation.
|
||||
Extract Secp256k1 signature. Secp256k1 can use either DER-encoded
|
||||
or raw format depending on the implementation.
|
||||
"""
|
||||
logger.debug("🔧 Extracting Secp256k1 signature")
|
||||
|
||||
@ -445,11 +445,12 @@ class LibP2PExtensionHandler:
|
||||
return signature
|
||||
elif len(signature) > expected_total_length:
|
||||
logger.debug(
|
||||
f"🔧 Truncating DER signature from {len(signature)} to {expected_total_length} bytes"
|
||||
"Truncating DER signature from "
|
||||
f"{len(signature)} to {expected_total_length} bytes"
|
||||
)
|
||||
return signature[:expected_total_length]
|
||||
else:
|
||||
logger.debug(f"⚠️ DER signature is shorter than expected, using as-is")
|
||||
logger.debug("DER signature is shorter than expected, using as-is")
|
||||
return signature
|
||||
|
||||
|
||||
@ -823,7 +824,7 @@ class QUICTLSSecurityConfig:
|
||||
return {"error": str(e)}
|
||||
|
||||
def debug_config(self) -> None:
|
||||
"""print debugging information about this configuration."""
|
||||
"""Print debugging information about this configuration."""
|
||||
print(f"=== TLS Security Config Debug ({self.config_name or 'unnamed'}) ===")
|
||||
print(f"Is client config: {self.is_client_config}")
|
||||
print(f"ALPN protocols: {self.alpn_protocols}")
|
||||
|
||||
Reference in New Issue
Block a user