Skip to content

Commit

Permalink
Use sed to change imports from src to chia.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardkiss authored and hoffmang9 committed Apr 5, 2021
1 parent 8a3e005 commit 569ca16
Show file tree
Hide file tree
Showing 250 changed files with 1,699 additions and 1,699 deletions.
24 changes: 12 additions & 12 deletions src/cmds/chia.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import click

from src import __version__
from src.cmds.configure import configure_cmd
from src.cmds.farm import farm_cmd
from src.cmds.init import init_cmd
from src.cmds.keys import keys_cmd
from src.cmds.netspace import netspace_cmd
from src.cmds.plots import plots_cmd
from src.cmds.show import show_cmd
from src.cmds.start import start_cmd
from src.cmds.stop import stop_cmd
from src.cmds.wallet import wallet_cmd
from src.util.default_root import DEFAULT_ROOT_PATH
from chia import __version__
from chia.cmds.configure import configure_cmd
from chia.cmds.farm import farm_cmd
from chia.cmds.init import init_cmd
from chia.cmds.keys import keys_cmd
from chia.cmds.netspace import netspace_cmd
from chia.cmds.plots import plots_cmd
from chia.cmds.show import show_cmd
from chia.cmds.start import start_cmd
from chia.cmds.stop import stop_cmd
from chia.cmds.wallet import wallet_cmd
from chia.util.default_root import DEFAULT_ROOT_PATH

CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])

Expand Down
4 changes: 2 additions & 2 deletions src/cmds/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import click

from src.util.config import load_config, save_config, str2bool
from src.util.default_root import DEFAULT_ROOT_PATH
from chia.util.config import load_config, save_config, str2bool
from chia.util.default_root import DEFAULT_ROOT_PATH


