diff --git a/chia/wallet/cat_wallet/cat_outer_puzzle.py b/chia/wallet/cat_wallet/cat_outer_puzzle.py index 9ba73f8cf91b..bf528f09b48a 100644 --- a/chia/wallet/cat_wallet/cat_outer_puzzle.py +++ b/chia/wallet/cat_wallet/cat_outer_puzzle.py @@ -7,7 +7,6 @@ from chia.types.coin_spend import CoinSpend from chia.util.ints import uint64 from chia.wallet.cat_wallet.cat_utils import ( - CAT_MOD, SpendableCAT, construct_cat_puzzle, match_cat_puzzle, @@ -15,6 +14,7 @@ ) from chia.wallet.lineage_proof import LineageProof from chia.wallet.puzzle_drivers import PuzzleInfo, Solver +from chia.wallet.puzzles.cat_loader import CAT_MOD @dataclass(frozen=True) diff --git a/chia/wallet/cat_wallet/cat_utils.py b/chia/wallet/cat_wallet/cat_utils.py index 0f452a42daf6..837f30b06efa 100644 --- a/chia/wallet/cat_wallet/cat_utils.py +++ b/chia/wallet/cat_wallet/cat_utils.py @@ -36,7 +36,8 @@ def match_cat_puzzle(mod: Program, curried_args: Program) -> Optional[Iterator[P if it is, return the curried arguments """ if mod == CAT_MOD: - return curried_args.as_iter() + ret: Iterator[Program] = curried_args.as_iter() + return ret else: return None @@ -44,7 +45,7 @@ def match_cat_puzzle(mod: Program, curried_args: Program) -> Optional[Iterator[P def get_innerpuzzle_from_puzzle(puzzle: Program) -> Program: mod, curried_args = puzzle.uncurry() if mod == CAT_MOD: - return curried_args.rest().rest().first() + return curried_args.at("rrf") else: raise ValueError("Not a CAT puzzle") @@ -60,7 +61,7 @@ def construct_cat_puzzle( return mod_code.curry(mod_code_hash, limitations_program_hash, inner_puzzle) -def subtotals_for_deltas(deltas) -> List[int]: +def subtotals_for_deltas(deltas: List[int]) -> List[int]: """ Given a list of deltas corresponding to input coins, create the "subtotals" list needed in solutions spending those coins. @@ -82,7 +83,9 @@ def subtotals_for_deltas(deltas) -> List[int]: def next_info_for_spendable_cat(spendable_cat: SpendableCAT) -> Program: c = spendable_cat.coin list = [c.parent_coin_info, spendable_cat.inner_puzzle.get_tree_hash(), c.amount] - return Program.to(list) + # ignoring hint error here for: + # https://github.com/Chia-Network/clvm/pull/102 + return Program.to(list) # type: ignore[no-any-return] # This should probably return UnsignedSpendBundle if that type ever exists @@ -95,7 +98,7 @@ def unsigned_spend_bundle_for_spendable_cats(mod_code: Program, spendable_cat_li N = len(spendable_cat_list) # figure out what the deltas are by running the inner puzzles & solutions - deltas = [] + deltas: List[int] = [] for spend_info in spendable_cat_list: error, conditions, cost = conditions_dict_for_solution( spend_info.inner_puzzle, spend_info.inner_solution, INFINITE_COST diff --git a/chia/wallet/cat_wallet/cat_wallet.py b/chia/wallet/cat_wallet/cat_wallet.py index 6633a6a8d8dc..11e84ad8714d 100644 --- a/chia/wallet/cat_wallet/cat_wallet.py +++ b/chia/wallet/cat_wallet/cat_wallet.py @@ -5,7 +5,7 @@ import time import traceback from secrets import token_bytes -from typing import Any, Dict, List, Optional, Set, Tuple +from typing import Any, Dict, List, Optional, Set, Tuple, TYPE_CHECKING from blspy import AugSchemeMPL, G2Element, G1Element @@ -28,12 +28,12 @@ from chia.wallet.cat_wallet.cat_constants import DEFAULT_CATS from chia.wallet.cat_wallet.cat_info import CATInfo, LegacyCATInfo from chia.wallet.cat_wallet.cat_utils import ( - CAT_MOD, SpendableCAT, construct_cat_puzzle, match_cat_puzzle, unsigned_spend_bundle_for_spendable_cats, ) +from chia.wallet.puzzles.cat_loader import CAT_MOD from chia.wallet.cat_wallet.lineage_store import CATLineageStore from chia.wallet.coin_selection import select_coins from chia.wallet.derivation_record import DerivationRecord @@ -54,11 +54,14 @@ from chia.wallet.wallet_coin_record import WalletCoinRecord from chia.wallet.wallet_info import WalletInfo +if TYPE_CHECKING: + from chia.wallet.wallet_state_manager import WalletStateManager + # This should probably not live in this file but it's for experimental right now class CATWallet: - wallet_state_manager: Any + wallet_state_manager: WalletStateManager log: logging.Logger wallet_info: WalletInfo cat_info: CATInfo @@ -72,8 +75,12 @@ def default_wallet_name_for_unknown_cat(limitations_program_hash_hex: str) -> st @staticmethod async def create_new_cat_wallet( - wallet_state_manager: Any, wallet: Wallet, cat_tail_info: Dict[str, Any], amount: uint64, name=None - ): + wallet_state_manager: WalletStateManager, + wallet: Wallet, + cat_tail_info: Dict[str, Any], + amount: uint64, + name: Optional[str] = None, + ) -> "CATWallet": self = CATWallet() self.cost_of_single_tx = None self.standard_wallet = wallet @@ -162,10 +169,10 @@ async def create_new_cat_wallet( @staticmethod async def create_wallet_for_cat( - wallet_state_manager: Any, + wallet_state_manager: WalletStateManager, wallet: Wallet, limitations_program_hash_hex: str, - name=None, + name: Optional[str] = None, ) -> CATWallet: self = CATWallet() self.cost_of_single_tx = None @@ -199,10 +206,10 @@ async def create_wallet_for_cat( @classmethod async def create_from_puzzle_info( cls, - wallet_state_manager: Any, + wallet_state_manager: WalletStateManager, wallet: Wallet, puzzle_driver: PuzzleInfo, - name=None, + name: Optional[str] = None, ) -> CATWallet: return await cls.create_wallet_for_cat( wallet_state_manager, @@ -213,7 +220,7 @@ async def create_from_puzzle_info( @staticmethod async def create( - wallet_state_manager: Any, + wallet_state_manager: WalletStateManager, wallet: Wallet, wallet_info: WalletInfo, ) -> CATWallet: @@ -259,10 +266,10 @@ async def get_confirmed_balance(self, record_list: Optional[Set[WalletCoinRecord self.log.info(f"Confirmed balance for cat wallet {self.id()} is {amount}") return uint64(amount) - async def get_unconfirmed_balance(self, unspent_records=None) -> uint128: + async def get_unconfirmed_balance(self, unspent_records: Optional[Set[WalletCoinRecord]] = None) -> uint128: return await self.wallet_state_manager.get_unconfirmed_balance(self.id(), unspent_records) - async def get_max_send_amount(self, records=None): + async def get_max_send_amount(self, records: Optional[Set[WalletCoinRecord]] = None) -> int: spendable: List[WalletCoinRecord] = list(await self.get_cat_spendable_coins()) if len(spendable) == 0: return 0 @@ -270,8 +277,9 @@ async def get_max_send_amount(self, records=None): if self.cost_of_single_tx is None: coin = spendable[0].coin txs = await self.generate_signed_transaction( - [coin.amount], [coin.puzzle_hash], coins={coin}, ignore_max_send_amount=True + [uint64(coin.amount)], [coin.puzzle_hash], coins={coin}, ignore_max_send_amount=True ) + assert txs[0].spend_bundle program: BlockGenerator = simple_solution_generator(txs[0].spend_bundle) # npc contains names of the coins removed, puzzle_hashes and their spend conditions result: NPCResult = get_name_puzzle_conditions( @@ -297,10 +305,10 @@ async def get_max_send_amount(self, records=None): return total_amount - async def get_name(self): + async def get_name(self) -> str: return self.wallet_info.name - async def set_name(self, new_name: str): + async def set_name(self, new_name: str) -> None: new_info = dataclasses.replace(self.wallet_info, name=new_name) self.wallet_info = new_info await self.wallet_state_manager.user_store.update_wallet(self.wallet_info) @@ -308,7 +316,7 @@ async def set_name(self, new_name: str): def get_asset_id(self) -> str: return bytes(self.cat_info.limitations_program_hash).hex() - async def set_tail_program(self, tail_program: str): + async def set_tail_program(self, tail_program: str) -> None: assert Program.fromhex(tail_program).get_tree_hash() == self.cat_info.limitations_program_hash await self.save_info( CATInfo( @@ -317,7 +325,7 @@ async def set_tail_program(self, tail_program: str): ) ) - async def coin_added(self, coin: Coin, height: uint32, peer: WSChiaConnection): + async def coin_added(self, coin: Coin, height: uint32, peer: WSChiaConnection) -> None: """Notification from wallet state manager that wallet has been received.""" self.log.info(f"CAT wallet has been notified that {coin} was added") @@ -340,7 +348,7 @@ async def coin_added(self, coin: Coin, height: uint32, peer: WSChiaConnection): except Exception as e: self.log.debug(f"Exception: {e}, traceback: {traceback.format_exc()}") - async def puzzle_solution_received(self, coin_spend: CoinSpend, parent_coin: Coin): + async def puzzle_solution_received(self, coin_spend: CoinSpend, parent_coin: Coin) -> None: coin_name = coin_spend.coin.name() puzzle: Program = Program.from_bytes(bytes(coin_spend.puzzle_reveal)) args = match_cat_puzzle(*puzzle.uncurry()) @@ -378,10 +386,10 @@ def puzzle_for_pk(self, pubkey: G1Element) -> Program: cat_puzzle: Program = construct_cat_puzzle(CAT_MOD, self.cat_info.limitations_program_hash, inner_puzzle) return cat_puzzle - async def get_new_cat_puzzle_hash(self): + async def get_new_cat_puzzle_hash(self) -> bytes32: return (await self.wallet_state_manager.get_unused_derivation_record(self.id())).puzzle_hash - async def get_spendable_balance(self, records=None) -> uint128: + async def get_spendable_balance(self, records: Optional[Set[WalletCoinRecord]] = None) -> uint128: coins = await self.get_cat_spendable_coins(records) amount = 0 for record in coins: @@ -410,7 +418,7 @@ async def get_pending_change_balance(self) -> uint64: return uint64(addition_amount) - async def get_cat_spendable_coins(self, records=None) -> List[WalletCoinRecord]: + async def get_cat_spendable_coins(self, records: Optional[Set[WalletCoinRecord]] = None) -> List[WalletCoinRecord]: result: List[WalletCoinRecord] = [] record_list: Set[WalletCoinRecord] = await self.wallet_state_manager.get_spendable_coins_for_wallet( @@ -508,7 +516,7 @@ async def convert_puzzle_hash(self, puzzle_hash: bytes32) -> bytes32: else: return (await self.inner_puzzle_for_cat_puzhash(puzzle_hash)).get_tree_hash() - async def get_lineage_proof_for_coin(self, coin) -> Optional[LineageProof]: + async def get_lineage_proof_for_coin(self, coin: Coin) -> Optional[LineageProof]: return await self.lineage_store.get_lineage_proof(coin.parent_coin_info) async def create_tandem_xch_tx( @@ -567,7 +575,7 @@ async def generate_unsigned_spendbundle( payments: List[Payment], fee: uint64 = uint64(0), cat_discrepancy: Optional[Tuple[int, Program]] = None, # (extra_delta, limitations_solution) - coins: Set[Coin] = None, + coins: Optional[Set[Coin]] = None, coin_announcements_to_consume: Optional[Set[Announcement]] = None, puzzle_announcements_to_consume: Optional[Set[Announcement]] = None, min_coin_amount: Optional[uint64] = None, @@ -701,7 +709,7 @@ async def generate_signed_transaction( amounts: List[uint64], puzzle_hashes: List[bytes32], fee: uint64 = uint64(0), - coins: Set[Coin] = None, + coins: Optional[Set[Coin]] = None, ignore_max_send_amount: bool = False, memos: Optional[List[List[bytes]]] = None, coin_announcements_to_consume: Optional[Set[Announcement]] = None, @@ -780,7 +788,7 @@ async def generate_signed_transaction( return tx_list - async def add_lineage(self, name: bytes32, lineage: Optional[LineageProof]): + async def add_lineage(self, name: bytes32, lineage: Optional[LineageProof]) -> None: """ Lineage proofs are stored as a list of parent coins and the lineage proof you will need if they are the parent of the coin you are trying to spend. 'If I'm your parent, here's the info you need to spend yourself' @@ -789,11 +797,11 @@ async def add_lineage(self, name: bytes32, lineage: Optional[LineageProof]): if lineage is not None: await self.lineage_store.add_lineage_proof(name, lineage) - async def remove_lineage(self, name: bytes32): + async def remove_lineage(self, name: bytes32) -> None: self.log.info(f"Removing parent {name} (probably had a non-CAT parent)") await self.lineage_store.remove_lineage_proof(name) - async def save_info(self, cat_info: CATInfo): + async def save_info(self, cat_info: CATInfo) -> None: self.cat_info = cat_info current_info = self.wallet_info data_str = bytes(cat_info).hex() diff --git a/chia/wallet/cat_wallet/lineage_store.py b/chia/wallet/cat_wallet/lineage_store.py index 6c6bcb278699..db0d4848b8ce 100644 --- a/chia/wallet/cat_wallet/lineage_store.py +++ b/chia/wallet/cat_wallet/lineage_store.py @@ -19,7 +19,7 @@ class CATLineageStore: table_name: str @classmethod - async def create(cls, db_wrapper: DBWrapper2, asset_id: str): + async def create(cls, db_wrapper: DBWrapper2, asset_id: str) -> "CATLineageStore": self = cls() self.table_name = f"lineage_proofs_{asset_id}" self.db_wrapper = db_wrapper @@ -56,7 +56,8 @@ async def get_lineage_proof(self, coin_id: bytes32) -> Optional[LineageProof]: await cursor.close() if row is not None and row[0] is not None: - return LineageProof.from_bytes(row[1]) + ret: LineageProof = LineageProof.from_bytes(row[1]) + return ret return None diff --git a/chia/wallet/puzzles/tails.py b/chia/wallet/puzzles/tails.py index 7aa00f1fe032..b695ac0dd274 100644 --- a/chia/wallet/puzzles/tails.py +++ b/chia/wallet/puzzles/tails.py @@ -9,11 +9,11 @@ from chia.wallet.lineage_proof import LineageProof from chia.wallet.puzzles.load_clvm import load_clvm from chia.wallet.cat_wallet.cat_utils import ( - CAT_MOD, construct_cat_puzzle, unsigned_spend_bundle_for_spendable_cats, SpendableCAT, ) +from chia.wallet.puzzles.cat_loader import CAT_MOD from chia.wallet.cat_wallet.cat_info import CATInfo from chia.wallet.transaction_record import TransactionRecord diff --git a/chia/wallet/wallet_state_manager.py b/chia/wallet/wallet_state_manager.py index 97af90ac5efb..194df19c18c1 100644 --- a/chia/wallet/wallet_state_manager.py +++ b/chia/wallet/wallet_state_manager.py @@ -1481,7 +1481,9 @@ async def add_new_wallet(self, wallet: Any, wallet_id: int, create_puzzle_hashes await self.create_more_puzzle_hashes() self.state_changed("wallet_created") - async def get_spendable_coins_for_wallet(self, wallet_id: int, records=None) -> Set[WalletCoinRecord]: + async def get_spendable_coins_for_wallet( + self, wallet_id: int, records: Optional[Set[WalletCoinRecord]] = None + ) -> Set[WalletCoinRecord]: if records is None: records = await self.coin_store.get_unspent_coins_for_wallet(wallet_id) diff --git a/mypy.ini b/mypy.ini index 14bd19178229..6e7db6f1fbd3 100644 --- a/mypy.ini +++ b/mypy.ini @@ -17,7 +17,7 @@ no_implicit_reexport = True strict_equality = True # list created by: venv/bin/mypy | sed -n 's/.py:.*//p' | sort | uniq | tr '/' '.' | tr '\n' ',' -[mypy-benchmarks.block_ref,benchmarks.block_store,benchmarks.coin_store,benchmarks.utils,build_scripts.installer-version,chia.cmds.configure,chia.cmds.db,chia.cmds.db_upgrade_func,chia.cmds.farm_funcs,chia.cmds.init,chia.cmds.init_funcs,chia.cmds.keys,chia.cmds.keys_funcs,chia.cmds.passphrase,chia.cmds.passphrase_funcs,chia.cmds.plotnft,chia.cmds.plotnft_funcs,chia.cmds.plots,chia.cmds.plotters,chia.cmds.show,chia.cmds.start_funcs,chia.cmds.wallet,chia.cmds.wallet_funcs,chia.daemon.keychain_server,chia.daemon.server,chia.farmer.farmer,chia.farmer.farmer_api,chia.full_node.block_height_map,chia.full_node.block_store,chia.full_node.bundle_tools,chia.full_node.coin_store,chia.full_node.full_node,chia.full_node.full_node_api,chia.full_node.full_node_store,chia.full_node.generator,chia.full_node.hint_store,chia.full_node.lock_queue,chia.full_node.mempool,chia.full_node.mempool_check_conditions,chia.full_node.mempool_manager,chia.full_node.pending_tx_cache,chia.full_node.sync_store,chia.full_node.weight_proof,chia.harvester.harvester,chia.harvester.harvester_api,chia.introducer.introducer,chia.introducer.introducer_api,chia.plotters.bladebit,chia.plotters.chiapos,chia.plotters.madmax,chia.plotters.plotters,chia.plotters.plotters_util,chia.plotting.check_plots,chia.plotting.create_plots,chia.plotting.manager,chia.plotting.util,chia.pools.pool_config,chia.pools.pool_puzzles,chia.pools.pool_wallet,chia.pools.pool_wallet_info,chia.protocols.pool_protocol,chia.rpc.crawler_rpc_api,chia.rpc.farmer_rpc_api,chia.rpc.farmer_rpc_client,chia.rpc.full_node_rpc_api,chia.rpc.full_node_rpc_client,chia.rpc.harvester_rpc_api,chia.rpc.harvester_rpc_client,chia.rpc.rpc_client,chia.rpc.timelord_rpc_api,chia.rpc.util,chia.rpc.wallet_rpc_api,chia.rpc.wallet_rpc_client,chia.seeder.crawler,chia.seeder.crawler_api,chia.seeder.crawl_store,chia.seeder.dns_server,chia.seeder.peer_record,chia.seeder.start_crawler,chia.server.address_manager,chia.server.address_manager_store,chia.server.connection_utils,chia.server.introducer_peers,chia.server.node_discovery,chia.server.peer_store_resolver,chia.server.rate_limits,chia.server.reconnect_task,chia.server.server,chia.server.ssl_context,chia.server.start_farmer,chia.server.start_full_node,chia.server.start_harvester,chia.server.start_introducer,chia.server.start_service,chia.server.start_timelord,chia.server.start_wallet,chia.server.ws_connection,chia.simulator.full_node_simulator,chia.simulator.start_simulator,chia.ssl.create_ssl,chia.timelord.iters_from_block,chia.timelord.timelord,chia.timelord.timelord_api,chia.timelord.timelord_launcher,chia.timelord.timelord_state,chia.types.announcement,chia.types.blockchain_format.classgroup,chia.types.blockchain_format.coin,chia.types.blockchain_format.program,chia.types.blockchain_format.proof_of_space,chia.types.blockchain_format.tree_hash,chia.types.blockchain_format.vdf,chia.types.full_block,chia.types.header_block,chia.types.mempool_item,chia.types.name_puzzle_condition,chia.types.peer_info,chia.types.spend_bundle,chia.types.transaction_queue_entry,chia.types.unfinished_block,chia.types.unfinished_header_block,chia.util.api_decorators,chia.util.block_cache,chia.util.cached_bls,chia.util.check_fork_next_block,chia.util.chia_logging,chia.util.config,chia.util.db_wrapper,chia.util.dump_keyring,chia.util.files,chia.util.hash,chia.util.json_util,chia.util.keychain,chia.util.keyring_wrapper,chia.util.log_exceptions,chia.util.lru_cache,chia.util.make_test_constants,chia.util.merkle_set,chia.util.network,chia.util.partial_func,chia.util.pip_import,chia.util.profiler,chia.util.safe_cancel_task,chia.util.service_groups,chia.util.ssl_check,chia.util.validate_alert,chia.wallet.block_record,chia.wallet.cat_wallet.cat_utils,chia.wallet.cat_wallet.cat_wallet,chia.wallet.cat_wallet.lineage_store,chia.wallet.chialisp,chia.wallet.did_wallet.did_wallet,chia.wallet.did_wallet.did_wallet_puzzles,chia.wallet.key_val_store,chia.wallet.lineage_proof,chia.wallet.nft_wallet.nft_wallet,chia.wallet.payment,chia.wallet.puzzles.load_clvm,chia.wallet.puzzles.p2_conditions,chia.wallet.puzzles.p2_delegated_conditions,chia.wallet.puzzles.p2_delegated_puzzle,chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle,chia.wallet.puzzles.p2_m_of_n_delegate_direct,chia.wallet.puzzles.p2_puzzle_hash,chia.wallet.puzzles.prefarm.spend_prefarm,chia.wallet.puzzles.puzzle_utils,chia.wallet.puzzles.rom_bootstrap_generator,chia.wallet.puzzles.singleton_top_layer,chia.wallet.puzzles.tails,chia.wallet.rl_wallet.rl_wallet,chia.wallet.rl_wallet.rl_wallet_puzzles,chia.wallet.secret_key_store,chia.wallet.settings.user_settings,chia.wallet.trade_manager,chia.wallet.trade_record,chia.wallet.trading.offer,chia.wallet.trading.trade_store,chia.wallet.transaction_record,chia.wallet.util.debug_spend_bundle,chia.wallet.util.new_peak_queue,chia.wallet.util.peer_request_cache,chia.wallet.util.wallet_sync_utils,chia.wallet.wallet,chia.wallet.wallet_action_store,chia.wallet.wallet_blockchain,chia.wallet.wallet_coin_store,chia.wallet.wallet_interested_store,chia.wallet.wallet_node,chia.wallet.wallet_node_api,chia.wallet.wallet_pool_store,chia.wallet.wallet_puzzle_store,chia.wallet.wallet_state_manager,chia.wallet.wallet_sync_store,chia.wallet.wallet_transaction_store,chia.wallet.wallet_user_store,chia.wallet.wallet_weight_proof_handler,installhelper,tests.blockchain.blockchain_test_utils,tests.blockchain.test_blockchain,tests.blockchain.test_blockchain_transactions,chia.simulator.block_tools,tests.build-init-files,tests.build-workflows,tests.clvm.coin_store,tests.clvm.test_chialisp_deserialization,tests.clvm.test_clvm_compilation,tests.clvm.test_program,tests.clvm.test_puzzle_compression,tests.clvm.test_puzzles,tests.clvm.test_serialized_program,tests.clvm.test_singletons,tests.clvm.test_spend_sim,tests.conftest,tests.connection_utils,tests.core.cmds.test_keys,tests.core.consensus.test_pot_iterations,tests.core.custom_types.test_coin,tests.core.custom_types.test_proof_of_space,tests.core.custom_types.test_spend_bundle,tests.core.daemon.test_daemon,tests.core.full_node.full_sync.test_full_sync,tests.core.full_node.stores.test_block_store,tests.core.full_node.stores.test_coin_store,tests.core.full_node.stores.test_full_node_store,tests.core.full_node.stores.test_hint_store,tests.core.full_node.stores.test_sync_store,tests.core.full_node.test_address_manager,tests.core.full_node.test_block_height_map,tests.core.full_node.test_conditions,tests.core.full_node.test_full_node,tests.core.full_node.test_mempool,tests.core.full_node.test_mempool_performance,tests.core.full_node.test_node_load,tests.core.full_node.test_peer_store_resolver,tests.core.full_node.test_performance,tests.core.full_node.test_transactions,tests.core.make_block_generator,tests.core.node_height,tests.core.server.test_dos,tests.core.server.test_rate_limits,tests.core.ssl.test_ssl,tests.core.test_cost_calculation,tests.core.test_crawler_rpc,tests.core.test_daemon_rpc,tests.core.test_db_conversion,tests.core.test_db_validation,tests.core.test_farmer_harvester_rpc,tests.core.test_filter,tests.core.test_full_node_rpc,tests.core.test_merkle_set,tests.core.test_setproctitle,tests.core.util.test_cached_bls,tests.core.util.test_config,tests.core.util.test_file_keyring_synchronization,tests.core.util.test_files,tests.core.util.test_keychain,tests.core.util.test_keyring_wrapper,tests.core.util.test_lru_cache,tests.core.util.test_significant_bits,tests.farmer_harvester.test_farmer_harvester,tests.generator.test_compression,tests.generator.test_generator_types,tests.generator.test_list_to_batches,tests.generator.test_rom,tests.generator.test_scan,tests.plotting.test_plot_manager,tests.pools.test_pool_cmdline,tests.pools.test_pool_config,tests.pools.test_pool_puzzles_lifecycle,tests.pools.test_pool_rpc,tests.pools.test_wallet_pool_store,tests.setup_nodes,tests.setup_services,tests.simulation.test_simulation,chia.simulator.time_out_assert,tests.tools.test_full_sync,tests.tools.test_run_block,tests.util.alert_server,tests.util.benchmark_cost,tests.util.blockchain,tests.util.build_network_protocol_files,tests.util.db_connection,tests.util.generator_tools_testing,tests.util.keyring,tests.util.key_tool,tests.util.rpc,tests.util.test_full_block_utils,tests.util.test_lock_queue,tests.util.test_misc,tests.util.test_network,tests.util.test_network_protocol_files,tests.wallet.cat_wallet.test_cat_lifecycle,tests.wallet.cat_wallet.test_cat_wallet,tests.wallet.cat_wallet.test_offer_lifecycle,tests.wallet.cat_wallet.test_trades,tests.wallet.did_wallet.test_did,tests.wallet.did_wallet.test_did_rpc,tests.wallet.did_wallet.test_nft_rpc,tests.wallet.did_wallet.test_nft_wallet,tests.wallet.rl_wallet.test_rl_rpc,tests.wallet.rl_wallet.test_rl_wallet,tests.wallet.rpc.test_wallet_rpc,tests.wallet.simple_sync.test_simple_sync_protocol,tests.wallet.sync.test_wallet_sync,tests.wallet.test_bech32m,tests.wallet.test_chialisp,tests.wallet.test_puzzle_store,tests.wallet.test_singleton,tests.wallet.test_singleton_lifecycle,tests.wallet.test_singleton_lifecycle_fast,tests.wallet.test_taproot,tests.wallet.test_wallet_blockchain,tests.wallet.test_wallet_interested_store,tests.wallet.test_wallet_key_val_store,tests.wallet.test_wallet_user_store,chia.simulator.wallet_tools,tests.weight_proof.test_weight_proof,tools.analyze-chain,tools.run_block,tools.test_full_sync,tests.wallet.nft_wallet.test_nft_wallet,chia.wallet.nft_wallet.nft_puzzles,tests.wallet.nft_wallet.test_nft_puzzles] +[mypy-benchmarks.block_ref,benchmarks.block_store,benchmarks.coin_store,benchmarks.utils,build_scripts.installer-version,chia.cmds.configure,chia.cmds.db,chia.cmds.db_upgrade_func,chia.cmds.farm_funcs,chia.cmds.init,chia.cmds.init_funcs,chia.cmds.keys,chia.cmds.keys_funcs,chia.cmds.passphrase,chia.cmds.passphrase_funcs,chia.cmds.plotnft,chia.cmds.plotnft_funcs,chia.cmds.plots,chia.cmds.plotters,chia.cmds.show,chia.cmds.start_funcs,chia.cmds.wallet,chia.cmds.wallet_funcs,chia.daemon.keychain_server,chia.daemon.server,chia.farmer.farmer,chia.farmer.farmer_api,chia.full_node.block_height_map,chia.full_node.block_store,chia.full_node.bundle_tools,chia.full_node.coin_store,chia.full_node.full_node,chia.full_node.full_node_api,chia.full_node.full_node_store,chia.full_node.generator,chia.full_node.hint_store,chia.full_node.lock_queue,chia.full_node.mempool,chia.full_node.mempool_check_conditions,chia.full_node.mempool_manager,chia.full_node.pending_tx_cache,chia.full_node.sync_store,chia.full_node.weight_proof,chia.harvester.harvester,chia.harvester.harvester_api,chia.introducer.introducer,chia.introducer.introducer_api,chia.plotters.bladebit,chia.plotters.chiapos,chia.plotters.madmax,chia.plotters.plotters,chia.plotters.plotters_util,chia.plotting.check_plots,chia.plotting.create_plots,chia.plotting.manager,chia.plotting.util,chia.pools.pool_config,chia.pools.pool_puzzles,chia.pools.pool_wallet,chia.pools.pool_wallet_info,chia.protocols.pool_protocol,chia.rpc.crawler_rpc_api,chia.rpc.farmer_rpc_api,chia.rpc.farmer_rpc_client,chia.rpc.full_node_rpc_api,chia.rpc.full_node_rpc_client,chia.rpc.harvester_rpc_api,chia.rpc.harvester_rpc_client,chia.rpc.rpc_client,chia.rpc.timelord_rpc_api,chia.rpc.util,chia.rpc.wallet_rpc_api,chia.rpc.wallet_rpc_client,chia.seeder.crawler,chia.seeder.crawler_api,chia.seeder.crawl_store,chia.seeder.dns_server,chia.seeder.peer_record,chia.seeder.start_crawler,chia.server.address_manager,chia.server.address_manager_store,chia.server.connection_utils,chia.server.introducer_peers,chia.server.node_discovery,chia.server.peer_store_resolver,chia.server.rate_limits,chia.server.reconnect_task,chia.server.server,chia.server.ssl_context,chia.server.start_farmer,chia.server.start_full_node,chia.server.start_harvester,chia.server.start_introducer,chia.server.start_service,chia.server.start_timelord,chia.server.start_wallet,chia.server.ws_connection,chia.simulator.full_node_simulator,chia.simulator.start_simulator,chia.ssl.create_ssl,chia.timelord.iters_from_block,chia.timelord.timelord,chia.timelord.timelord_api,chia.timelord.timelord_launcher,chia.timelord.timelord_state,chia.types.announcement,chia.types.blockchain_format.classgroup,chia.types.blockchain_format.coin,chia.types.blockchain_format.program,chia.types.blockchain_format.proof_of_space,chia.types.blockchain_format.tree_hash,chia.types.blockchain_format.vdf,chia.types.full_block,chia.types.header_block,chia.types.mempool_item,chia.types.name_puzzle_condition,chia.types.peer_info,chia.types.spend_bundle,chia.types.transaction_queue_entry,chia.types.unfinished_block,chia.types.unfinished_header_block,chia.util.api_decorators,chia.util.block_cache,chia.util.cached_bls,chia.util.check_fork_next_block,chia.util.chia_logging,chia.util.config,chia.util.db_wrapper,chia.util.dump_keyring,chia.util.files,chia.util.hash,chia.util.json_util,chia.util.keychain,chia.util.keyring_wrapper,chia.util.log_exceptions,chia.util.lru_cache,chia.util.make_test_constants,chia.util.merkle_set,chia.util.network,chia.util.partial_func,chia.util.pip_import,chia.util.profiler,chia.util.safe_cancel_task,chia.util.service_groups,chia.util.ssl_check,chia.util.validate_alert,chia.wallet.block_record,chia.wallet.chialisp,chia.wallet.did_wallet.did_wallet,chia.wallet.did_wallet.did_wallet_puzzles,chia.wallet.key_val_store,chia.wallet.lineage_proof,chia.wallet.nft_wallet.nft_wallet,chia.wallet.payment,chia.wallet.puzzles.load_clvm,chia.wallet.puzzles.p2_conditions,chia.wallet.puzzles.p2_delegated_conditions,chia.wallet.puzzles.p2_delegated_puzzle,chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle,chia.wallet.puzzles.p2_m_of_n_delegate_direct,chia.wallet.puzzles.p2_puzzle_hash,chia.wallet.puzzles.prefarm.spend_prefarm,chia.wallet.puzzles.puzzle_utils,chia.wallet.puzzles.rom_bootstrap_generator,chia.wallet.puzzles.singleton_top_layer,chia.wallet.puzzles.tails,chia.wallet.rl_wallet.rl_wallet,chia.wallet.rl_wallet.rl_wallet_puzzles,chia.wallet.secret_key_store,chia.wallet.settings.user_settings,chia.wallet.trade_manager,chia.wallet.trade_record,chia.wallet.trading.offer,chia.wallet.trading.trade_store,chia.wallet.transaction_record,chia.wallet.util.debug_spend_bundle,chia.wallet.util.new_peak_queue,chia.wallet.util.peer_request_cache,chia.wallet.util.wallet_sync_utils,chia.wallet.wallet,chia.wallet.wallet_action_store,chia.wallet.wallet_blockchain,chia.wallet.wallet_coin_store,chia.wallet.wallet_interested_store,chia.wallet.wallet_node,chia.wallet.wallet_node_api,chia.wallet.wallet_pool_store,chia.wallet.wallet_puzzle_store,chia.wallet.wallet_state_manager,chia.wallet.wallet_sync_store,chia.wallet.wallet_transaction_store,chia.wallet.wallet_user_store,chia.wallet.wallet_weight_proof_handler,installhelper,tests.blockchain.blockchain_test_utils,tests.blockchain.test_blockchain,tests.blockchain.test_blockchain_transactions,chia.simulator.block_tools,tests.build-init-files,tests.build-workflows,tests.clvm.coin_store,tests.clvm.test_chialisp_deserialization,tests.clvm.test_clvm_compilation,tests.clvm.test_program,tests.clvm.test_puzzle_compression,tests.clvm.test_puzzles,tests.clvm.test_serialized_program,tests.clvm.test_singletons,tests.clvm.test_spend_sim,tests.conftest,tests.connection_utils,tests.core.cmds.test_keys,tests.core.consensus.test_pot_iterations,tests.core.custom_types.test_coin,tests.core.custom_types.test_proof_of_space,tests.core.custom_types.test_spend_bundle,tests.core.daemon.test_daemon,tests.core.full_node.full_sync.test_full_sync,tests.core.full_node.stores.test_block_store,tests.core.full_node.stores.test_coin_store,tests.core.full_node.stores.test_full_node_store,tests.core.full_node.stores.test_hint_store,tests.core.full_node.stores.test_sync_store,tests.core.full_node.test_address_manager,tests.core.full_node.test_block_height_map,tests.core.full_node.test_conditions,tests.core.full_node.test_full_node,tests.core.full_node.test_mempool,tests.core.full_node.test_mempool_performance,tests.core.full_node.test_node_load,tests.core.full_node.test_peer_store_resolver,tests.core.full_node.test_performance,tests.core.full_node.test_transactions,tests.core.make_block_generator,tests.core.node_height,tests.core.server.test_dos,tests.core.server.test_rate_limits,tests.core.ssl.test_ssl,tests.core.test_cost_calculation,tests.core.test_crawler_rpc,tests.core.test_daemon_rpc,tests.core.test_db_conversion,tests.core.test_db_validation,tests.core.test_farmer_harvester_rpc,tests.core.test_filter,tests.core.test_full_node_rpc,tests.core.test_merkle_set,tests.core.test_setproctitle,tests.core.util.test_cached_bls,tests.core.util.test_config,tests.core.util.test_file_keyring_synchronization,tests.core.util.test_files,tests.core.util.test_keychain,tests.core.util.test_keyring_wrapper,tests.core.util.test_lru_cache,tests.core.util.test_significant_bits,tests.farmer_harvester.test_farmer_harvester,tests.generator.test_compression,tests.generator.test_generator_types,tests.generator.test_list_to_batches,tests.generator.test_rom,tests.generator.test_scan,tests.plotting.test_plot_manager,tests.pools.test_pool_cmdline,tests.pools.test_pool_config,tests.pools.test_pool_puzzles_lifecycle,tests.pools.test_pool_rpc,tests.pools.test_wallet_pool_store,tests.setup_nodes,tests.setup_services,tests.simulation.test_simulation,chia.simulator.time_out_assert,tests.tools.test_full_sync,tests.tools.test_run_block,tests.util.alert_server,tests.util.benchmark_cost,tests.util.blockchain,tests.util.build_network_protocol_files,tests.util.db_connection,tests.util.generator_tools_testing,tests.util.keyring,tests.util.key_tool,tests.util.rpc,tests.util.test_full_block_utils,tests.util.test_lock_queue,tests.util.test_misc,tests.util.test_network,tests.util.test_network_protocol_files,tests.wallet.cat_wallet.test_cat_lifecycle,tests.wallet.cat_wallet.test_cat_wallet,tests.wallet.cat_wallet.test_offer_lifecycle,tests.wallet.cat_wallet.test_trades,tests.wallet.did_wallet.test_did,tests.wallet.did_wallet.test_did_rpc,tests.wallet.did_wallet.test_nft_rpc,tests.wallet.did_wallet.test_nft_wallet,tests.wallet.rl_wallet.test_rl_rpc,tests.wallet.rl_wallet.test_rl_wallet,tests.wallet.rpc.test_wallet_rpc,tests.wallet.simple_sync.test_simple_sync_protocol,tests.wallet.sync.test_wallet_sync,tests.wallet.test_bech32m,tests.wallet.test_chialisp,tests.wallet.test_puzzle_store,tests.wallet.test_singleton,tests.wallet.test_singleton_lifecycle,tests.wallet.test_singleton_lifecycle_fast,tests.wallet.test_taproot,tests.wallet.test_wallet_blockchain,tests.wallet.test_wallet_interested_store,tests.wallet.test_wallet_key_val_store,tests.wallet.test_wallet_user_store,chia.simulator.wallet_tools,tests.weight_proof.test_weight_proof,tools.analyze-chain,tools.run_block,tools.test_full_sync,tests.wallet.nft_wallet.test_nft_wallet,chia.wallet.nft_wallet.nft_puzzles,tests.wallet.nft_wallet.test_nft_puzzles] disallow_any_generics = False disallow_subclassing_any = False disallow_untyped_calls = False diff --git a/tests/clvm/test_puzzle_compression.py b/tests/clvm/test_puzzle_compression.py index 028d19e56548..de0a4b33d0db 100644 --- a/tests/clvm/test_puzzle_compression.py +++ b/tests/clvm/test_puzzle_compression.py @@ -14,7 +14,8 @@ compress_object_with_puzzles, decompress_object_with_puzzles, ) -from chia.wallet.cat_wallet.cat_utils import CAT_MOD, construct_cat_puzzle +from chia.wallet.cat_wallet.cat_utils import construct_cat_puzzle +from chia.wallet.puzzles.cat_loader import CAT_MOD from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import puzzle_for_pk ZERO_32 = bytes32([0] * 32) diff --git a/tests/wallet/cat_wallet/test_cat_lifecycle.py b/tests/wallet/cat_wallet/test_cat_lifecycle.py index c56a6d95ab49..09bfeb167473 100644 --- a/tests/wallet/cat_wallet/test_cat_lifecycle.py +++ b/tests/wallet/cat_wallet/test_cat_lifecycle.py @@ -14,11 +14,11 @@ from chia.util.errors import Err from chia.util.ints import uint64 from chia.wallet.cat_wallet.cat_utils import ( - CAT_MOD, SpendableCAT, construct_cat_puzzle, unsigned_spend_bundle_for_spendable_cats, ) +from chia.wallet.puzzles.cat_loader import CAT_MOD from chia.wallet.lineage_proof import LineageProof from chia.wallet.puzzles.tails import ( GenesisById, diff --git a/tests/wallet/cat_wallet/test_cat_outer_puzzle.py b/tests/wallet/cat_wallet/test_cat_outer_puzzle.py index b85e06e21dca..a38347012e78 100644 --- a/tests/wallet/cat_wallet/test_cat_outer_puzzle.py +++ b/tests/wallet/cat_wallet/test_cat_outer_puzzle.py @@ -8,7 +8,7 @@ from chia.types.blockchain_format.sized_bytes import bytes32 from chia.types.coin_spend import CoinSpend from chia.util.ints import uint64 -from chia.wallet.cat_wallet.cat_utils import CAT_MOD, construct_cat_puzzle +from chia.wallet.cat_wallet.cat_utils import construct_cat_puzzle from chia.wallet.outer_puzzles import ( construct_puzzle, create_asset_id, @@ -18,6 +18,7 @@ solve_puzzle, ) from chia.wallet.puzzle_drivers import PuzzleInfo, Solver +from chia.wallet.puzzles.cat_loader import CAT_MOD def test_cat_outer_puzzle() -> None: diff --git a/tests/wallet/cat_wallet/test_offer_lifecycle.py b/tests/wallet/cat_wallet/test_offer_lifecycle.py index 57b1b76209ee..c4492656f9d7 100644 --- a/tests/wallet/cat_wallet/test_offer_lifecycle.py +++ b/tests/wallet/cat_wallet/test_offer_lifecycle.py @@ -12,11 +12,11 @@ from chia.types.spend_bundle import SpendBundle from chia.util.ints import uint64 from chia.wallet.cat_wallet.cat_utils import ( - CAT_MOD, construct_cat_puzzle, SpendableCAT, unsigned_spend_bundle_for_spendable_cats, ) +from chia.wallet.puzzles.cat_loader import CAT_MOD from chia.wallet.outer_puzzles import AssetType from chia.wallet.puzzle_drivers import PuzzleInfo from chia.wallet.payment import Payment