style: enforce multiline import style for consistency

This commit is contained in:
Luca Vivona
2025-06-21 15:08:11 -04:00
parent 811c217ee6
commit ebdde7b5aa
3 changed files with 11 additions and 8 deletions

View File

@ -1,5 +1,5 @@
"""
Common Objects for Kademlia DHT implementation.
Shared constants and protocol parameters for the Kademlia DHT.
"""
from libp2p.custom_types import (

View File

@ -5,7 +5,9 @@ This module provides a complete Distributed Hash Table (DHT)
implementation based on the Kademlia algorithm and protocol.
"""
from enum import Enum
from enum import (
Enum,
)
import logging
import time

View File

@ -2,13 +2,17 @@
Kademlia DHT routing table implementation.
"""
from collections import OrderedDict
from collections import (
OrderedDict,
)
import logging
import time
import trio
from libp2p.abc import IHost
from libp2p.abc import (
IHost,
)
from libp2p.kad_dht.utils import (
xor_distance,
)
@ -238,12 +242,9 @@ class KBucket:
if not peer_info:
raise ValueError(f"Peer {peer_id} not in bucket")
# Default protocol ID for Kademlia DHT
protocol_id = PROTOCOL_ID
try:
# Open a stream to the peer with the DHT protocol
stream = await self.host.new_stream(peer_id, [protocol_id])
stream = await self.host.new_stream(peer_id, [PROTOCOL_ID])
try:
# Create ping protobuf message