Skip to content

Commit

Permalink
chia/types/aliases.py -> chia/server/aliases.py
Browse files Browse the repository at this point in the history
  • Loading branch information
richardkiss committed Jan 30, 2025
1 parent 3410597 commit c3a7f07
Show file tree
Hide file tree
Showing 34 changed files with 58 additions and 74 deletions.
2 changes: 1 addition & 1 deletion chia/_tests/cmds/test_farm_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from chia.cmds.farm_funcs import summary
from chia.farmer.farmer import Farmer
from chia.harvester.harvester import Harvester
from chia.server.aliases import FarmerService, HarvesterService, WalletService
from chia.simulator.block_tools import BlockTools
from chia.simulator.start_simulator import SimulatorFullNodeService
from chia.types.aliases import FarmerService, HarvesterService, WalletService


@pytest.mark.anyio
Expand Down
19 changes: 9 additions & 10 deletions chia/_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@
from chia.rpc.harvester_rpc_client import HarvesterRpcClient
from chia.rpc.wallet_rpc_client import WalletRpcClient
from chia.seeder.dns_server import DNSServer
from chia.server.aliases import (
CrawlerService,
FarmerService,
FullNodeService,
HarvesterService,
TimelordService,
WalletService,
)
from chia.server.server import ChiaServer
from chia.server.start_service import Service
from chia.simulator.full_node_simulator import FullNodeSimulator
Expand All @@ -66,16 +74,6 @@
)
from chia.simulator.start_simulator import SimulatorFullNodeService
from chia.simulator.wallet_tools import WalletTool

# Set spawn after stdlib imports, but before other imports
from chia.types.aliases import (
CrawlerService,
FarmerService,
FullNodeService,
HarvesterService,
TimelordService,
WalletService,
)
from chia.types.peer_info import PeerInfo
from chia.util.config import create_default_chia_config, lock_and_load_config
from chia.util.db_wrapper import generate_in_memory_db_uri
Expand All @@ -85,6 +83,7 @@
from chia.util.task_timing import start_task_instrumentation, stop_task_instrumentation
from chia.wallet.wallet_node import WalletNode

# Set spawn after stdlib imports, but before other imports
multiprocessing.set_start_method("spawn")

