Skip to content

Commit

Permalink
Fix isort, typing, tests
Browse files Browse the repository at this point in the history
  • Loading branch information
borzunov committed Oct 8, 2022
1 parent 1e66c6c commit 9ae7bef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hivemind/p2p/p2p_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from contextlib import closing, suppress
from dataclasses import dataclass
from datetime import datetime
from hivemind.p2p.p2p_daemon_bindings.utils import ControlFailure
from importlib.resources import path
from typing import Any, AsyncIterator, Awaitable, Callable, List, Optional, Sequence, Tuple, Type, TypeVar, Union

Expand All @@ -19,6 +18,7 @@
import hivemind.p2p.p2p_daemon_bindings.p2pclient as p2pclient
from hivemind.p2p.p2p_daemon_bindings.control import DEFAULT_MAX_MSG_SIZE, P2PDaemonError, P2PHandlerError
from hivemind.p2p.p2p_daemon_bindings.datastructures import PeerID, PeerInfo, StreamInfo
from hivemind.p2p.p2p_daemon_bindings.utils import ControlFailure
from hivemind.proto import crypto_pb2
from hivemind.proto.p2pd_pb2 import RPCError
from hivemind.utils.asyncio import as_aiter, asingle
Expand Down Expand Up @@ -246,7 +246,7 @@ async def is_identity_taken(
use_auto_relay: bool,
use_ipfs: bool,
use_relay: bool,
) -> None:
) -> bool:
with open(identity_path, "rb") as f:
peer_id = PeerID.from_identity(f.read())

Expand Down
2 changes: 1 addition & 1 deletion tests/test_p2p_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async def test_check_if_identity_free():
id2_path = os.path.join(tempdir, "id2")

p2ps = [await P2P.create(identity_path=id1_path)]
initial_peers = p2ps[0].get_visible_maddrs()
initial_peers = await p2ps[0].get_visible_maddrs()

p2ps.append(await P2P.create(initial_peers=initial_peers))
p2ps.append(await P2P.create(initial_peers=initial_peers, identity_path=id2_path))
Expand Down

0 comments on commit 9ae7bef

Please sign in to comment.