def configure(
Expand Down
20 changes: 10 additions & 10 deletions src/cmds/farm_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

import aiohttp

from src.cmds.units import units
from src.consensus.block_record import BlockRecord
from src.rpc.farmer_rpc_client import FarmerRpcClient
from src.rpc.full_node_rpc_client import FullNodeRpcClient
from src.rpc.harvester_rpc_client import HarvesterRpcClient
from src.rpc.wallet_rpc_client import WalletRpcClient
from src.util.config import load_config
from src.util.default_root import DEFAULT_ROOT_PATH
from src.util.ints import uint16
from src.util.misc import format_minutes
from chia.cmds.units import units
from chia.consensus.block_record import BlockRecord
from chia.rpc.farmer_rpc_client import FarmerRpcClient
from chia.rpc.full_node_rpc_client import FullNodeRpcClient
from chia.rpc.harvester_rpc_client import HarvesterRpcClient
from chia.rpc.wallet_rpc_client import WalletRpcClient
from chia.util.config import load_config
from chia.util.default_root import DEFAULT_ROOT_PATH
from chia.util.ints import uint16
from chia.util.misc import format_minutes

SECONDS_PER_BLOCK = (24 * 3600) / 4608

Expand Down
18 changes: 9 additions & 9 deletions src/cmds/init_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@

import yaml

from src import __version__
from src.consensus.coinbase import create_puzzlehash_for_pk
from src.ssl.create_ssl import generate_ca_signed_cert, get_chia_ca_crt_key, make_ca_cert
from src.util.bech32m import encode_puzzle_hash
from src.util.config import (
from chia import __version__
from chia.consensus.coinbase import create_puzzlehash_for_pk
from chia.ssl.create_ssl import generate_ca_signed_cert, get_chia_ca_crt_key, make_ca_cert
from chia.util.bech32m import encode_puzzle_hash
from chia.util.config import (
create_default_chia_config,
initial_config_file,
load_config,
save_config,
unflatten_properties,
)
from src.util.ints import uint32
from src.util.keychain import Keychain
from src.util.path import mkdir
from src.wallet.derive_keys import master_sk_to_pool_sk, master_sk_to_wallet_sk
from chia.util.ints import uint32
from chia.util.keychain import Keychain
from chia.util.path import mkdir
from chia.wallet.derive_keys import master_sk_to_pool_sk, master_sk_to_wallet_sk

private_node_names = {"full_node", "wallet", "farmer", "harvester", "timelord", "daemon"}
public_node_names = {"full_node", "wallet", "farmer", "introducer", "timelord"}
Expand Down
14 changes: 7 additions & 7 deletions src/cmds/keys_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

from blspy import AugSchemeMPL, G1Element, G2Element

from src.consensus.coinbase import create_puzzlehash_for_pk
from src.util.bech32m import encode_puzzle_hash
from src.util.config import load_config
from src.util.default_root import DEFAULT_ROOT_PATH
from src.util.ints import uint32
from src.util.keychain import Keychain, bytes_to_mnemonic, generate_mnemonic
from src.wallet.derive_keys import master_sk_to_farmer_sk, master_sk_to_pool_sk, master_sk_to_wallet_sk
from chia.consensus.coinbase import create_puzzlehash_for_pk
from chia.util.bech32m import encode_puzzle_hash
from chia.util.config import load_config
from chia.util.default_root import DEFAULT_ROOT_PATH
from chia.util.ints import uint32
from chia.util.keychain import Keychain, bytes_to_mnemonic, generate_mnemonic
from chia.wallet.derive_keys import master_sk_to_farmer_sk, master_sk_to_pool_sk, master_sk_to_wallet_sk

keychain: Keychain = Keychain()

Expand Down
10 changes: 5 additions & 5 deletions src/cmds/netspace_funcs.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import aiohttp

from src.rpc.full_node_rpc_client import FullNodeRpcClient
from src.util.byte_types import hexstr_to_bytes
from src.util.config import load_config
from src.util.default_root import DEFAULT_ROOT_PATH
from src.util.ints import uint16
from chia.rpc.full_node_rpc_client import FullNodeRpcClient
from chia.util.byte_types import hexstr_to_bytes
from chia.util.config import load_config
from chia.util.default_root import DEFAULT_ROOT_PATH
from chia.util.ints import uint16


async def netstorge_async(rpc_port: int, delta_block_height: str, start: str) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/start.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import click

from src.util.service_groups import all_groups
from chia.util.service_groups import all_groups


@click.command("start", short_help="Start service groups")
Expand Down
4 changes: 2 additions & 2 deletions src/cmds/start_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from pathlib import Path
from typing import Optional

from src.daemon.client import DaemonProxy, connect_to_daemon_and_validate
from src.util.service_groups import services_for_groups
from chia.daemon.client import DaemonProxy, connect_to_daemon_and_validate
from chia.util.service_groups import services_for_groups


def launch_start_daemon(root_path: Path) -> subprocess.Popen:
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import click

from src.util.service_groups import all_groups, services_for_groups
from chia.util.service_groups import all_groups, services_for_groups


async def async_stop(root_path: Path, group: str, stop_daemon: bool) -> int:
Expand Down
20 changes: 10 additions & 10 deletions src/cmds/wallet_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@

import aiohttp

from src.cmds.units import units
from src.rpc.wallet_rpc_client import WalletRpcClient
from src.server.start_wallet import SERVICE_NAME
from src.util.bech32m import encode_puzzle_hash
from src.util.byte_types import hexstr_to_bytes
from src.util.config import load_config
from src.util.default_root import DEFAULT_ROOT_PATH
from src.util.ints import uint16, uint64
from src.wallet.transaction_record import TransactionRecord
from src.wallet.util.wallet_types import WalletType
from chia.cmds.units import units
from chia.rpc.wallet_rpc_client import WalletRpcClient
from chia.server.start_wallet import SERVICE_NAME
from chia.util.bech32m import encode_puzzle_hash
from chia.util.byte_types import hexstr_to_bytes
from chia.util.config import load_config
from chia.util.default_root import DEFAULT_ROOT_PATH
from chia.util.ints import uint16, uint64
from chia.wallet.transaction_record import TransactionRecord
from chia.wallet.util.wallet_types import WalletType


def print_transaction(tx: TransactionRecord, verbose: bool, name) -> None:
Expand Down
50 changes: 25 additions & 25 deletions src/consensus/block_body_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@
from chiabip158 import PyBIP158
from clvm.casts import int_from_bytes

from src.consensus.block_record import BlockRecord
from src.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from src.consensus.block_root_validation import validate_block_merkle_roots
from src.consensus.blockchain_check_conditions import blockchain_check_conditions_dict
from src.consensus.blockchain_interface import BlockchainInterface
from src.consensus.coinbase import create_farmer_coin, create_pool_coin
from src.consensus.constants import ConsensusConstants
from src.consensus.cost_calculator import CostResult, calculate_cost_of_program
from src.consensus.find_fork_point import find_fork_point_in_chain
from src.consensus.network_type import NetworkType
from src.full_node.block_store import BlockStore
from src.full_node.coin_store import CoinStore
from src.types.announcement import Announcement
from src.types.blockchain_format.coin import Coin
from src.types.blockchain_format.sized_bytes import bytes32
from src.types.coin_record import CoinRecord
from src.types.condition_opcodes import ConditionOpcode
from src.types.condition_var_pair import ConditionVarPair
from src.types.full_block import FullBlock, additions_for_npc, announcements_for_npc
from src.types.name_puzzle_condition import NPC
from src.types.unfinished_block import UnfinishedBlock
from src.util.condition_tools import pkm_pairs_for_conditions_dict
from src.util.errors import Err
from src.util.hash import std_hash
from src.util.ints import uint32, uint64
from chia.consensus.block_record import BlockRecord
from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from chia.consensus.block_root_validation import validate_block_merkle_roots
from chia.consensus.blockchain_check_conditions import blockchain_check_conditions_dict
from chia.consensus.blockchain_interface import BlockchainInterface
from chia.consensus.coinbase import create_farmer_coin, create_pool_coin
from chia.consensus.constants import ConsensusConstants
from chia.consensus.cost_calculator import CostResult, calculate_cost_of_program
from chia.consensus.find_fork_point import find_fork_point_in_chain
from chia.consensus.network_type import NetworkType
from chia.full_node.block_store import BlockStore
from chia.full_node.coin_store import CoinStore
from chia.types.announcement import Announcement
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.coin_record import CoinRecord
from chia.types.condition_opcodes import ConditionOpcode
from chia.types.condition_var_pair import ConditionVarPair
from chia.types.full_block import FullBlock, additions_for_npc, announcements_for_npc
from chia.types.name_puzzle_condition import NPC
from chia.types.unfinished_block import UnfinishedBlock
from chia.util.condition_tools import pkm_pairs_for_conditions_dict
from chia.util.errors import Err
from chia.util.hash import std_hash
from chia.util.ints import uint32, uint64

log = logging.getLogger(__name__)

Expand Down
50 changes: 25 additions & 25 deletions src/consensus/block_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@
from blspy import G1Element, G2Element
from chiabip158 import PyBIP158

from src.consensus.block_record import BlockRecord
from src.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from src.consensus.blockchain_interface import BlockchainInterface
from src.consensus.coinbase import create_farmer_coin, create_pool_coin
from src.consensus.constants import ConsensusConstants
from src.consensus.cost_calculator import CostResult, calculate_cost_of_program
from src.full_node.bundle_tools import best_solution_program
from src.full_node.signage_point import SignagePoint
from src.types.blockchain_format.coin import Coin, hash_coin_list
from src.types.blockchain_format.foliage import Foliage, FoliageBlockData, FoliageTransactionBlock, TransactionsInfo
from src.types.blockchain_format.pool_target import PoolTarget
from src.types.blockchain_format.program import SerializedProgram
from src.types.blockchain_format.proof_of_space import ProofOfSpace
from src.types.blockchain_format.reward_chain_block import RewardChainBlock, RewardChainBlockUnfinished
from src.types.blockchain_format.sized_bytes import bytes32
from src.types.blockchain_format.vdf import VDFInfo, VDFProof
from src.types.end_of_slot_bundle import EndOfSubSlotBundle
from src.types.full_block import FullBlock
from src.types.spend_bundle import SpendBundle
from src.types.unfinished_block import UnfinishedBlock
from src.util.hash import std_hash
from src.util.ints import uint8, uint32, uint64, uint128
from src.util.merkle_set import MerkleSet
from src.util.prev_transaction_block import get_prev_transaction_block
from src.util.recursive_replace import recursive_replace
from chia.consensus.block_record import BlockRecord
from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from chia.consensus.blockchain_interface import BlockchainInterface
from chia.consensus.coinbase import create_farmer_coin, create_pool_coin
from chia.consensus.constants import ConsensusConstants
from chia.consensus.cost_calculator import CostResult, calculate_cost_of_program
from chia.full_node.bundle_tools import best_solution_program
from chia.full_node.signage_point import SignagePoint
from chia.types.blockchain_format.coin import Coin, hash_coin_list
from chia.types.blockchain_format.foliage import Foliage, FoliageBlockData, FoliageTransactionBlock, TransactionsInfo
from chia.types.blockchain_format.pool_target import PoolTarget
from chia.types.blockchain_format.program import SerializedProgram
from chia.types.blockchain_format.proof_of_space import ProofOfSpace
from chia.types.blockchain_format.reward_chain_block import RewardChainBlock, RewardChainBlockUnfinished
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.blockchain_format.vdf import VDFInfo, VDFProof
from chia.types.end_of_slot_bundle import EndOfSubSlotBundle
from chia.types.full_block import FullBlock
from chia.types.spend_bundle import SpendBundle
from chia.types.unfinished_block import UnfinishedBlock
from chia.util.hash import std_hash
from chia.util.ints import uint8, uint32, uint64, uint128
from chia.util.merkle_set import MerkleSet
from chia.util.prev_transaction_block import get_prev_transaction_block
from chia.util.recursive_replace import recursive_replace


def create_foliage(
Expand Down
38 changes: 19 additions & 19 deletions src/consensus/block_header_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@

from blspy import AugSchemeMPL

from src.consensus.block_record import BlockRecord
from src.consensus.blockchain_interface import BlockchainInterface
from src.consensus.constants import ConsensusConstants
from src.consensus.deficit import calculate_deficit
from src.consensus.difficulty_adjustment import can_finish_sub_and_full_epoch
from src.consensus.get_block_challenge import final_eos_is_already_included, get_block_challenge
from src.consensus.make_sub_epoch_summary import make_sub_epoch_summary
from src.consensus.pot_iterations import (
from chia.consensus.block_record import BlockRecord
from chia.consensus.blockchain_interface import BlockchainInterface
from chia.consensus.constants import ConsensusConstants
from chia.consensus.deficit import calculate_deficit
from chia.consensus.difficulty_adjustment import can_finish_sub_and_full_epoch
from chia.consensus.get_block_challenge import final_eos_is_already_included, get_block_challenge
from chia.consensus.make_sub_epoch_summary import make_sub_epoch_summary
from chia.consensus.pot_iterations import (
calculate_ip_iters,
calculate_iterations_quality,
calculate_sp_interval_iters,
calculate_sp_iters,
is_overflow_block,
)
from src.consensus.vdf_info_computation import get_signage_point_vdf_info
from src.types.blockchain_format.classgroup import ClassgroupElement
from src.types.blockchain_format.sized_bytes import bytes32
from src.types.blockchain_format.slots import ChallengeChainSubSlot, RewardChainSubSlot, SubSlotProofs
from src.types.blockchain_format.vdf import VDFInfo, VDFProof
from src.types.end_of_slot_bundle import EndOfSubSlotBundle
from src.types.header_block import HeaderBlock
from src.types.unfinished_header_block import UnfinishedHeaderBlock
from src.util.errors import Err, ValidationError
from src.util.hash import std_hash
from src.util.ints import uint8, uint32, uint64, uint128
from chia.consensus.vdf_info_computation import get_signage_point_vdf_info
from chia.types.blockchain_format.classgroup import ClassgroupElement
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.blockchain_format.slots import ChallengeChainSubSlot, RewardChainSubSlot, SubSlotProofs
from chia.types.blockchain_format.vdf import VDFInfo, VDFProof
from chia.types.end_of_slot_bundle import EndOfSubSlotBundle
from chia.types.header_block import HeaderBlock
from chia.types.unfinished_header_block import UnfinishedHeaderBlock
from chia.util.errors import Err, ValidationError
from chia.util.hash import std_hash
from chia.util.ints import uint8, uint32, uint64, uint128

log = logging.getLogger(__name__)

Expand Down
16 changes: 8 additions & 8 deletions src/consensus/block_record.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from dataclasses import dataclass
from typing import List, Optional

from src.consensus.constants import ConsensusConstants
from src.consensus.pot_iterations import calculate_ip_iters, calculate_sp_iters
from src.types.blockchain_format.classgroup import ClassgroupElement
from src.types.blockchain_format.coin import Coin
from src.types.blockchain_format.sized_bytes import bytes32
from src.types.blockchain_format.sub_epoch_summary import SubEpochSummary
from src.util.ints import uint8, uint32, uint64, uint128
from src.util.streamable import Streamable, streamable
from chia.consensus.constants import ConsensusConstants
from chia.consensus.pot_iterations import calculate_ip_iters, calculate_sp_iters
from chia.types.blockchain_format.classgroup import ClassgroupElement
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary
from chia.util.ints import uint8, uint32, uint64, uint128
from chia.util.streamable import Streamable, streamable


@dataclass(frozen=True)
Expand Down
2 changes: 1 addition & 1 deletion src/consensus/block_rewards.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from src.util.ints import uint32, uint64
from chia.util.ints import uint32, uint64

# 1 Chia coin = 1,000,000,000,000 = 1 trillion mojo.
_mojo_per_chia = 1000000000000
Expand Down
8 changes: 4 additions & 4 deletions src/consensus/block_root_validation.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import Dict, List, Optional

from src.types.blockchain_format.coin import Coin, hash_coin_list
from src.types.blockchain_format.sized_bytes import bytes32
from src.util.errors import Err
from src.util.merkle_set import MerkleSet
from chia.types.blockchain_format.coin import Coin, hash_coin_list
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.util.errors import Err
from chia.util.merkle_set import MerkleSet


def validate_block_merkle_roots(
Expand Down
Loading

0 comments on commit 569ca16

Please sign in to comment.