from dataclasses import replace
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/core/data_layer/test_data_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@
from chia.rpc.data_layer_rpc_api import DataLayerRpcApi
from chia.rpc.data_layer_rpc_client import DataLayerRpcClient
from chia.rpc.wallet_rpc_api import WalletRpcApi
from chia.server.aliases import DataLayerService, WalletService
from chia.server.start_data_layer import create_data_layer_service
from chia.simulator.block_tools import BlockTools
from chia.simulator.full_node_simulator import FullNodeSimulator
from chia.simulator.simulator_protocol import FarmNewBlockProtocol
from chia.types.aliases import DataLayerService, WalletService
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.peer_info import PeerInfo
from chia.util.byte_types import hexstr_to_bytes
Expand Down
3 changes: 2 additions & 1 deletion chia/_tests/core/full_node/test_full_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@
from chia.full_node.full_node_api import FullNodeAPI
from chia.full_node.signage_point import SignagePoint
from chia.full_node.sync_store import Peak
from chia.protocols import full_node_protocol, timelord_protocol, wallet_protocol
from chia.protocols import full_node_protocol
from chia.protocols import full_node_protocol as fnp
from chia.protocols import timelord_protocol, wallet_protocol
from chia.protocols.full_node_protocol import RespondTransaction
from chia.protocols.protocol_message_types import ProtocolMessageTypes
from chia.protocols.shared_protocol import Capability, default_capabilities
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/core/test_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from chia.protocols.protocol_message_types import ProtocolMessageTypes
from chia.protocols.wallet_protocol import RequestChildren
from chia.seeder.peer_record import PeerRecord, PeerReliability
from chia.server.aliases import CrawlerService
from chia.server.outbound_message import make_msg
from chia.types.aliases import CrawlerService
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.peer_info import PeerInfo
from chia.util.ints import uint32, uint64, uint128
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/farmer_harvester/test_farmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
from chia.protocols import farmer_protocol, harvester_protocol
from chia.protocols.harvester_protocol import NewProofOfSpace, RespondSignatures
from chia.protocols.pool_protocol import PoolErrorCode
from chia.server.aliases import FarmerService, HarvesterService
from chia.server.ws_connection import WSChiaConnection
from chia.simulator.block_tools import BlockTools
from chia.types.aliases import FarmerService, HarvesterService
from chia.types.blockchain_format.proof_of_space import (
ProofOfSpace,
generate_plot_public_key,
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/farmer_harvester/test_farmer_harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
from chia.protocols import farmer_protocol, harvester_protocol
from chia.protocols.protocol_message_types import ProtocolMessageTypes
from chia.rpc.harvester_rpc_client import HarvesterRpcClient
from chia.server.aliases import FarmerService, HarvesterService
from chia.server.outbound_message import NodeType, make_msg
from chia.simulator.block_tools import BlockTools
from chia.types.aliases import FarmerService, HarvesterService
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.peer_info import UnresolvedPeerInfo
from chia.util.config import load_config
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/farmer_harvester/test_filter_prefix_bits.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from chia.protocols import farmer_protocol
from chia.rpc.farmer_rpc_client import FarmerRpcClient
from chia.rpc.harvester_rpc_client import HarvesterRpcClient
from chia.server.aliases import HarvesterService
from chia.simulator.block_tools import create_block_tools_async, test_constants
from chia.types.aliases import HarvesterService
from chia.types.blockchain_format.proof_of_space import get_plot_id, passes_plot_filter
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.full_block import FullBlock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
from chia.protocols import farmer_protocol, full_node_protocol, harvester_protocol, timelord_protocol
from chia.protocols.harvester_protocol import ProofOfSpaceFeeInfo, RespondSignatures, SigningDataKind
from chia.protocols.protocol_message_types import ProtocolMessageTypes
from chia.server.aliases import FarmerService, FullNodeService, HarvesterService
from chia.server.outbound_message import Message, NodeType, make_msg
from chia.server.server import ChiaServer
from chia.server.ws_connection import WSChiaConnection
from chia.simulator.block_tools import BlockTools
from chia.simulator.start_simulator import SimulatorFullNodeService
from chia.types.aliases import FarmerService, FullNodeService, HarvesterService
from chia.types.blockchain_format.classgroup import ClassgroupElement
from chia.types.blockchain_format.foliage import FoliageBlockData, FoliageTransactionBlock
from chia.types.blockchain_format.proof_of_space import ProofOfSpace
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/fee_estimation/test_fee_estimation_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

from chia.rpc.full_node_rpc_api import FullNodeRpcApi
from chia.rpc.full_node_rpc_client import FullNodeRpcClient
from chia.server.aliases import WalletService
from chia.simulator.block_tools import BlockTools
from chia.simulator.full_node_simulator import FullNodeSimulator
from chia.simulator.simulator_protocol import FarmNewBlockProtocol
from chia.simulator.start_simulator import SimulatorFullNodeService
from chia.simulator.wallet_tools import WalletTool
from chia.types.aliases import WalletService
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.spend_bundle import SpendBundle
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/plot_sync/test_plot_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
from chia.plotting.util import add_plot_directory, remove_plot_directory
from chia.protocols.harvester_protocol import Plot
from chia.protocols.protocol_message_types import ProtocolMessageTypes
from chia.server.aliases import FarmerService, HarvesterService
from chia.simulator.block_tools import BlockTools
from chia.types.aliases import FarmerService, HarvesterService
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.util.config import create_default_chia_config, lock_and_load_config, save_config
from chia.util.ints import uint8, uint32, uint64
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/plot_sync/test_sync_simulated.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
from chia.plotting.util import PlotInfo
from chia.protocols.harvester_protocol import PlotSyncError, PlotSyncResponse
from chia.protocols.protocol_message_types import ProtocolMessageTypes
from chia.server.aliases import FarmerService, HarvesterService
from chia.server.outbound_message import make_msg
from chia.server.ws_connection import WSChiaConnection
from chia.simulator.block_tools import BlockTools
from chia.types.aliases import FarmerService, HarvesterService
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.util.batches import to_batches
from chia.util.ints import int16, uint8, uint64
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/plot_sync/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from chia.harvester.harvester import Harvester
from chia.plot_sync.sender import Sender
from chia.protocols.harvester_protocol import PlotSyncIdentifier
from chia.server.aliases import FarmerService, HarvesterService
from chia.server.outbound_message import Message, NodeType
from chia.types.aliases import FarmerService, HarvesterService
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.peer_info import PeerInfo, UnresolvedPeerInfo
from chia.util.ints import uint16, uint64
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/pools/test_pool_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
from chia.consensus.constants import ConsensusConstants
from chia.pools.pool_wallet_info import PoolSingletonState, PoolWalletInfo
from chia.rpc.wallet_rpc_client import WalletRpcClient
from chia.server.aliases import WalletService
from chia.simulator.add_blocks_in_batches import add_blocks_in_batches
from chia.simulator.block_tools import BlockTools, get_plot_dir
from chia.simulator.full_node_simulator import FullNodeSimulator
from chia.simulator.simulator_protocol import ReorgProtocol
from chia.simulator.start_simulator import SimulatorFullNodeService
from chia.types.aliases import WalletService
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.peer_info import PeerInfo
from chia.util.bech32m import encode_puzzle_hash
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/timelord/test_new_peak.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
from chia.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty
from chia.consensus.make_sub_epoch_summary import next_sub_epoch_summary
from chia.protocols import timelord_protocol
from chia.server.aliases import FullNodeService
from chia.server.server import ChiaServer
from chia.simulator.block_tools import BlockTools
from chia.simulator.full_node_simulator import FullNodeSimulator
from chia.timelord.timelord_api import TimelordAPI
from chia.types.aliases import FullNodeService
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary
from chia.types.full_block import FullBlock
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/timelord/test_timelord.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from chia.types.aliases import TimelordService
from chia.server.aliases import TimelordService


@pytest.mark.anyio
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/util/setup_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from chia.introducer.introducer_api import IntroducerAPI
from chia.protocols.shared_protocol import Capability
from chia.rpc.wallet_rpc_client import WalletRpcClient
from chia.server.aliases import FarmerService, FullNodeService, HarvesterService, TimelordService, WalletService
from chia.server.server import ChiaServer
from chia.simulator.block_tools import BlockTools, create_block_tools_async
from chia.simulator.full_node_simulator import FullNodeSimulator
Expand All @@ -38,7 +39,6 @@
)
from chia.simulator.socket import find_available_listen_port
from chia.simulator.start_simulator import SimulatorFullNodeService
from chia.types.aliases import FarmerService, FullNodeService, HarvesterService, TimelordService, WalletService
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.peer_info import UnresolvedPeerInfo
from chia.util.hash import std_hash
Expand Down
6 changes: 3 additions & 3 deletions chia/_tests/wallet/dao_wallet/test_dao_clvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@
DAO_PROPOSAL_VALIDATOR_MOD_HASH,
DAO_TREASURY_MOD,
DAO_TREASURY_MOD_HASH,
)
from chia.wallet.dao_wallet.dao_utils import DAO_UPDATE_PROPOSAL_MOD as DAO_UPDATE_MOD
from chia.wallet.dao_wallet.dao_utils import (
P2_SINGLETON_AGGREGATOR_MOD,
P2_SINGLETON_MOD,
SPEND_P2_SINGLETON_MOD,
curry_singleton,
get_p2_singleton_puzhash,
get_treasury_puzzle,
)
from chia.wallet.dao_wallet.dao_utils import (
DAO_UPDATE_PROPOSAL_MOD as DAO_UPDATE_MOD,
)
from chia.wallet.singleton import SINGLETON_LAUNCHER_PUZZLE_HASH as SINGLETON_LAUNCHER_HASH
from chia.wallet.singleton import SINGLETON_TOP_LAYER_MOD as SINGLETON_MOD
from chia.wallet.singleton import SINGLETON_TOP_LAYER_MOD_HASH as SINGLETON_MOD_HASH
Expand Down
12 changes: 3 additions & 9 deletions chia/_tests/wallet/nft_wallet/test_nft_puzzles.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,9 @@
)
from chia.wallet.outer_puzzles import match_puzzle
from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import puzzle_for_pk, solution_for_conditions
from chia.wallet.singleton import (
SINGLETON_LAUNCHER_PUZZLE_HASH as LAUNCHER_PUZZLE_HASH,
)
from chia.wallet.singleton import (
SINGLETON_TOP_LAYER_MOD as SINGLETON_MOD,
)
from chia.wallet.singleton import (
SINGLETON_TOP_LAYER_MOD_HASH,
)
from chia.wallet.singleton import SINGLETON_LAUNCHER_PUZZLE_HASH as LAUNCHER_PUZZLE_HASH
from chia.wallet.singleton import SINGLETON_TOP_LAYER_MOD as SINGLETON_MOD
from chia.wallet.singleton import SINGLETON_TOP_LAYER_MOD_HASH
from chia.wallet.trading.offer import OFFER_MOD_HASH
from chia.wallet.uncurried_puzzle import uncurry_puzzle

Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/wallet/test_new_wallet_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
from chia.protocols import wallet_protocol
from chia.protocols.protocol_message_types import ProtocolMessageTypes
from chia.protocols.shared_protocol import Capability
from chia.server.aliases import WalletService
from chia.server.outbound_message import Message, NodeType
from chia.server.ws_connection import WSChiaConnection
from chia.simulator import simulator_protocol
from chia.simulator.block_tools import BlockTools
from chia.simulator.full_node_simulator import FullNodeSimulator
from chia.simulator.start_simulator import SimulatorFullNodeService
from chia.types.aliases import WalletService
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.coin_record import CoinRecord
from chia.types.mempool_inclusion_status import MempoolInclusionStatus
Expand Down
3 changes: 2 additions & 1 deletion chia/_tests/wallet/test_singleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.util.condition_tools import parse_sexp_to_conditions
from chia.wallet.conditions import AssertPuzzleAnnouncement
from chia.wallet.puzzles.singleton_top_layer import P2_SINGLETON_MOD, SINGLETON_MOD, SINGLETON_MOD_HASH
from chia.wallet.puzzles.singleton_top_layer import P2_SINGLETON_MOD
from chia.wallet.puzzles.singleton_top_layer import SINGLETON_LAUNCHER_HASH as LAUNCHER_PUZZLE_HASH
from chia.wallet.puzzles.singleton_top_layer import SINGLETON_MOD, SINGLETON_MOD_HASH

