diff --git a/chia/_tests/wallet/nft_wallet/test_nft_lifecycle.py b/chia/_tests/wallet/nft_wallet/test_nft_lifecycle.py index 81d0e8730ba8..1bed036835ce 100644 --- a/chia/_tests/wallet/nft_wallet/test_nft_lifecycle.py +++ b/chia/_tests/wallet/nft_wallet/test_nft_lifecycle.py @@ -12,12 +12,12 @@ from chia.types.mempool_inclusion_status import MempoolInclusionStatus from chia.util.errors import Err from chia.wallet.conditions import AssertPuzzleAnnouncement -from chia.wallet.nft_wallet.nft_puzzles import NFT_METADATA_UPDATER, NFT_TRANSFER_PROGRAM_DEFAULT, from chia.wallet.nft_wallet.nft_puzzle_utils import ( construct_ownership_layer, create_nft_layer_puzzle_with_curry_params, metadata_to_program, ) +from chia.wallet.nft_wallet.nft_puzzles import NFT_METADATA_UPDATER, NFT_TRANSFER_PROGRAM_DEFAULT from chia.wallet.wallet_spend_bundle import WalletSpendBundle ACS = Program.to(1) diff --git a/chia/_tests/wallet/nft_wallet/test_nft_puzzles.py b/chia/_tests/wallet/nft_wallet/test_nft_puzzles.py index 17f5c0cc2cac..589ed0846963 100644 --- a/chia/_tests/wallet/nft_wallet/test_nft_puzzles.py +++ b/chia/_tests/wallet/nft_wallet/test_nft_puzzles.py @@ -7,19 +7,19 @@ from chia.types.blockchain_format.program import Program from chia.types.blockchain_format.sized_bytes import bytes32 from chia.wallet.nft_wallet import uncurry_nft -from chia.wallet.nft_wallet.nft_puzzles import ( - NFT_METADATA_UPDATER_HASH, - NFT_OWNERSHIP_LAYER, - NFT_STATE_LAYER_MOD, - NFT_STATE_LAYER_MOD_HASH, - NFT_TRANSFER_PROGRAM_DEFAULT -) from chia.wallet.nft_wallet.nft_puzzle_utils import ( construct_ownership_layer, create_full_puzzle, create_nft_layer_puzzle_with_curry_params, recurry_nft_puzzle, ) +from chia.wallet.nft_wallet.nft_puzzles import ( + NFT_METADATA_UPDATER_HASH, + NFT_OWNERSHIP_LAYER, + NFT_STATE_LAYER_MOD, + NFT_STATE_LAYER_MOD_HASH, + NFT_TRANSFER_PROGRAM_DEFAULT, +) 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 ( diff --git a/chia/pools/pool_puzzles.py b/chia/pools/pool_puzzles.py index 84109131f975..5f3d2ec88df9 100644 --- a/chia/pools/pool_puzzles.py +++ b/chia/pools/pool_puzzles.py @@ -3,6 +3,7 @@ import logging from typing import Optional +from chia_puzzles_py.programs import P2_SINGLETON_OR_DELAYED_PUZHASH, POOL_MEMBER_INNERPUZ, POOL_WAITINGROOM_INNERPUZ from chia_rs import G1Element from clvm.casts import int_to_bytes @@ -15,13 +16,9 @@ from chia.types.blockchain_format.sized_bytes import bytes32 from chia.types.coin_spend import CoinSpend, compute_additions from chia.util.ints import uint32, uint64 -from chia.wallet.puzzles.singleton_top_layer import puzzle_for_singleton +from chia.wallet.puzzles.singleton_top_layer import SINGLETON_LAUNCHER, SINGLETON_MOD, puzzle_for_singleton from chia.wallet.util.curry_and_treehash import calculate_hash_of_quoted_mod_hash, curry_and_treehash, shatree_atom -from chia_puzzles_py.programs import POOL_MEMBER_INNERPUZ, POOL_WAITINGROOM_INNERPUZ, P2_SINGLETON_OR_DELAYED_PUZHASH - -from chia.wallet.puzzles.singleton_top_layer import SINGLETON_MOD, SINGLETON_LAUNCHER - log = logging.getLogger(__name__) # "Full" is the outer singleton, with the inner puzzle filled in POOL_WAITING_ROOM_MOD = Program.from_bytes(POOL_WAITINGROOM_INNERPUZ) diff --git a/chia/wallet/db_wallet/db_wallet_puzzles.py b/chia/wallet/db_wallet/db_wallet_puzzles.py index 3f1fd6b341fb..e9fcccce5463 100644 --- a/chia/wallet/db_wallet/db_wallet_puzzles.py +++ b/chia/wallet/db_wallet/db_wallet_puzzles.py @@ -11,8 +11,8 @@ from chia.types.blockchain_format.sized_bytes import bytes32 from chia.types.condition_opcodes import ConditionOpcode from chia.util.ints import uint64 -from chia.wallet.nft_wallet.nft_puzzles import NFT_STATE_LAYER_MOD from chia.wallet.nft_wallet.nft_puzzle_utils import create_nft_layer_puzzle_with_curry_params +from chia.wallet.nft_wallet.nft_puzzles import NFT_STATE_LAYER_MOD from chia.wallet.singleton import ( SINGLETON_LAUNCHER_PUZZLE_HASH, SINGLETON_TOP_LAYER_MOD, diff --git a/chia/wallet/nft_wallet/nft_puzzle_utils.py b/chia/wallet/nft_wallet/nft_puzzle_utils.py index 8e10767df350..debdde657e37 100644 --- a/chia/wallet/nft_wallet/nft_puzzle_utils.py +++ b/chia/wallet/nft_wallet/nft_puzzle_utils.py @@ -3,7 +3,6 @@ import logging from typing import Any, Literal, Optional, Union - from clvm_tools.binutils import disassemble from chia.types.blockchain_format.program import Program @@ -12,14 +11,14 @@ from chia.util.bech32m import encode_puzzle_hash from chia.util.ints import uint16, uint64 from chia.wallet.nft_wallet.nft_info import NFTCoinInfo, NFTInfo -from chia.wallet.nft_wallet.uncurry_nft import UncurriedNFT from chia.wallet.nft_wallet.nft_puzzles import ( - NFT_STATE_LAYER_MOD, - NFT_STATE_LAYER_MOD_HASH, NFT_OWNERSHIP_LAYER, NFT_OWNERSHIP_LAYER_HASH, + NFT_STATE_LAYER_MOD, + NFT_STATE_LAYER_MOD_HASH, NFT_TRANSFER_PROGRAM_DEFAULT, ) +from chia.wallet.nft_wallet.uncurry_nft import UncurriedNFT from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import solution_for_conditions from chia.wallet.singleton import ( SINGLETON_LAUNCHER_PUZZLE_HASH, @@ -31,7 +30,6 @@ log = logging.getLogger(__name__) - def create_nft_layer_puzzle_with_curry_params( metadata: Program, metadata_updater_hash: bytes32, inner_puzzle: Program ) -> Program: diff --git a/chia/wallet/nft_wallet/nft_puzzles.py b/chia/wallet/nft_wallet/nft_puzzles.py index 1ad74a857fb5..00402b2884ba 100644 --- a/chia/wallet/nft_wallet/nft_puzzles.py +++ b/chia/wallet/nft_wallet/nft_puzzles.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia_puzzles_py.programs import ( NFT_INTERMEDIATE_LAUNCHER, NFT_METADATA_UPDATER_DEFAULT, @@ -17,4 +19,4 @@ NFT_OWNERSHIP_LAYER = Program.from_bytes(NFT_OWNERSHIP_LAYER_BYTES) NFT_OWNERSHIP_LAYER_HASH = NFT_OWNERSHIP_LAYER.get_tree_hash() NFT_TRANSFER_PROGRAM_DEFAULT = Program.from_bytes(NFT_OWNERSHIP_TRANSFER_PROGRAM_ONE_WAY_CLAIM_WITH_ROYALTIES) -INTERMEDIATE_LAUNCHER_MOD = Program.from_bytes(NFT_INTERMEDIATE_LAUNCHER) \ No newline at end of file +INTERMEDIATE_LAUNCHER_MOD = Program.from_bytes(NFT_INTERMEDIATE_LAUNCHER) diff --git a/chia/wallet/nft_wallet/nft_wallet.py b/chia/wallet/nft_wallet/nft_wallet.py index a1a348f21e32..48fea59c9f85 100644 --- a/chia/wallet/nft_wallet/nft_wallet.py +++ b/chia/wallet/nft_wallet/nft_wallet.py @@ -36,6 +36,7 @@ from chia.wallet.nft_wallet import nft_puzzle_utils from chia.wallet.nft_wallet.nft_info import NFTCoinInfo, NFTWalletInfo from chia.wallet.nft_wallet.nft_puzzle_utils import create_ownership_layer_puzzle, get_metadata_and_phs +from chia.wallet.nft_wallet.nft_puzzles import NFT_METADATA_UPDATER from chia.wallet.nft_wallet.uncurry_nft import NFTCoinData, UncurriedNFT from chia.wallet.outer_puzzles import AssetType, construct_puzzle, match_puzzle, solve_puzzle from chia.wallet.payment import Payment diff --git a/chia/wallet/nft_wallet/uncurry_nft.py b/chia/wallet/nft_wallet/uncurry_nft.py index 479d661f9e8d..2f56ea4a3e9c 100644 --- a/chia/wallet/nft_wallet/uncurry_nft.py +++ b/chia/wallet/nft_wallet/uncurry_nft.py @@ -10,9 +10,8 @@ from chia.types.coin_spend import CoinSpend from chia.util.ints import uint16 from chia.util.streamable import Streamable, streamable - -from chia.wallet.nft_wallet.nft_puzzles import NFT_STATE_LAYER_MOD as NFT_MOD from chia.wallet.nft_wallet.nft_puzzles import NFT_OWNERSHIP_LAYER +from chia.wallet.nft_wallet.nft_puzzles import NFT_STATE_LAYER_MOD as NFT_MOD from chia.wallet.singleton import SINGLETON_TOP_LAYER_MOD log = logging.getLogger(__name__) diff --git a/chia/wallet/puzzles/clawback/drivers.py b/chia/wallet/puzzles/clawback/drivers.py index c82e1a0fb5a8..c2cb94c89e43 100644 --- a/chia/wallet/puzzles/clawback/drivers.py +++ b/chia/wallet/puzzles/clawback/drivers.py @@ -3,6 +3,20 @@ import logging from typing import Any, Optional, Union +from chia_puzzles_py.programs import ( + AUGMENTED_CONDITION as AUGMENTED_CONDITION_BYTES, +) +from chia_puzzles_py.programs import ( + AUGMENTED_CONDITION_HASH as AUGMENTED_CONDITION_HASH_BYTES, +) +from chia_puzzles_py.programs import ( + P2_1_OF_N as P2_1_OF_N_BYTES, +) +from chia_puzzles_py.programs import ( + P2_PUZZLE_HASH, + P2_PUZZLE_HASH_HASH, +) + from chia.consensus.default_constants import DEFAULT_CONSTANTS from chia.types.blockchain_format.coin import Coin from chia.types.blockchain_format.program import Program @@ -14,21 +28,12 @@ from chia.util.ints import uint64 from chia.util.streamable import VersionedBlob from chia.wallet.puzzles.clawback.metadata import ClawbackMetadata -from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import MOD from chia.wallet.uncurried_puzzle import UncurriedPuzzle from chia.wallet.util.curry_and_treehash import calculate_hash_of_quoted_mod_hash, curry_and_treehash from chia.wallet.util.merkle_tree import MerkleTree from chia.wallet.util.wallet_types import RemarkDataType -from chia_puzzles_py.programs import ( - AUGMENTED_CONDITION as AUGMENTED_CONDITION_BYTES, - AUGMENTED_CONDITION_HASH as AUGMENTED_CONDITION_HASH_BYTES, - P2_1_OF_N as P2_1_OF_N_BYTES, - P2_PUZZLE_HASH, - P2_PUZZLE_HASH_HASH, -) - P2_1_OF_N = Program.from_bytes(P2_1_OF_N_BYTES) P2_CURRIED_PUZZLE_MOD = Program.from_bytes(P2_PUZZLE_HASH) P2_CURRIED_PUZZLE_MOD_HASH_QUOTED = calculate_hash_of_quoted_mod_hash(P2_PUZZLE_HASH_HASH) diff --git a/chia/wallet/trade_manager.py b/chia/wallet/trade_manager.py index 19a5f711684a..8ddca8ee9ee6 100644 --- a/chia/wallet/trade_manager.py +++ b/chia/wallet/trade_manager.py @@ -32,7 +32,6 @@ from chia.wallet.outer_puzzles import AssetType from chia.wallet.payment import Payment from chia.wallet.puzzle_drivers import PuzzleInfo, Solver -from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile from chia.wallet.trade_record import TradeRecord from chia.wallet.trading.offer import NotarizedPayment, Offer from chia.wallet.trading.trade_status import TradeStatus diff --git a/chia/wallet/util/notifications.py b/chia/wallet/util/notifications.py index c34a3abe372c..472ddfd7ac8d 100644 --- a/chia/wallet/util/notifications.py +++ b/chia/wallet/util/notifications.py @@ -1,9 +1,10 @@ from __future__ import annotations +from chia_puzzles_py.programs import NOTIFICATION + from chia.types.blockchain_format.program import Program from chia.types.blockchain_format.sized_bytes import bytes32 from chia.util.ints import uint64 -from chia_puzzles_py.programs import NOTIFICATION NOTIFICATION_MOD = Program.from_bytes(NOTIFICATION)