From 2fd02d53d161e93efc98095f977cbfe790d0c3ae Mon Sep 17 00:00:00 2001 From: Rigidity <35380458+Rigidity@users.noreply.github.com> Date: Wed, 4 Sep 2024 11:44:51 -0400 Subject: [PATCH] Remove the coin amount from state layer solution (#18500) * Remove the coin amount from state layer solution * Remove unused imports --- chia/wallet/nft_wallet/metadata_outer_puzzle.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/chia/wallet/nft_wallet/metadata_outer_puzzle.py b/chia/wallet/nft_wallet/metadata_outer_puzzle.py index 88037e7dd993..1dc0fd65cede 100644 --- a/chia/wallet/nft_wallet/metadata_outer_puzzle.py +++ b/chia/wallet/nft_wallet/metadata_outer_puzzle.py @@ -3,10 +3,8 @@ from dataclasses import dataclass from typing import Callable, List, Optional, Tuple -from chia.types.blockchain_format.coin import Coin 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.wallet.puzzle_drivers import PuzzleInfo, Solver from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile from chia.wallet.uncurried_puzzle import UncurriedPuzzle, uncurry_puzzle @@ -27,8 +25,8 @@ def puzzle_for_metadata_layer(metadata: Program, updater_hash: bytes32, inner_pu return NFT_STATE_LAYER_MOD.curry(NFT_STATE_LAYER_MOD_HASH, metadata, updater_hash, inner_puzzle) -def solution_for_metadata_layer(amount: uint64, inner_solution: Program) -> Program: - return Program.to([inner_solution, amount]) +def solution_for_metadata_layer(inner_solution: Program) -> Program: + return Program.to([inner_solution]) @dataclass(frozen=True) @@ -88,12 +86,7 @@ def get_inner_solution(self, constructor: PuzzleInfo, solution: Program) -> Opti return my_inner_solution def solve(self, constructor: PuzzleInfo, solver: Solver, inner_puzzle: Program, inner_solution: Program) -> Program: - coin_bytes: bytes = solver["coin"] - coin: Coin = Coin(bytes32(coin_bytes[0:32]), bytes32(coin_bytes[32:64]), uint64.from_bytes(coin_bytes[64:72])) also = constructor.also() if also is not None: inner_solution = self._solve(also, solver, inner_puzzle, inner_solution) - return solution_for_metadata_layer( - uint64(coin.amount), - inner_solution, - ) + return solution_for_metadata_layer(inner_solution)