LAUNCHER_ID = Program.to(b"launcher-id").get_tree_hash()
POOL_REWARD_PREFIX_MAINNET = bytes32.fromhex("ccd5bb71183532bff220ba46c268991a00000000000000000000000000000000")
Expand Down
7 changes: 3 additions & 4 deletions chia/_tests/wallet/test_singleton_lifecycle_fast.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
from chia.types.condition_opcodes import ConditionOpcode
from chia.util.ints import uint32, uint64
from chia.wallet.conditions import AssertCoinAnnouncement
from chia.wallet.puzzles.singleton_top_layer import (
P2_SINGLETON_OR_DELAYED_MOD as P2_SINGLETON_MOD,
)
from chia.wallet.puzzles.singleton_top_layer import P2_SINGLETON_OR_DELAYED_MOD as P2_SINGLETON_MOD
from chia.wallet.puzzles.singleton_top_layer import P2_SINGLETON_OR_DELAYED_MOD_HASH as P2_SINGLETON_MOD_HASH
from chia.wallet.puzzles.singleton_top_layer import SINGLETON_LAUNCHER, SINGLETON_MOD, SINGLETON_MOD_HASH
from chia.wallet.puzzles.singleton_top_layer import SINGLETON_LAUNCHER
from chia.wallet.puzzles.singleton_top_layer import SINGLETON_LAUNCHER_HASH as LAUNCHER_PUZZLE_HASH
from chia.wallet.puzzles.singleton_top_layer import SINGLETON_MOD, SINGLETON_MOD_HASH
from chia.wallet.util.debug_spend_bundle import debug_spend_bundle
from chia.wallet.wallet_spend_bundle import WalletSpendBundle

