mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-11 10:56:14 +03:00
move puzzles
This commit is contained in:
parent
625776bec2
commit
a5a9ed3695
@ -15,7 +15,7 @@ from src.util.condition_tools import conditions_dict_for_solution
|
||||
from src.util.ints import uint64
|
||||
from src.wallet.puzzles.load_clvm import load_clvm
|
||||
|
||||
from src.wallet.cc_wallet.genesis_by_coin_id_with_0 import (
|
||||
from src.wallet.puzzles.genesis_by_coin_id_with_0 import (
|
||||
lineage_proof_for_genesis,
|
||||
lineage_proof_for_coin,
|
||||
lineage_proof_for_zero,
|
||||
@ -27,7 +27,7 @@ NULL_SIGNATURE = G2Element.generator() * 0
|
||||
|
||||
LOCK_INNER_PUZZLE = Program.from_bytes(bytes.fromhex("ff01ff8080")) # (q ())
|
||||
|
||||
CC_MOD = load_clvm("cc.clvm", package_or_requirement=__name__)
|
||||
CC_MOD = load_clvm("../puzzles/cc.clvm", package_or_requirement=__name__)
|
||||
|
||||
ANYONE_CAN_SPEND_PUZZLE = Program.to(1) # simply return the conditions
|
||||
|
||||
|
@ -30,15 +30,14 @@ from src.wallet.cc_wallet.cc_utils import (
|
||||
cc_puzzle_hash_for_inner_puzzle_hash,
|
||||
cc_puzzle_for_inner_puzzle,
|
||||
spend_bundle_for_spendable_ccs,
|
||||
genesis_coin_id_for_genesis_coin_checker,
|
||||
get_lineage_proof_from_coin_and_puz,
|
||||
uncurry_cc,
|
||||
CC_MOD,
|
||||
)
|
||||
from src.wallet.cc_wallet.genesis_by_coin_id_with_0 import (
|
||||
from src.wallet.puzzles.genesis_by_coin_id_with_0 import (
|
||||
create_genesis_or_zero_coin_checker,
|
||||
lineage_proof_for_genesis,
|
||||
)
|
||||
genesis_coin_id_for_genesis_coin_checker)
|
||||
from dataclasses import replace
|
||||
|
||||
|
||||
|
@ -54,11 +54,7 @@ def int_as_bytes32(v: int) -> bytes32:
|
||||
return v.to_bytes(32, byteorder="big")
|
||||
|
||||
|
||||
def generate_farmed_coin(
|
||||
block_index: int,
|
||||
puzzle_hash: bytes32,
|
||||
amount: int,
|
||||
) -> Coin:
|
||||
def generate_farmed_coin(block_index: int, puzzle_hash: bytes32, amount: int,) -> Coin:
|
||||
"""
|
||||
Generate a (fake) coin which can be used as a starting point for a chain
|
||||
of coin tests.
|
||||
@ -166,10 +162,7 @@ def test_spend_through_n(mod_code, coin_checker_for_farmed_coin, n):
|
||||
inner_puzzle_solution = Program.to(output_conditions)
|
||||
|
||||
spend_bundle = spend_bundle_for_spendable_ccs(
|
||||
mod_code,
|
||||
genesis_coin_checker,
|
||||
spendable_cc_list,
|
||||
[inner_puzzle_solution],
|
||||
mod_code, genesis_coin_checker, spendable_cc_list, [inner_puzzle_solution],
|
||||
)
|
||||
|
||||
debug_spend_bundle(spend_bundle)
|
||||
@ -194,10 +187,7 @@ def test_spend_through_n(mod_code, coin_checker_for_farmed_coin, n):
|
||||
]
|
||||
|
||||
spend_bundle = spend_bundle_for_spendable_ccs(
|
||||
mod_code,
|
||||
genesis_coin_checker,
|
||||
spendable_cc_list,
|
||||
inner_solutions,
|
||||
mod_code, genesis_coin_checker, spendable_cc_list, inner_solutions,
|
||||
)
|
||||
|
||||
debug_spend_bundle(spend_bundle)
|
@ -16,6 +16,7 @@ from src.util.hash import std_hash
|
||||
from src.util.ints import uint32, uint64
|
||||
from src.wallet.cc_wallet import cc_utils
|
||||
from src.wallet.cc_wallet.cc_wallet import CCWallet
|
||||
from src.wallet.puzzles.genesis_by_coin_id_with_0 import genesis_coin_id_for_genesis_coin_checker
|
||||
from src.wallet.trade_record import TradeRecord
|
||||
from src.wallet.trading.trade_status import TradeStatus
|
||||
from src.wallet.trading.trade_store import TradeStore
|
||||
@ -27,7 +28,6 @@ from src.wallet.util.trade_utils import (
|
||||
)
|
||||
from src.wallet.cc_wallet.cc_utils import (
|
||||
SpendableCC,
|
||||
genesis_coin_id_for_genesis_coin_checker,
|
||||
uncurry_cc,
|
||||
spend_bundle_for_spendable_ccs,
|
||||
CC_MOD,
|
||||
|
Loading…
Reference in New Issue
Block a user