From 0e834e0d05ba2c31dd823af7c82e9de7ba69e2c8 Mon Sep 17 00:00:00 2001 From: Youngjoon Lee <5462944+youngjoon-lee@users.noreply.github.com> Date: Fri, 19 Jul 2024 16:26:12 +0900 Subject: [PATCH] revert import path changes --- deprecated/__init__.py | 0 deprecated/mixnet_v1/bls.py | 2 +- deprecated/mixnet_v1/client.py | 8 ++++---- deprecated/mixnet_v1/config.py | 4 ++-- deprecated/mixnet_v1/mixnet.py | 10 +++------- deprecated/mixnet_v1/node.py | 4 ++-- deprecated/mixnet_v1/packet.py | 2 +- deprecated/mixnet_v1/test_client.py | 8 ++++---- deprecated/mixnet_v1/test_fisheryates.py | 2 +- deprecated/mixnet_v1/test_mixnet.py | 4 ++-- deprecated/mixnet_v1/test_node.py | 8 ++++---- deprecated/mixnet_v1/test_packet.py | 8 ++++---- deprecated/mixnet_v1/test_utils.py | 10 +++++----- 13 files changed, 33 insertions(+), 37 deletions(-) delete mode 100644 deprecated/__init__.py diff --git a/deprecated/__init__.py b/deprecated/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/deprecated/mixnet_v1/bls.py b/deprecated/mixnet_v1/bls.py index 249d1ce0..a4278b08 100644 --- a/deprecated/mixnet_v1/bls.py +++ b/deprecated/mixnet_v1/bls.py @@ -2,7 +2,7 @@ import blspy -from .utils import random_bytes +from mixnet.utils import random_bytes BlsPrivateKey: TypeAlias = blspy.PrivateKey BlsPublicKey: TypeAlias = blspy.G1Element diff --git a/deprecated/mixnet_v1/client.py b/deprecated/mixnet_v1/client.py index ea2891d5..8d21cf3c 100644 --- a/deprecated/mixnet_v1/client.py +++ b/deprecated/mixnet_v1/client.py @@ -4,10 +4,10 @@ from contextlib import suppress from typing import Self -from .config import MixClientConfig, MixnetTopology -from .node import PacketQueue -from .packet import PacketBuilder -from .poisson import poisson_interval_sec +from mixnet.config import MixClientConfig, MixnetTopology +from mixnet.node import PacketQueue +from mixnet.packet import PacketBuilder +from mixnet.poisson import poisson_interval_sec class MixClient: diff --git a/deprecated/mixnet_v1/config.py b/deprecated/mixnet_v1/config.py index 67a12e82..5b1a2d10 100644 --- a/deprecated/mixnet_v1/config.py +++ b/deprecated/mixnet_v1/config.py @@ -10,8 +10,8 @@ ) from pysphinx.node import Node -from .bls import BlsPrivateKey, BlsPublicKey -from .fisheryates import FisherYates +from mixnet.bls import BlsPrivateKey, BlsPublicKey +from mixnet.fisheryates import FisherYates @dataclass diff --git a/deprecated/mixnet_v1/mixnet.py b/deprecated/mixnet_v1/mixnet.py index 3746121d..dedc9efd 100644 --- a/deprecated/mixnet_v1/mixnet.py +++ b/deprecated/mixnet_v1/mixnet.py @@ -4,13 +4,9 @@ from contextlib import suppress from typing import Self, TypeAlias -from .client import MixClient -from .config import ( - MixnetConfig, - MixnetTopology, - MixnetTopologyConfig, -) -from .node import MixNode +from mixnet.client import MixClient +from mixnet.config import MixnetConfig, MixnetTopology, MixnetTopologyConfig +from mixnet.node import MixNode EntropyQueue: TypeAlias = "asyncio.Queue[bytes]" diff --git a/deprecated/mixnet_v1/node.py b/deprecated/mixnet_v1/node.py index af8ff67b..8ab4b77c 100644 --- a/deprecated/mixnet_v1/node.py +++ b/deprecated/mixnet_v1/node.py @@ -15,8 +15,8 @@ UnknownHeaderTypeError, ) -from .config import MixNodeConfig, NodeAddress -from .poisson import poisson_interval_sec +from mixnet.config import MixNodeConfig, NodeAddress +from mixnet.poisson import poisson_interval_sec PacketQueue: TypeAlias = "asyncio.Queue[Tuple[NodeAddress, SphinxPacket]]" PacketPayloadQueue: TypeAlias = ( diff --git a/deprecated/mixnet_v1/packet.py b/deprecated/mixnet_v1/packet.py index b76c59c3..71fe6878 100644 --- a/deprecated/mixnet_v1/packet.py +++ b/deprecated/mixnet_v1/packet.py @@ -9,7 +9,7 @@ from pysphinx.payload import Payload from pysphinx.sphinx import SphinxPacket -from .config import MixnetTopology, MixNodeInfo +from mixnet.config import MixnetTopology, MixNodeInfo class MessageFlag(Enum): diff --git a/deprecated/mixnet_v1/test_client.py b/deprecated/mixnet_v1/test_client.py index f6a783d5..43274662 100644 --- a/deprecated/mixnet_v1/test_client.py +++ b/deprecated/mixnet_v1/test_client.py @@ -3,13 +3,13 @@ import numpy -from .client import MixClient -from .poisson import poisson_mean_interval_sec -from .test_utils import ( +from mixnet.client import MixClient +from mixnet.poisson import poisson_mean_interval_sec +from mixnet.test_utils import ( init_mixnet_config, with_test_timeout, ) -from .utils import random_bytes +from mixnet.utils import random_bytes class TestMixClient(IsolatedAsyncioTestCase): diff --git a/deprecated/mixnet_v1/test_fisheryates.py b/deprecated/mixnet_v1/test_fisheryates.py index fab94269..a32554c6 100644 --- a/deprecated/mixnet_v1/test_fisheryates.py +++ b/deprecated/mixnet_v1/test_fisheryates.py @@ -1,6 +1,6 @@ from unittest import TestCase -from .fisheryates import FisherYates +from mixnet.fisheryates import FisherYates class TestFisherYates(TestCase): diff --git a/deprecated/mixnet_v1/test_mixnet.py b/deprecated/mixnet_v1/test_mixnet.py index bce581ca..9a0e4cb1 100644 --- a/deprecated/mixnet_v1/test_mixnet.py +++ b/deprecated/mixnet_v1/test_mixnet.py @@ -1,8 +1,8 @@ import asyncio from unittest import IsolatedAsyncioTestCase -from .mixnet import Mixnet -from .test_utils import init_mixnet_config +from mixnet.mixnet import Mixnet +from mixnet.test_utils import init_mixnet_config class TestMixnet(IsolatedAsyncioTestCase): diff --git a/deprecated/mixnet_v1/test_node.py b/deprecated/mixnet_v1/test_node.py index 17a0afa1..26ab0c7b 100644 --- a/deprecated/mixnet_v1/test_node.py +++ b/deprecated/mixnet_v1/test_node.py @@ -5,10 +5,10 @@ import numpy from pysphinx.sphinx import SphinxPacket -from .node import MixNode, NodeAddress, PacketQueue -from .packet import PacketBuilder -from .poisson import poisson_interval_sec, poisson_mean_interval_sec -from .test_utils import ( +from mixnet.node import MixNode, NodeAddress, PacketQueue +from mixnet.packet import PacketBuilder +from mixnet.poisson import poisson_interval_sec, poisson_mean_interval_sec +from mixnet.test_utils import ( init_mixnet_config, with_test_timeout, ) diff --git a/deprecated/mixnet_v1/test_packet.py b/deprecated/mixnet_v1/test_packet.py index 9549fb7f..d1d517a6 100644 --- a/deprecated/mixnet_v1/test_packet.py +++ b/deprecated/mixnet_v1/test_packet.py @@ -3,15 +3,15 @@ from pysphinx.sphinx import ProcessedFinalHopPacket, SphinxPacket -from .config import MixNodeInfo -from .packet import ( +from mixnet.config import MixNodeInfo +from mixnet.packet import ( Fragment, MessageFlag, MessageReconstructor, PacketBuilder, ) -from .test_utils import init_mixnet_config -from .utils import random_bytes +from mixnet.test_utils import init_mixnet_config +from mixnet.utils import random_bytes class TestPacket(TestCase): diff --git a/deprecated/mixnet_v1/test_utils.py b/deprecated/mixnet_v1/test_utils.py index 80d58294..e3ba2607 100644 --- a/deprecated/mixnet_v1/test_utils.py +++ b/deprecated/mixnet_v1/test_utils.py @@ -2,17 +2,17 @@ from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey -from .bls import generate_bls -from .config import ( +from mixnet.bls import generate_bls +from mixnet.config import ( MixClientConfig, + MixNodeConfig, MixnetConfig, + MixNodeInfo, MixnetTopology, MixnetTopologyConfig, MixnetTopologySize, - MixNodeConfig, - MixNodeInfo, ) -from .utils import random_bytes +from mixnet.utils import random_bytes def with_test_timeout(t):