use relative imports
This commit is contained in:
parent
bf41a367d0
commit
1b4a8609ba
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]"
|
||||
|
||||
|
|
|
@ -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 = (
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from unittest import TestCase
|
||||
|
||||
from deprecated.mixnet_v1.fisheryates import FisherYates
|
||||
from .fisheryates import FisherYates
|
||||
|
||||
|
||||
class TestFisherYates(TestCase):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue