From b4900d53da39667fb740882af0db145f0231c710 Mon Sep 17 00:00:00 2001 From: NIC Lin Date: Thu, 5 Dec 2019 15:21:09 +0800 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: Chih Cheng Liang --- libp2p/pubsub/gossipsub.py | 2 +- tests/pubsub/test_gossipsub.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libp2p/pubsub/gossipsub.py b/libp2p/pubsub/gossipsub.py index 7dcac13..af5ea77 100644 --- a/libp2p/pubsub/gossipsub.py +++ b/libp2p/pubsub/gossipsub.py @@ -130,7 +130,7 @@ class GossipSub(IPubsubRouter): # In this case, probably we registered gossipsub to a wrong `protocol_id` # in multistream-select, or wrong versions. raise Exception( - f"This should not happen. Protocol={protocol_id} is not supported." + f"Unreachable: Protocol={protocol_id} is not supported." ) self.peers_to_protocol[peer_id] = protocol_id diff --git a/tests/pubsub/test_gossipsub.py b/tests/pubsub/test_gossipsub.py index e1d562e..030dba4 100644 --- a/tests/pubsub/test_gossipsub.py +++ b/tests/pubsub/test_gossipsub.py @@ -148,7 +148,7 @@ async def test_handle_prune(pubsubs_gsub, hosts): await connect(hosts[index_alice], hosts[index_bob]) - # Wait 3 seconds for heartbeat to allow mesh to connect + # Wait for heartbeat to allow mesh to connect await asyncio.sleep(1) # Check that they are each other's mesh peer