From 235c7031c99f907c64b9db7818f4c54ed4cf0637 Mon Sep 17 00:00:00 2001 From: Youngjoon Lee <5462944+youngjoon-lee@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:34:13 +0900 Subject: [PATCH] fix --- mixnet/node.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mixnet/node.py b/mixnet/node.py index 34add83..e914a68 100644 --- a/mixnet/node.py +++ b/mixnet/node.py @@ -15,10 +15,10 @@ from pysphinx.sphinx import ( from mixnet.config import GlobalConfig, NodeConfig from mixnet.packet import Fragment, MessageFlag, MessageReconstructor, PacketBuilder -NetworkPacket: TypeAlias = "SphinxPacket | bytes" -NetworkPacketQueue: TypeAlias = "asyncio.Queue[NetworkPacket]" +NetworkPacket: TypeAlias = SphinxPacket | bytes +NetworkPacketQueue: TypeAlias = asyncio.Queue[NetworkPacket] Connection: TypeAlias = NetworkPacketQueue -BroadcastChannel: TypeAlias = "asyncio.Queue[bytes]" +BroadcastChannel: TypeAlias = asyncio.Queue[bytes] class Node: @@ -47,8 +47,8 @@ class Node: return processed.next_packet case ProcessedFinalHopPacket(): await self.__process_sphinx_payload(processed.payload) - except Exception: - # Return SphinxPacket as it is, if this node cannot unwrap it. + except ValueError: + # Return SphinxPacket as it is, if it cannot be unwrapped by the private key of this node. return packet async def __process_sphinx_payload(self, payload: Payload):