Expand Down
13 changes: 1 addition & 12 deletions chia/cmds/cmd_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,7 @@
import pathlib
import sys
from dataclasses import MISSING, dataclass, field, fields
from typing import (
Any,
Callable,
ClassVar,
Optional,
Protocol,
Union,
final,
get_args,
get_origin,
get_type_hints,
)
from typing import Any, Callable, ClassVar, Optional, Protocol, Union, final, get_args, get_origin, get_type_hints

import click
from typing_extensions import dataclass_transform
Expand Down
2 changes: 1 addition & 1 deletion chia/seeder/start_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
from chia.rpc.crawler_rpc_api import CrawlerRpcApi
from chia.seeder.crawler import Crawler
from chia.seeder.crawler_api import CrawlerAPI
from chia.server.aliases import CrawlerService
from chia.server.outbound_message import NodeType
from chia.server.signal_handlers import SignalHandlers
from chia.server.start_service import RpcInfo, Service, async_run
from chia.types.aliases import CrawlerService
from chia.util.chia_logging import initialize_service_logging
from chia.util.config import load_config, load_config_cli
from chia.util.default_root import resolve_root_path
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion chia/server/start_data_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
from chia.data_layer.util.plugin import load_plugin_configurations
from chia.rpc.data_layer_rpc_api import DataLayerRpcApi
from chia.rpc.wallet_rpc_client import WalletRpcClient
from chia.server.aliases import DataLayerService, WalletService
from chia.server.outbound_message import NodeType
from chia.server.signal_handlers import SignalHandlers
from chia.server.start_service import RpcInfo, Service, async_run
from chia.ssl.create_ssl import create_all_ssl
from chia.types.aliases import DataLayerService, WalletService
from chia.util.chia_logging import initialize_logging
from chia.util.config import load_config, load_config_cli
from chia.util.default_root import resolve_root_path
Expand Down
2 changes: 1 addition & 1 deletion chia/server/start_farmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
from chia.farmer.farmer import Farmer
from chia.farmer.farmer_api import FarmerAPI
from chia.rpc.farmer_rpc_api import FarmerRpcApi
from chia.server.aliases import FarmerService
from chia.server.outbound_message import NodeType
from chia.server.signal_handlers import SignalHandlers
from chia.server.start_service import RpcInfo, Service, async_run
from chia.types.aliases import FarmerService
from chia.util.chia_logging import initialize_service_logging
from chia.util.config import get_unresolved_peer_infos, load_config, load_config_cli
from chia.util.default_root import resolve_root_path
Expand Down
2 changes: 1 addition & 1 deletion chia/server/start_full_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
from chia.full_node.full_node import FullNode
from chia.full_node.full_node_api import FullNodeAPI
from chia.rpc.full_node_rpc_api import FullNodeRpcApi
from chia.server.aliases import FullNodeService
from chia.server.outbound_message import NodeType
from chia.server.signal_handlers import SignalHandlers
from chia.server.start_service import RpcInfo, Service, async_run
from chia.types.aliases import FullNodeService
from chia.util.chia_logging import initialize_service_logging
from chia.util.config import get_unresolved_peer_infos, load_config, load_config_cli
from chia.util.default_root import resolve_root_path
Expand Down
2 changes: 1 addition & 1 deletion chia/server/start_harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
from chia.harvester.harvester import Harvester
from chia.harvester.harvester_api import HarvesterAPI
from chia.rpc.harvester_rpc_api import HarvesterRpcApi
from chia.server.aliases import HarvesterService
from chia.server.outbound_message import NodeType
from chia.server.signal_handlers import SignalHandlers
from chia.server.start_service import RpcInfo, Service, async_run
from chia.types.aliases import HarvesterService
from chia.types.peer_info import UnresolvedPeerInfo
from chia.util.chia_logging import initialize_service_logging
from chia.util.config import get_unresolved_peer_infos, load_config, load_config_cli
Expand Down
Loading

0 comments on commit c3a7f07

Please sign in to comment.