use relative imports

This commit is contained in:
Youngjoon Lee 2024-07-19 15:23:51 +09:00
parent bf41a367d0
commit 1b4a8609ba
No known key found for this signature in database
GPG Key ID: B4253AFBA618BF4D
12 changed files with 31 additions and 31 deletions

View File

@ -2,7 +2,7 @@ from typing import TypeAlias
import blspy
from deprecated.mixnet_v1.utils import random_bytes
from .utils import random_bytes
BlsPrivateKey: TypeAlias = blspy.PrivateKey
BlsPublicKey: TypeAlias = blspy.G1Element

View File

@ -4,10 +4,10 @@ import asyncio
from contextlib import suppress
from typing import Self
from deprecated.mixnet_v1.config import MixClientConfig, MixnetTopology
from deprecated.mixnet_v1.node import PacketQueue
from deprecated.mixnet_v1.packet import PacketBuilder
from deprecated.mixnet_v1.poisson import poisson_interval_sec
from .config import MixClientConfig, MixnetTopology
from .node import PacketQueue
from .packet import PacketBuilder
from .poisson import poisson_interval_sec
class MixClient:

View File

@ -10,8 +10,8 @@ from cryptography.hazmat.primitives.asymmetric.x25519 import (
)
from pysphinx.node import Node
from deprecated.mixnet_v1.bls import BlsPrivateKey, BlsPublicKey
from deprecated.mixnet_v1.fisheryates import FisherYates
from .bls import BlsPrivateKey, BlsPublicKey
from .fisheryates import FisherYates
@dataclass

View File

@ -4,13 +4,13 @@ import asyncio
from contextlib import suppress
from typing import Self, TypeAlias
from deprecated.mixnet_v1.client import MixClient
from deprecated.mixnet_v1.config import (
from .client import MixClient
from .config import (
MixnetConfig,
MixnetTopology,
MixnetTopologyConfig,
)
from deprecated.mixnet_v1.node import MixNode
from .node import MixNode
EntropyQueue: TypeAlias = "asyncio.Queue[bytes]"

View File

@ -15,8 +15,8 @@ from pysphinx.sphinx import (
UnknownHeaderTypeError,
)
from deprecated.mixnet_v1.config import MixNodeConfig, NodeAddress
from deprecated.mixnet_v1.poisson import poisson_interval_sec
from .config import MixNodeConfig, NodeAddress
from .poisson import poisson_interval_sec
PacketQueue: TypeAlias = "asyncio.Queue[Tuple[NodeAddress, SphinxPacket]]"
PacketPayloadQueue: TypeAlias = (

View File

@ -9,7 +9,7 @@ from typing import Dict, List, Self, Tuple, TypeAlias
from pysphinx.payload import Payload
from pysphinx.sphinx import SphinxPacket
from deprecated.mixnet_v1.config import MixnetTopology, MixNodeInfo
from .config import MixnetTopology, MixNodeInfo
class MessageFlag(Enum):

View File

@ -3,13 +3,13 @@ from unittest import IsolatedAsyncioTestCase
import numpy
from deprecated.mixnet_v1.client import MixClient
from deprecated.mixnet_v1.poisson import poisson_mean_interval_sec
from deprecated.mixnet_v1.test_utils import (
from .client import MixClient
from .poisson import poisson_mean_interval_sec
from .test_utils import (
init_mixnet_config,
with_test_timeout,
)
from deprecated.mixnet_v1.utils import random_bytes
from .utils import random_bytes
class TestMixClient(IsolatedAsyncioTestCase):

View File

@ -1,6 +1,6 @@
from unittest import TestCase
from deprecated.mixnet_v1.fisheryates import FisherYates
from .fisheryates import FisherYates
class TestFisherYates(TestCase):

View File

@ -1,8 +1,8 @@
import asyncio
from unittest import IsolatedAsyncioTestCase
from deprecated.mixnet_v1.mixnet import Mixnet
from deprecated.mixnet_v1.test_utils import init_mixnet_config
from .mixnet import Mixnet
from .test_utils import init_mixnet_config
class TestMixnet(IsolatedAsyncioTestCase):

View File

@ -5,10 +5,10 @@ from unittest import IsolatedAsyncioTestCase
import numpy
from pysphinx.sphinx import SphinxPacket
from deprecated.mixnet_v1.node import MixNode, NodeAddress, PacketQueue
from deprecated.mixnet_v1.packet import PacketBuilder
from deprecated.mixnet_v1.poisson import poisson_interval_sec, poisson_mean_interval_sec
from deprecated.mixnet_v1.test_utils import (
from .node import MixNode, NodeAddress, PacketQueue
from .packet import PacketBuilder
from .poisson import poisson_interval_sec, poisson_mean_interval_sec
from .test_utils import (
init_mixnet_config,
with_test_timeout,
)

View File

@ -3,15 +3,15 @@ from unittest import TestCase
from pysphinx.sphinx import ProcessedFinalHopPacket, SphinxPacket
from deprecated.mixnet_v1.config import MixNodeInfo
from deprecated.mixnet_v1.packet import (
from .config import MixNodeInfo
from .packet import (
Fragment,
MessageFlag,
MessageReconstructor,
PacketBuilder,
)
from deprecated.mixnet_v1.test_utils import init_mixnet_config
from deprecated.mixnet_v1.utils import random_bytes
from .test_utils import init_mixnet_config
from .utils import random_bytes
class TestPacket(TestCase):

View File

@ -2,8 +2,8 @@ import asyncio
from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey
from deprecated.mixnet_v1.bls import generate_bls
from deprecated.mixnet_v1.config import (
from .bls import generate_bls
from .config import (
MixClientConfig,
MixnetConfig,
MixnetTopology,
@ -12,7 +12,7 @@ from deprecated.mixnet_v1.config import (
MixNodeConfig,
MixNodeInfo,
)
from deprecated.mixnet_v1.utils import random_bytes
from .utils import random_bytes
def with_test_timeout(t):