Skip to content

Commit

Permalink
revert import path changes
Browse files Browse the repository at this point in the history
  • Loading branch information
youngjoon-lee committed Jul 19, 2024
1 parent 1b4a860 commit 0e834e0
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 37 deletions.
Empty file removed deprecated/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion deprecated/mixnet_v1/bls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions deprecated/mixnet_v1/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions deprecated/mixnet_v1/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 3 additions & 7 deletions deprecated/mixnet_v1/mixnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]"

Expand Down
4 changes: 2 additions & 2 deletions deprecated/mixnet_v1/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down
2 changes: 1 addition & 1 deletion deprecated/mixnet_v1/packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions deprecated/mixnet_v1/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion deprecated/mixnet_v1/test_fisheryates.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest import TestCase

from .fisheryates import FisherYates
from mixnet.fisheryates import FisherYates


class TestFisherYates(TestCase):
Expand Down
4 changes: 2 additions & 2 deletions deprecated/mixnet_v1/test_mixnet.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
8 changes: 4 additions & 4 deletions deprecated/mixnet_v1/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
8 changes: 4 additions & 4 deletions deprecated/mixnet_v1/test_packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
10 changes: 5 additions & 5 deletions deprecated/mixnet_v1/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 0e834e0

Please sign in to comment.