chia-blockchain 2.5.2rc2__py3-none-any.whl → 2.5.3rc2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chia/__init__.py +7 -0
- chia/_tests/blockchain/blockchain_test_utils.py +1 -1
- chia/_tests/blockchain/test_augmented_chain.py +54 -5
- chia/_tests/blockchain/test_blockchain.py +5 -12
- chia/_tests/blockchain/test_blockchain_transactions.py +3 -5
- chia/_tests/blockchain/test_get_block_generator.py +2 -2
- chia/_tests/blockchain/test_lookup_fork_chain.py +2 -2
- chia/_tests/clvm/benchmark_costs.py +2 -1
- chia/_tests/clvm/coin_store.py +4 -3
- chia/_tests/clvm/test_chialisp_deserialization.py +2 -2
- chia/_tests/clvm/test_curry_and_treehash.py +1 -1
- chia/_tests/clvm/test_puzzle_compression.py +2 -2
- chia/_tests/clvm/test_puzzles.py +2 -2
- chia/_tests/clvm/test_singletons.py +2 -2
- chia/_tests/clvm/test_spend_sim.py +1 -1
- chia/_tests/cmds/cmd_test_utils.py +2 -2
- chia/_tests/cmds/test_click_types.py +2 -2
- chia/_tests/cmds/test_cmd_framework.py +6 -6
- chia/_tests/cmds/test_show.py +4 -3
- chia/_tests/cmds/test_tx_config_args.py +1 -1
- chia/_tests/cmds/testing_classes.py +2 -2
- chia/_tests/cmds/wallet/test_consts.py +2 -2
- chia/_tests/cmds/wallet/test_did.py +2 -2
- chia/_tests/cmds/wallet/test_nft.py +2 -2
- chia/_tests/cmds/wallet/test_notifications.py +3 -2
- chia/_tests/cmds/wallet/test_vcs.py +2 -2
- chia/_tests/cmds/wallet/test_wallet.py +4 -8
- chia/_tests/conftest.py +4 -3
- chia/_tests/connection_utils.py +2 -2
- chia/_tests/core/cmds/test_keys.py +1 -2
- chia/_tests/core/cmds/test_wallet.py +2 -2
- chia/_tests/core/consensus/test_block_creation.py +2 -2
- chia/_tests/core/consensus/test_pot_iterations.py +1 -1
- chia/_tests/core/custom_types/test_coin.py +2 -2
- chia/_tests/core/custom_types/test_proof_of_space.py +2 -2
- chia/_tests/core/custom_types/test_spend_bundle.py +2 -2
- chia/_tests/core/data_layer/conftest.py +1 -1
- chia/_tests/core/data_layer/test_data_layer.py +1 -1
- chia/_tests/core/data_layer/test_data_layer_util.py +1 -1
- chia/_tests/core/data_layer/test_data_rpc.py +2 -2
- chia/_tests/core/data_layer/test_data_store.py +1 -1
- chia/_tests/core/data_layer/test_data_store_schema.py +1 -1
- chia/_tests/core/data_layer/util.py +2 -1
- chia/_tests/core/farmer/test_farmer_api.py +1 -1
- chia/_tests/core/full_node/full_sync/test_full_sync.py +1 -7
- chia/_tests/core/full_node/ram_db.py +2 -1
- chia/_tests/core/full_node/stores/test_block_store.py +2 -2
- chia/_tests/core/full_node/stores/test_coin_store.py +2 -2
- chia/_tests/core/full_node/stores/test_full_node_store.py +3 -3
- chia/_tests/core/full_node/stores/test_hint_store.py +2 -2
- chia/_tests/core/full_node/stores/test_sync_store.py +1 -1
- chia/_tests/core/full_node/test_address_manager.py +1 -1
- chia/_tests/core/full_node/test_block_height_map.py +2 -2
- chia/_tests/core/full_node/test_conditions.py +1 -1
- chia/_tests/core/full_node/test_full_node.py +346 -164
- chia/_tests/core/full_node/test_generator_tools.py +3 -2
- chia/_tests/core/full_node/test_hint_management.py +2 -2
- chia/_tests/core/full_node/test_performance.py +2 -15
- chia/_tests/core/full_node/test_subscriptions.py +1 -1
- chia/_tests/core/full_node/test_transactions.py +186 -185
- chia/_tests/core/full_node/test_tx_processing_queue.py +1 -1
- chia/_tests/core/make_block_generator.py +2 -2
- chia/_tests/core/mempool/test_mempool.py +165 -22
- chia/_tests/core/mempool/test_mempool_fee_estimator.py +1 -1
- chia/_tests/core/mempool/test_mempool_fee_protocol.py +1 -1
- chia/_tests/core/mempool/test_mempool_manager.py +476 -66
- chia/_tests/core/mempool/test_mempool_performance.py +2 -2
- chia/_tests/core/mempool/test_singleton_fast_forward.py +19 -25
- chia/_tests/core/node_height.py +2 -1
- chia/_tests/core/server/test_capabilities.py +1 -1
- chia/_tests/core/server/test_dos.py +36 -28
- chia/_tests/core/server/test_loop.py +3 -3
- chia/_tests/core/server/test_rate_limits.py +1 -1
- chia/_tests/core/server/test_server.py +2 -2
- chia/_tests/core/services/test_services.py +1 -1
- chia/_tests/core/ssl/test_ssl.py +1 -1
- chia/_tests/core/test_coins.py +2 -1
- chia/_tests/core/test_cost_calculation.py +2 -2
- chia/_tests/core/test_crawler.py +2 -2
- chia/_tests/core/test_db_conversion.py +2 -2
- chia/_tests/core/test_db_validation.py +26 -13
- chia/_tests/core/test_farmer_harvester_rpc.py +2 -2
- chia/_tests/core/test_full_node_rpc.py +2 -2
- chia/_tests/core/test_merkle_set.py +2 -2
- chia/_tests/core/test_program.py +2 -2
- chia/_tests/core/test_rpc_util.py +1 -1
- chia/_tests/core/test_seeder.py +1 -1
- chia/_tests/core/util/test_block_cache.py +3 -3
- chia/_tests/core/util/test_jsonify.py +3 -2
- chia/_tests/core/util/test_keychain.py +3 -3
- chia/_tests/core/util/test_streamable.py +3 -4
- chia/_tests/environments/wallet.py +3 -2
- chia/_tests/farmer_harvester/test_farmer.py +3 -4
- chia/_tests/farmer_harvester/test_farmer_harvester.py +2 -2
- chia/_tests/farmer_harvester/test_filter_prefix_bits.py +2 -2
- chia/_tests/farmer_harvester/test_third_party_harvesters.py +3 -4
- chia/_tests/fee_estimation/test_fee_estimation_integration.py +1 -1
- chia/_tests/fee_estimation/test_fee_estimation_rpc.py +2 -2
- chia/_tests/fee_estimation/test_fee_estimation_unit_tests.py +1 -1
- chia/_tests/fee_estimation/test_mempoolitem_height_added.py +3 -4
- chia/_tests/generator/test_compression.py +20 -10
- chia/_tests/generator/test_rom.py +7 -9
- chia/_tests/plot_sync/test_delta.py +2 -2
- chia/_tests/plot_sync/test_plot_sync.py +2 -2
- chia/_tests/plot_sync/test_receiver.py +2 -2
- chia/_tests/plot_sync/test_sender.py +2 -2
- chia/_tests/plot_sync/test_sync_simulated.py +2 -2
- chia/_tests/plot_sync/util.py +3 -2
- chia/_tests/plotting/test_plot_manager.py +1 -1
- chia/_tests/pools/test_pool_cli_parsing.py +3 -2
- chia/_tests/pools/test_pool_cmdline.py +2 -2
- chia/_tests/pools/test_pool_puzzles_lifecycle.py +3 -3
- chia/_tests/pools/test_pool_rpc.py +4 -5
- chia/_tests/pools/test_pool_wallet.py +1 -1
- chia/_tests/pools/test_wallet_pool_store.py +2 -2
- chia/_tests/rpc/test_rpc_client.py +1 -1
- chia/_tests/rpc/test_rpc_server.py +1 -1
- chia/_tests/simulation/test_simulation.py +36 -8
- chia/_tests/simulation/test_simulator.py +5 -5
- chia/_tests/simulation/test_start_simulator.py +2 -2
- chia/_tests/timelord/test_new_peak.py +2 -2
- chia/_tests/tools/test_run_block.py +3 -2
- chia/_tests/util/benchmark_cost.py +2 -2
- chia/_tests/util/benchmarks.py +17 -6
- chia/_tests/util/blockchain.py +2 -1
- chia/_tests/util/blockchain_mock.py +9 -5
- chia/_tests/util/build_network_protocol_files.py +2 -1
- chia/_tests/util/constants.py +2 -1
- chia/_tests/util/full_sync.py +6 -3
- chia/_tests/util/gen_ssl_certs.py +2 -2
- chia/_tests/util/generator_tools_testing.py +4 -3
- chia/_tests/util/get_name_puzzle_conditions.py +2 -2
- chia/_tests/util/misc.py +16 -2
- chia/_tests/util/network_protocol_data.py +17 -7
- chia/_tests/util/run_block.py +6 -8
- chia/_tests/util/setup_nodes.py +4 -3
- chia/_tests/util/spend_sim.py +9 -5
- chia/_tests/util/test_condition_tools.py +2 -2
- chia/_tests/util/test_config.py +2 -1
- chia/_tests/util/test_errors.py +2 -1
- chia/_tests/util/test_full_block_utils.py +17 -7
- chia/_tests/util/test_misc.py +1 -1
- chia/_tests/util/test_network_protocol_test.py +24 -24
- chia/_tests/util/test_replace_str_to_bytes.py +2 -2
- chia/_tests/util/test_trusted_peer.py +1 -1
- chia/_tests/util/time_out_assert.py +20 -7
- chia/_tests/wallet/cat_wallet/test_cat_lifecycle.py +1 -1
- chia/_tests/wallet/cat_wallet/test_cat_outer_puzzle.py +2 -2
- chia/_tests/wallet/cat_wallet/test_cat_wallet.py +5 -6
- chia/_tests/wallet/cat_wallet/test_offer_lifecycle.py +17 -15
- chia/_tests/wallet/cat_wallet/test_trades.py +2 -2
- chia/_tests/wallet/clawback/test_clawback_lifecycle.py +2 -2
- chia/_tests/wallet/clawback/test_clawback_metadata.py +2 -2
- chia/_tests/wallet/conftest.py +3 -3
- chia/_tests/wallet/db_wallet/test_db_graftroot.py +3 -5
- chia/_tests/wallet/db_wallet/test_dl_offers.py +2 -2
- chia/_tests/wallet/db_wallet/test_dl_wallet.py +433 -384
- chia/_tests/wallet/did_wallet/test_did.py +3 -3
- chia/_tests/wallet/nft_wallet/test_nft_1_offers.py +2 -2
- chia/_tests/wallet/nft_wallet/test_nft_bulk_mint.py +2 -2
- chia/_tests/wallet/nft_wallet/test_nft_lifecycle.py +3 -4
- chia/_tests/wallet/nft_wallet/test_nft_offers.py +1293 -703
- chia/_tests/wallet/nft_wallet/test_nft_puzzles.py +28 -30
- chia/_tests/wallet/nft_wallet/test_nft_wallet.py +2 -2
- chia/_tests/wallet/nft_wallet/test_ownership_outer_puzzle.py +2 -2
- chia/_tests/wallet/rpc/config.py +1 -1
- chia/_tests/wallet/rpc/test_dl_wallet_rpc.py +2 -2
- chia/_tests/wallet/rpc/test_wallet_rpc.py +20 -77
- chia/_tests/wallet/simple_sync/test_simple_sync_protocol.py +9 -7
- chia/_tests/wallet/sync/test_wallet_sync.py +79 -31
- chia/_tests/wallet/test_clvm_streamable.py +2 -2
- chia/_tests/wallet/test_coin_management.py +7 -7
- chia/_tests/wallet/test_coin_selection.py +20 -2
- chia/_tests/wallet/test_conditions.py +2 -2
- chia/_tests/wallet/test_debug_spend_bundle.py +2 -2
- chia/_tests/wallet/test_new_wallet_protocol.py +2 -2
- chia/_tests/wallet/test_nft_store.py +2 -2
- chia/_tests/wallet/test_notifications.py +2 -2
- chia/_tests/wallet/test_puzzle_store.py +2 -2
- chia/_tests/wallet/test_sign_coin_spends.py +2 -2
- chia/_tests/wallet/test_signer_protocol.py +3 -3
- chia/_tests/wallet/test_singleton.py +3 -11
- chia/_tests/wallet/test_singleton_lifecycle_fast.py +12 -13
- chia/_tests/wallet/test_singleton_store.py +2 -4
- chia/_tests/wallet/test_transaction_store.py +2 -2
- chia/_tests/wallet/test_util.py +2 -2
- chia/_tests/wallet/test_wallet.py +53 -49
- chia/_tests/wallet/test_wallet_action_scope.py +24 -6
- chia/_tests/wallet/test_wallet_blockchain.py +1 -1
- chia/_tests/wallet/test_wallet_coin_store.py +2 -2
- chia/_tests/wallet/test_wallet_interested_store.py +2 -2
- chia/_tests/wallet/test_wallet_node.py +3 -3
- chia/_tests/wallet/test_wallet_retry.py +3 -3
- chia/_tests/wallet/test_wallet_state_manager.py +8 -8
- chia/_tests/wallet/test_wallet_test_framework.py +1 -1
- chia/_tests/wallet/test_wallet_trade_store.py +2 -2
- chia/_tests/wallet/test_wallet_utils.py +2 -2
- chia/_tests/wallet/vc_wallet/test_cr_outer_puzzle.py +3 -2
- chia/_tests/wallet/vc_wallet/test_vc_lifecycle.py +15 -15
- chia/_tests/wallet/vc_wallet/test_vc_wallet.py +5 -3
- chia/_tests/wallet/wallet_block_tools.py +15 -7
- chia/_tests/weight_proof/test_weight_proof.py +3 -3
- chia/cmds/chia.py +0 -2
- chia/cmds/cmd_classes.py +3 -3
- chia/cmds/cmd_helpers.py +4 -4
- chia/cmds/cmds_util.py +2 -2
- chia/cmds/coin_funcs.py +3 -2
- chia/cmds/coins.py +1 -1
- chia/cmds/data.py +2 -2
- chia/cmds/data_funcs.py +3 -2
- chia/cmds/db_upgrade_func.py +2 -2
- chia/cmds/db_validate_func.py +15 -8
- chia/cmds/farm.py +2 -4
- chia/cmds/keys.py +0 -2
- chia/cmds/keys_funcs.py +1 -1
- chia/cmds/netspace_funcs.py +2 -1
- chia/cmds/param_types.py +2 -2
- chia/cmds/plotnft.py +2 -2
- chia/cmds/plotnft_funcs.py +2 -2
- chia/cmds/rpc.py +1 -1
- chia/cmds/show.py +1 -2
- chia/cmds/show_funcs.py +6 -3
- chia/cmds/signer.py +1 -2
- chia/cmds/sim.py +1 -2
- chia/cmds/sim_funcs.py +2 -2
- chia/cmds/wallet.py +2 -2
- chia/cmds/wallet_funcs.py +4 -11
- chia/consensus/block_body_validation.py +3 -4
- chia/consensus/block_creation.py +10 -6
- chia/consensus/block_header_validation.py +3 -4
- chia/consensus/block_record.py +2 -3
- chia/consensus/block_rewards.py +1 -1
- chia/consensus/blockchain.py +20 -17
- chia/consensus/blockchain_interface.py +5 -4
- chia/consensus/coinbase.py +2 -2
- chia/consensus/constants.py +1 -1
- chia/consensus/cost_calculator.py +2 -1
- chia/consensus/default_constants.py +4 -3
- chia/consensus/deficit.py +3 -2
- chia/consensus/difficulty_adjustment.py +8 -9
- chia/consensus/find_fork_point.py +4 -3
- chia/consensus/full_block_to_block_record.py +4 -3
- chia/consensus/get_block_challenge.py +4 -3
- chia/consensus/get_block_generator.py +3 -2
- chia/consensus/make_sub_epoch_summary.py +3 -2
- chia/consensus/multiprocess_validation.py +9 -4
- chia/consensus/pos_quality.py +1 -1
- chia/consensus/pot_iterations.py +4 -3
- chia/consensus/vdf_info_computation.py +4 -3
- chia/daemon/client.py +1 -1
- chia/daemon/keychain_server.py +1 -1
- chia/daemon/server.py +1 -1
- chia/daemon/windows_signal.py +1 -1
- chia/data_layer/data_layer.py +4 -3
- chia/data_layer/data_layer_errors.py +1 -1
- chia/data_layer/data_layer_util.py +2 -2
- chia/data_layer/data_layer_wallet.py +47 -69
- chia/data_layer/data_store.py +1 -1
- chia/data_layer/dl_wallet_store.py +5 -6
- chia/data_layer/download_data.py +1 -1
- chia/data_layer/s3_plugin_service.py +4 -4
- chia/data_layer/singleton_record.py +23 -0
- chia/data_layer/util/benchmark.py +2 -1
- chia/farmer/farmer.py +4 -6
- chia/farmer/farmer_api.py +4 -6
- chia/full_node/bitcoin_fee_estimator.py +2 -1
- chia/full_node/block_height_map.py +2 -2
- chia/full_node/block_store.py +8 -9
- chia/{util → full_node}/check_fork_next_block.py +2 -1
- chia/full_node/coin_store.py +10 -10
- chia/full_node/fee_estimate.py +2 -1
- chia/full_node/fee_estimation.py +2 -1
- chia/full_node/fee_estimator.py +2 -1
- chia/full_node/fee_estimator_interface.py +1 -1
- chia/full_node/fee_history.py +2 -1
- chia/full_node/fee_tracker.py +2 -1
- chia/full_node/full_node.py +15 -13
- chia/full_node/full_node_api.py +12 -32
- chia/full_node/full_node_store.py +4 -3
- chia/full_node/hint_management.py +2 -1
- chia/full_node/hint_store.py +3 -3
- chia/full_node/mempool.py +80 -12
- chia/full_node/mempool_check_conditions.py +6 -7
- chia/full_node/mempool_manager.py +168 -21
- chia/full_node/pending_tx_cache.py +2 -2
- chia/full_node/subscriptions.py +2 -2
- chia/full_node/sync_store.py +2 -3
- chia/full_node/tx_processing_queue.py +2 -1
- chia/full_node/weight_proof.py +5 -8
- chia/harvester/harvester.py +5 -3
- chia/harvester/harvester_api.py +2 -2
- chia/introducer/introducer.py +30 -2
- chia/introducer/introducer_api.py +9 -1
- chia/legacy/keyring.py +1 -2
- chia/plot_sync/exceptions.py +2 -1
- chia/plot_sync/receiver.py +2 -2
- chia/plot_sync/sender.py +1 -1
- chia/plotting/cache.py +2 -2
- chia/plotting/check_plots.py +4 -2
- chia/plotting/create_plots.py +1 -1
- chia/plotting/manager.py +3 -3
- chia/plotting/util.py +2 -2
- chia/pools/pool_config.py +1 -1
- chia/pools/pool_puzzles.py +23 -17
- chia/pools/pool_wallet.py +22 -9
- chia/pools/pool_wallet_info.py +2 -2
- chia/protocols/farmer_protocol.py +3 -6
- chia/protocols/full_node_protocol.py +3 -2
- chia/protocols/harvester_protocol.py +3 -4
- chia/protocols/pool_protocol.py +2 -2
- chia/protocols/shared_protocol.py +2 -1
- chia/protocols/timelord_protocol.py +4 -4
- chia/protocols/wallet_protocol.py +2 -2
- chia/rpc/data_layer_rpc_api.py +3 -4
- chia/rpc/data_layer_rpc_client.py +3 -2
- chia/rpc/farmer_rpc_api.py +2 -2
- chia/rpc/farmer_rpc_client.py +2 -1
- chia/rpc/full_node_rpc_api.py +3 -2
- chia/rpc/full_node_rpc_client.py +3 -2
- chia/rpc/harvester_rpc_api.py +2 -1
- chia/rpc/rpc_client.py +2 -2
- chia/rpc/rpc_server.py +1 -1
- chia/rpc/wallet_request_types.py +2 -62
- chia/rpc/wallet_rpc_api.py +98 -628
- chia/rpc/wallet_rpc_client.py +5 -253
- chia/seeder/crawl_store.py +1 -1
- chia/seeder/crawler.py +2 -2
- chia/seeder/peer_record.py +2 -1
- chia/seeder/start_crawler.py +3 -1
- chia/server/address_manager.py +2 -1
- chia/server/address_manager_store.py +1 -1
- chia/server/capabilities.py +2 -1
- chia/server/introducer_peers.py +2 -1
- chia/server/node_discovery.py +1 -1
- chia/server/outbound_message.py +2 -1
- chia/server/server.py +2 -2
- chia/server/start_data_layer.py +2 -1
- chia/server/start_farmer.py +3 -1
- chia/server/start_full_node.py +4 -2
- chia/server/start_harvester.py +3 -1
- chia/server/start_introducer.py +12 -1
- chia/server/start_service.py +2 -1
- chia/server/start_timelord.py +3 -1
- chia/server/start_wallet.py +3 -1
- chia/server/upnp.py +1 -2
- chia/server/ws_connection.py +3 -4
- chia/simulator/add_blocks_in_batches.py +5 -3
- chia/simulator/block_tools.py +16 -12
- chia/simulator/full_node_simulator.py +9 -14
- chia/simulator/setup_services.py +5 -3
- chia/simulator/simulator_full_node_rpc_api.py +3 -2
- chia/simulator/simulator_full_node_rpc_client.py +3 -2
- chia/simulator/simulator_protocol.py +3 -2
- chia/simulator/simulator_test_tools.py +2 -2
- chia/simulator/start_simulator.py +3 -2
- chia/simulator/wallet_tools.py +3 -4
- chia/timelord/iters_from_block.py +4 -4
- chia/timelord/timelord.py +7 -12
- chia/timelord/timelord_api.py +3 -3
- chia/timelord/timelord_state.py +4 -3
- chia/types/block_protocol.py +2 -2
- chia/types/blockchain_format/coin.py +2 -2
- chia/types/blockchain_format/program.py +1 -1
- chia/types/blockchain_format/proof_of_space.py +3 -4
- chia/types/blockchain_format/tree_hash.py +1 -1
- chia/types/blockchain_format/vdf.py +3 -4
- chia/types/clvm_cost.py +1 -1
- chia/types/coin_record.py +4 -3
- chia/types/coin_spend.py +1 -1
- chia/types/eligible_coin_spends.py +9 -5
- chia/types/fee_rate.py +1 -1
- chia/types/generator_types.py +3 -3
- chia/types/internal_mempool_item.py +3 -2
- chia/types/mempool_item.py +10 -3
- chia/types/mempool_submission_status.py +2 -1
- chia/types/mojos.py +1 -1
- chia/types/peer_info.py +2 -1
- chia/types/transaction_queue_entry.py +2 -1
- chia/types/unfinished_header_block.py +4 -4
- chia/types/validation_state.py +2 -1
- chia/types/weight_proof.py +1 -9
- chia/util/augmented_chain.py +20 -9
- chia/util/block_cache.py +8 -4
- chia/util/condition_tools.py +2 -2
- chia/util/full_block_utils.py +3 -4
- chia/util/generator_tools.py +2 -2
- chia/util/initial-config.yaml +2 -11
- chia/util/network.py +2 -2
- chia/util/prev_transaction_block.py +2 -1
- chia/util/task_timing.py +1 -1
- chia/util/vdf_prover.py +3 -3
- chia/util/ws_message.py +1 -1
- chia/wallet/cat_wallet/cat_info.py +3 -2
- chia/wallet/cat_wallet/cat_outer_puzzle.py +3 -2
- chia/wallet/cat_wallet/cat_utils.py +6 -4
- chia/wallet/cat_wallet/cat_wallet.py +16 -18
- chia/wallet/cat_wallet/lineage_store.py +2 -1
- chia/wallet/coin_selection.py +5 -5
- chia/wallet/conditions.py +22 -16
- chia/wallet/db_wallet/db_wallet_puzzles.py +15 -15
- chia/wallet/derivation_record.py +2 -2
- chia/wallet/derive_keys.py +2 -2
- chia/wallet/did_wallet/did_info.py +3 -2
- chia/wallet/did_wallet/did_wallet.py +41 -19
- chia/wallet/did_wallet/did_wallet_puzzles.py +18 -12
- chia/wallet/driver_protocol.py +1 -1
- chia/wallet/lineage_proof.py +3 -2
- chia/wallet/nft_wallet/metadata_outer_puzzle.py +6 -7
- chia/wallet/nft_wallet/nft_info.py +5 -5
- chia/wallet/nft_wallet/nft_puzzle_utils.py +293 -0
- chia/wallet/nft_wallet/nft_puzzles.py +21 -298
- chia/wallet/nft_wallet/nft_wallet.py +47 -62
- chia/wallet/nft_wallet/ownership_outer_puzzle.py +4 -8
- chia/wallet/nft_wallet/singleton_outer_puzzle.py +3 -2
- chia/wallet/nft_wallet/transfer_program_puzzle.py +6 -10
- chia/wallet/nft_wallet/uncurry_nft.py +6 -8
- chia/wallet/notification_manager.py +5 -5
- chia/wallet/notification_store.py +3 -2
- chia/wallet/outer_puzzles.py +2 -1
- chia/wallet/puzzles/clawback/drivers.py +21 -8
- chia/wallet/puzzles/clawback/metadata.py +3 -2
- chia/wallet/puzzles/clawback/puzzle_decorator.py +5 -4
- chia/wallet/puzzles/deployed_puzzle_hashes.json +0 -10
- chia/wallet/puzzles/p2_conditions.py +3 -2
- chia/wallet/puzzles/p2_delegated_conditions.py +3 -2
- chia/wallet/puzzles/p2_delegated_puzzle.py +3 -2
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py +3 -3
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.py +3 -2
- chia/wallet/puzzles/p2_puzzle_hash.py +4 -3
- chia/wallet/puzzles/puzzle_utils.py +3 -2
- chia/wallet/puzzles/singleton_top_layer.py +26 -10
- chia/wallet/puzzles/singleton_top_layer_v1_1.py +21 -9
- chia/wallet/puzzles/tails.py +21 -129
- chia/wallet/signer_protocol.py +3 -2
- chia/wallet/singleton.py +12 -6
- chia/wallet/singleton_record.py +3 -2
- chia/wallet/trade_manager.py +31 -55
- chia/wallet/trade_record.py +3 -2
- chia/wallet/trading/offer.py +14 -13
- chia/wallet/trading/trade_store.py +3 -4
- chia/wallet/transaction_record.py +2 -2
- chia/wallet/util/blind_signer_tl.py +3 -2
- chia/wallet/util/compute_hints.py +3 -2
- chia/wallet/util/compute_memos.py +2 -2
- chia/wallet/util/curry_and_treehash.py +1 -2
- chia/wallet/util/merkle_tree.py +1 -1
- chia/wallet/util/merkle_utils.py +1 -1
- chia/wallet/util/new_peak_queue.py +2 -1
- chia/wallet/util/notifications.py +5 -4
- chia/wallet/util/peer_request_cache.py +3 -2
- chia/wallet/util/puzzle_compression.py +6 -4
- chia/wallet/util/puzzle_decorator.py +6 -4
- chia/wallet/util/query_filter.py +3 -2
- chia/wallet/util/tx_config.py +3 -3
- chia/wallet/util/wallet_sync_utils.py +2 -2
- chia/wallet/util/wallet_types.py +2 -3
- chia/wallet/vc_wallet/cr_cat_drivers.py +18 -22
- chia/wallet/vc_wallet/cr_cat_wallet.py +14 -10
- chia/wallet/vc_wallet/cr_outer_puzzle.py +2 -2
- chia/wallet/vc_wallet/vc_drivers.py +50 -68
- chia/wallet/vc_wallet/vc_store.py +2 -2
- chia/wallet/vc_wallet/vc_wallet.py +47 -15
- chia/wallet/wallet.py +51 -46
- chia/wallet/wallet_action_scope.py +4 -0
- chia/wallet/wallet_blockchain.py +12 -7
- chia/wallet/wallet_coin_record.py +3 -2
- chia/wallet/wallet_coin_store.py +3 -2
- chia/wallet/wallet_info.py +2 -1
- chia/wallet/wallet_interested_store.py +3 -2
- chia/wallet/wallet_nft_store.py +4 -4
- chia/wallet/wallet_node.py +3 -4
- chia/wallet/wallet_pool_store.py +3 -4
- chia/wallet/wallet_protocol.py +19 -5
- chia/wallet/wallet_puzzle_store.py +2 -2
- chia/wallet/wallet_retry_store.py +3 -6
- chia/wallet/wallet_singleton_store.py +2 -2
- chia/wallet/wallet_state_manager.py +20 -197
- chia/wallet/wallet_transaction_store.py +2 -2
- chia/wallet/wallet_user_store.py +2 -1
- chia/wallet/wallet_weight_proof_handler.py +3 -2
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc2.dist-info}/METADATA +3 -2
- chia_blockchain-2.5.3rc2.dist-info/RECORD +891 -0
- mozilla-ca/cacert.pem +64 -33
- chia/_tests/clvm/test_condition_codes.py +0 -13
- chia/_tests/cmds/wallet/test_dao.py +0 -565
- chia/_tests/wallet/dao_wallet/__init__.py +0 -0
- chia/_tests/wallet/dao_wallet/config.py +0 -3
- chia/_tests/wallet/dao_wallet/test_dao_clvm.py +0 -1330
- chia/_tests/wallet/dao_wallet/test_dao_wallets.py +0 -3488
- chia/cmds/dao.py +0 -1064
- chia/cmds/dao_funcs.py +0 -598
- chia/consensus/puzzles/__init__.py +0 -0
- chia/consensus/puzzles/chialisp_deserialisation.clsp +0 -69
- chia/consensus/puzzles/chialisp_deserialisation.clsp.hex +0 -1
- chia/consensus/puzzles/rom_bootstrap_generator.clsp +0 -37
- chia/consensus/puzzles/rom_bootstrap_generator.clsp.hex +0 -1
- chia/full_node/puzzles/__init__.py +0 -0
- chia/full_node/puzzles/block_program_zero.clsp +0 -14
- chia/full_node/puzzles/block_program_zero.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_coin_spend_entry.clsp +0 -5
- chia/full_node/puzzles/decompress_coin_spend_entry.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp +0 -7
- chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_puzzle.clsp +0 -6
- chia/full_node/puzzles/decompress_puzzle.clsp.hex +0 -1
- chia/pools/puzzles/__init__.py +0 -0
- chia/pools/puzzles/pool_member_innerpuz.clsp +0 -70
- chia/pools/puzzles/pool_member_innerpuz.clsp.hex +0 -1
- chia/pools/puzzles/pool_waitingroom_innerpuz.clsp +0 -69
- chia/pools/puzzles/pool_waitingroom_innerpuz.clsp.hex +0 -1
- chia/simulator/simulator_constants.py +0 -13
- chia/types/blockchain_format/foliage.py +0 -8
- chia/types/blockchain_format/pool_target.py +0 -5
- chia/types/blockchain_format/reward_chain_block.py +0 -6
- chia/types/blockchain_format/sized_bytes.py +0 -11
- chia/util/ints.py +0 -19
- chia/wallet/cat_wallet/dao_cat_info.py +0 -28
- chia/wallet/cat_wallet/dao_cat_wallet.py +0 -669
- chia/wallet/cat_wallet/puzzles/__init__.py +0 -0
- chia/wallet/cat_wallet/puzzles/cat_truths.clib +0 -31
- chia/wallet/cat_wallet/puzzles/cat_v2.clsp +0 -397
- chia/wallet/cat_wallet/puzzles/cat_v2.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/delegated_tail.clsp +0 -25
- chia/wallet/cat_wallet/puzzles/delegated_tail.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp +0 -15
- chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp +0 -26
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp +0 -42
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp +0 -24
- chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp.hex +0 -1
- chia/wallet/dao_wallet/__init__.py +0 -0
- chia/wallet/dao_wallet/dao_info.py +0 -61
- chia/wallet/dao_wallet/dao_utils.py +0 -811
- chia/wallet/dao_wallet/dao_wallet.py +0 -2119
- chia/wallet/did_wallet/puzzles/__init__.py +0 -0
- chia/wallet/did_wallet/puzzles/did_innerpuz.clsp +0 -135
- chia/wallet/did_wallet/puzzles/did_innerpuz.clsp.hex +0 -1
- chia/wallet/payment.py +0 -33
- chia/wallet/puzzles/augmented_condition.clsp +0 -13
- chia/wallet/puzzles/augmented_condition.clsp.hex +0 -1
- chia/wallet/puzzles/condition_codes.clib +0 -77
- chia/wallet/puzzles/curry-and-treehash.clib +0 -102
- chia/wallet/puzzles/curry.clib +0 -135
- chia/wallet/puzzles/curry_by_index.clib +0 -16
- chia/wallet/puzzles/dao_cat_eve.clsp +0 -17
- chia/wallet/puzzles/dao_cat_eve.clsp.hex +0 -1
- chia/wallet/puzzles/dao_cat_launcher.clsp +0 -36
- chia/wallet/puzzles/dao_cat_launcher.clsp.hex +0 -1
- chia/wallet/puzzles/dao_finished_state.clsp +0 -35
- chia/wallet/puzzles/dao_finished_state.clsp.hex +0 -1
- chia/wallet/puzzles/dao_finished_state.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_lockup.clsp +0 -288
- chia/wallet/puzzles/dao_lockup.clsp.hex +0 -1
- chia/wallet/puzzles/dao_lockup.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal.clsp +0 -377
- chia/wallet/puzzles/dao_proposal.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal_timer.clsp +0 -78
- chia/wallet/puzzles/dao_proposal_timer.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal_timer.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal_validator.clsp +0 -87
- chia/wallet/puzzles/dao_proposal_validator.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal_validator.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp +0 -240
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex +0 -1
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_treasury.clsp +0 -115
- chia/wallet/puzzles/dao_treasury.clsp.hex +0 -1
- chia/wallet/puzzles/dao_update_proposal.clsp +0 -44
- chia/wallet/puzzles/dao_update_proposal.clsp.hex +0 -1
- chia/wallet/puzzles/json.clib +0 -25
- chia/wallet/puzzles/merkle_utils.clib +0 -18
- chia/wallet/puzzles/notification.clsp +0 -7
- chia/wallet/puzzles/notification.clsp.hex +0 -1
- chia/wallet/puzzles/p2_1_of_n.clsp +0 -22
- chia/wallet/puzzles/p2_1_of_n.clsp.hex +0 -1
- chia/wallet/puzzles/p2_conditions.clsp +0 -3
- chia/wallet/puzzles/p2_conditions.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_conditions.clsp +0 -18
- chia/wallet/puzzles/p2_delegated_conditions.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_puzzle.clsp +0 -19
- chia/wallet/puzzles/p2_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp +0 -91
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp +0 -108
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp.hex +0 -1
- chia/wallet/puzzles/p2_parent.clsp +0 -19
- chia/wallet/puzzles/p2_parent.clsp.hex +0 -1
- chia/wallet/puzzles/p2_puzzle_hash.clsp +0 -18
- chia/wallet/puzzles/p2_puzzle_hash.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton.clsp +0 -30
- chia/wallet/puzzles/p2_singleton.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_aggregator.clsp +0 -81
- chia/wallet/puzzles/p2_singleton_aggregator.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp +0 -50
- chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp +0 -47
- chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/settlement_payments.clsp +0 -49
- chia/wallet/puzzles/settlement_payments.clsp.hex +0 -1
- chia/wallet/puzzles/sha256tree.clib +0 -11
- chia/wallet/puzzles/singleton_launcher.clsp +0 -16
- chia/wallet/puzzles/singleton_launcher.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_top_layer.clsp +0 -177
- chia/wallet/puzzles/singleton_top_layer.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_top_layer_v1_1.clsp +0 -107
- chia/wallet/puzzles/singleton_top_layer_v1_1.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_truths.clib +0 -21
- chia/wallet/vc_wallet/cr_puzzles/__init__.py +0 -0
- chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp +0 -3
- chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp.hex +0 -1
- chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp +0 -304
- chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp.hex +0 -1
- chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp +0 -45
- chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/__init__.py +0 -0
- chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp +0 -30
- chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp +0 -75
- chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp +0 -32
- chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp +0 -80
- chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp +0 -163
- chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp +0 -16
- chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp +0 -74
- chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp +0 -23
- chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp +0 -64
- chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp.hex +0 -1
- chia_blockchain-2.5.2rc2.dist-info/RECORD +0 -1042
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc2.dist-info}/LICENSE +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc2.dist-info}/WHEEL +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc2.dist-info}/entry_points.txt +0 -0
|
@@ -8,24 +8,23 @@ import time
|
|
|
8
8
|
from typing import TYPE_CHECKING, Any, ClassVar, Optional, TypeVar, cast
|
|
9
9
|
|
|
10
10
|
from chia_rs import AugSchemeMPL, G1Element, G2Element
|
|
11
|
+
from chia_rs.sized_bytes import bytes32
|
|
12
|
+
from chia_rs.sized_ints import uint16, uint32, uint64, uint128
|
|
11
13
|
from clvm.casts import int_from_bytes, int_to_bytes
|
|
12
14
|
from typing_extensions import Unpack
|
|
13
15
|
|
|
14
|
-
import chia.server.api_protocol
|
|
15
|
-
import chia.wallet.singleton
|
|
16
16
|
from chia.protocols.wallet_protocol import CoinState
|
|
17
17
|
from chia.server.ws_connection import WSChiaConnection
|
|
18
18
|
from chia.types.blockchain_format.coin import Coin
|
|
19
19
|
from chia.types.blockchain_format.program import Program
|
|
20
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
21
20
|
from chia.types.coin_spend import CoinSpend, compute_additions, make_spend
|
|
22
21
|
from chia.types.signing_mode import CHIP_0002_SIGN_MESSAGE_PREFIX, SigningMode
|
|
23
22
|
from chia.util.hash import std_hash
|
|
24
|
-
from chia.util.ints import uint16, uint32, uint64, uint128
|
|
25
23
|
from chia.wallet.conditions import (
|
|
26
24
|
AssertCoinAnnouncement,
|
|
27
25
|
AssertPuzzleAnnouncement,
|
|
28
26
|
Condition,
|
|
27
|
+
CreateCoin,
|
|
29
28
|
CreateCoinAnnouncement,
|
|
30
29
|
CreatePuzzleAnnouncement,
|
|
31
30
|
UnknownCondition,
|
|
@@ -35,18 +34,19 @@ from chia.wallet.derivation_record import DerivationRecord
|
|
|
35
34
|
from chia.wallet.did_wallet import did_wallet_puzzles
|
|
36
35
|
from chia.wallet.did_wallet.did_info import DIDInfo
|
|
37
36
|
from chia.wallet.lineage_proof import LineageProof
|
|
38
|
-
from chia.wallet.nft_wallet import
|
|
37
|
+
from chia.wallet.nft_wallet import nft_puzzle_utils
|
|
39
38
|
from chia.wallet.nft_wallet.nft_info import NFTCoinInfo, NFTWalletInfo
|
|
40
|
-
from chia.wallet.nft_wallet.
|
|
39
|
+
from chia.wallet.nft_wallet.nft_puzzle_utils import create_ownership_layer_puzzle, get_metadata_and_phs
|
|
40
|
+
from chia.wallet.nft_wallet.nft_puzzles import NFT_METADATA_UPDATER
|
|
41
41
|
from chia.wallet.nft_wallet.uncurry_nft import NFTCoinData, UncurriedNFT
|
|
42
42
|
from chia.wallet.outer_puzzles import AssetType, construct_puzzle, match_puzzle, solve_puzzle
|
|
43
|
-
from chia.wallet.payment import Payment
|
|
44
43
|
from chia.wallet.puzzle_drivers import PuzzleInfo, Solver
|
|
45
44
|
from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import (
|
|
46
45
|
DEFAULT_HIDDEN_PUZZLE_HASH,
|
|
47
46
|
calculate_synthetic_secret_key,
|
|
48
47
|
puzzle_for_pk,
|
|
49
48
|
)
|
|
49
|
+
from chia.wallet.singleton import SINGLETON_LAUNCHER_PUZZLE, SINGLETON_LAUNCHER_PUZZLE_HASH, create_singleton_puzzle
|
|
50
50
|
from chia.wallet.trading.offer import OFFER_MOD, OFFER_MOD_HASH, NotarizedPayment, Offer
|
|
51
51
|
from chia.wallet.transaction_record import TransactionRecord
|
|
52
52
|
from chia.wallet.uncurried_puzzle import uncurry_puzzle
|
|
@@ -211,13 +211,13 @@ class NFTWallet:
|
|
|
211
211
|
mint_height: uint32 = uint32(launcher_coin_states[0].spent_height)
|
|
212
212
|
minter_did = None
|
|
213
213
|
if uncurried_nft.supports_did:
|
|
214
|
-
inner_puzzle =
|
|
214
|
+
inner_puzzle = nft_puzzle_utils.recurry_nft_puzzle(
|
|
215
215
|
uncurried_nft, data.parent_coin_spend.solution.to_program(), p2_puzzle
|
|
216
216
|
)
|
|
217
217
|
minter_did = await self.wallet_state_manager.get_minter_did(launcher_coin_states[0].coin, peer)
|
|
218
218
|
else:
|
|
219
219
|
inner_puzzle = p2_puzzle
|
|
220
|
-
child_puzzle: Program =
|
|
220
|
+
child_puzzle: Program = nft_puzzle_utils.create_full_puzzle(
|
|
221
221
|
singleton_id,
|
|
222
222
|
Program.to(metadata),
|
|
223
223
|
bytes32(uncurried_nft.metadata_updater_hash.as_atom()),
|
|
@@ -225,7 +225,7 @@ class NFTWallet:
|
|
|
225
225
|
)
|
|
226
226
|
self.log.debug(
|
|
227
227
|
"Created NFT full puzzle with inner: %s",
|
|
228
|
-
|
|
228
|
+
nft_puzzle_utils.create_full_puzzle_with_nft_puzzle(singleton_id, uncurried_nft.inner_puzzle),
|
|
229
229
|
)
|
|
230
230
|
child_puzzle_hash = child_puzzle.get_tree_hash()
|
|
231
231
|
for new_coin in compute_additions(data.parent_coin_spend):
|
|
@@ -353,9 +353,9 @@ class NFTWallet:
|
|
|
353
353
|
if coins is None:
|
|
354
354
|
return None
|
|
355
355
|
origin = coins.copy().pop()
|
|
356
|
-
genesis_launcher_puz =
|
|
356
|
+
genesis_launcher_puz = SINGLETON_LAUNCHER_PUZZLE
|
|
357
357
|
# nft_id == singleton_id == launcher_id == launcher_coin.name()
|
|
358
|
-
launcher_coin = Coin(origin.name(),
|
|
358
|
+
launcher_coin = Coin(origin.name(), SINGLETON_LAUNCHER_PUZZLE_HASH, uint64(amount))
|
|
359
359
|
self.log.debug("Generating NFT with launcher coin %s and metadata: %s", launcher_coin, metadata)
|
|
360
360
|
|
|
361
361
|
p2_inner_puzzle = await self.standard_wallet.get_puzzle(new=not action_scope.config.tx_config.reuse_puzhash)
|
|
@@ -376,7 +376,7 @@ class NFTWallet:
|
|
|
376
376
|
inner_puzzle = p2_inner_puzzle
|
|
377
377
|
|
|
378
378
|
# singleton eve puzzle
|
|
379
|
-
eve_fullpuz =
|
|
379
|
+
eve_fullpuz = nft_puzzle_utils.create_full_puzzle(
|
|
380
380
|
launcher_coin.name(), metadata, NFT_METADATA_UPDATER.get_tree_hash(), inner_puzzle
|
|
381
381
|
)
|
|
382
382
|
eve_fullpuz_hash = eve_fullpuz.get_tree_hash()
|
|
@@ -388,12 +388,11 @@ class NFTWallet:
|
|
|
388
388
|
)
|
|
389
389
|
# store the launcher transaction in the wallet state
|
|
390
390
|
await self.standard_wallet.generate_signed_transaction(
|
|
391
|
-
uint64(amount),
|
|
392
|
-
|
|
391
|
+
[uint64(amount)],
|
|
392
|
+
[SINGLETON_LAUNCHER_PUZZLE_HASH],
|
|
393
393
|
action_scope,
|
|
394
394
|
fee,
|
|
395
|
-
coins,
|
|
396
|
-
None,
|
|
395
|
+
coins=coins,
|
|
397
396
|
origin_id=origin.name(),
|
|
398
397
|
extra_conditions=(
|
|
399
398
|
*extra_conditions,
|
|
@@ -591,7 +590,7 @@ class NFTWallet:
|
|
|
591
590
|
for amount, puzhash, memo_list in zip(amounts, puzzle_hashes, memos):
|
|
592
591
|
memos_with_hint: list[bytes] = [puzhash]
|
|
593
592
|
memos_with_hint.extend(memo_list)
|
|
594
|
-
payments.append(
|
|
593
|
+
payments.append(CreateCoin(puzhash, amount, memos_with_hint))
|
|
595
594
|
|
|
596
595
|
payment_sum = sum(p.amount for p in payments)
|
|
597
596
|
unsigned_spend_bundle = await self.generate_unsigned_spendbundle(
|
|
@@ -639,7 +638,7 @@ class NFTWallet:
|
|
|
639
638
|
|
|
640
639
|
async def generate_unsigned_spendbundle(
|
|
641
640
|
self,
|
|
642
|
-
payments: list[
|
|
641
|
+
payments: list[CreateCoin],
|
|
643
642
|
action_scope: WalletActionScope,
|
|
644
643
|
fee: uint64 = uint64(0),
|
|
645
644
|
coins: Optional[set[Coin]] = None,
|
|
@@ -807,27 +806,27 @@ class NFTWallet:
|
|
|
807
806
|
else:
|
|
808
807
|
offered_royalty_percentages[asset] = uint16(royalty_percentage)
|
|
809
808
|
|
|
810
|
-
royalty_payments: dict[Optional[bytes32], list[tuple[bytes32,
|
|
809
|
+
royalty_payments: dict[Optional[bytes32], list[tuple[bytes32, CreateCoin]]] = {}
|
|
811
810
|
for asset, amount in fungible_asset_dict.items(): # offered fungible items
|
|
812
811
|
if amount < 0 and request_side_royalty_split > 0:
|
|
813
|
-
payment_list: list[tuple[bytes32,
|
|
812
|
+
payment_list: list[tuple[bytes32, CreateCoin]] = []
|
|
814
813
|
for launcher_id, address, percentage in required_royalty_info:
|
|
815
814
|
extra_royalty_amount = uint64(
|
|
816
815
|
math.floor(math.floor(abs(amount) / request_side_royalty_split) * (percentage / 10000))
|
|
817
816
|
)
|
|
818
817
|
if extra_royalty_amount == abs(amount):
|
|
819
818
|
raise ValueError("Amount offered and amount paid in royalties are equal")
|
|
820
|
-
payment_list.append((launcher_id,
|
|
819
|
+
payment_list.append((launcher_id, CreateCoin(address, extra_royalty_amount, [address])))
|
|
821
820
|
royalty_payments[asset] = payment_list
|
|
822
821
|
|
|
823
822
|
# Generate the requested_payments to be notarized
|
|
824
823
|
p2_ph = await wallet_state_manager.main_wallet.get_puzzle_hash(
|
|
825
824
|
new=not action_scope.config.tx_config.reuse_puzhash
|
|
826
825
|
)
|
|
827
|
-
requested_payments: dict[Optional[bytes32], list[
|
|
826
|
+
requested_payments: dict[Optional[bytes32], list[CreateCoin]] = {}
|
|
828
827
|
for asset, amount in offer_dict.items():
|
|
829
828
|
if amount > 0:
|
|
830
|
-
requested_payments[asset] = [
|
|
829
|
+
requested_payments[asset] = [CreateCoin(p2_ph, uint64(amount), [p2_ph] if asset is not None else [])]
|
|
831
830
|
|
|
832
831
|
# Find all the coins we're offering
|
|
833
832
|
offered_coins_by_asset: dict[Optional[bytes32], set[Coin]] = {}
|
|
@@ -894,19 +893,18 @@ class NFTWallet:
|
|
|
894
893
|
async with wallet_state_manager.new_action_scope(
|
|
895
894
|
action_scope.config.tx_config, push=False
|
|
896
895
|
) as inner_action_scope:
|
|
897
|
-
if
|
|
896
|
+
if asset in fungible_asset_dict:
|
|
898
897
|
payments = royalty_payments[asset] if asset in royalty_payments else []
|
|
899
898
|
payment_sum = sum(p.amount for _, p in payments)
|
|
900
899
|
await wallet.generate_signed_transaction(
|
|
901
|
-
abs(amount),
|
|
902
|
-
OFFER_MOD_HASH,
|
|
900
|
+
[abs(amount)] + ([uint64(payment_sum)] if payment_sum > 0 else []),
|
|
901
|
+
[OFFER_MOD_HASH] + ([OFFER_MOD_HASH] if payment_sum > 0 else []),
|
|
903
902
|
inner_action_scope,
|
|
904
|
-
|
|
905
|
-
fee=fee,
|
|
903
|
+
fee=fee if asset is None else fee_left_to_pay,
|
|
906
904
|
coins=offered_coins_by_asset[asset],
|
|
907
905
|
extra_conditions=(*extra_conditions, *announcements_to_assert),
|
|
908
906
|
)
|
|
909
|
-
|
|
907
|
+
else:
|
|
910
908
|
assert asset is not None
|
|
911
909
|
await wallet.generate_signed_transaction(
|
|
912
910
|
[abs(amount)],
|
|
@@ -921,16 +919,7 @@ class NFTWallet:
|
|
|
921
919
|
],
|
|
922
920
|
extra_conditions=(*extra_conditions, *announcements_to_assert),
|
|
923
921
|
)
|
|
924
|
-
|
|
925
|
-
payments = royalty_payments[asset] if asset in royalty_payments else []
|
|
926
|
-
await wallet.generate_signed_transaction(
|
|
927
|
-
[abs(amount)] + ([sum(p.amount for _, p in payments)] if payments != [] else []),
|
|
928
|
-
[OFFER_MOD_HASH] + ([OFFER_MOD_HASH] if payments != [] else []),
|
|
929
|
-
inner_action_scope,
|
|
930
|
-
fee=fee_left_to_pay,
|
|
931
|
-
coins=offered_coins_by_asset[asset],
|
|
932
|
-
extra_conditions=(*extra_conditions, *announcements_to_assert),
|
|
933
|
-
)
|
|
922
|
+
|
|
934
923
|
all_transactions.extend(inner_action_scope.side_effects.transactions)
|
|
935
924
|
fee_left_to_pay = uint64(0)
|
|
936
925
|
extra_conditions = tuple()
|
|
@@ -950,8 +939,8 @@ class NFTWallet:
|
|
|
950
939
|
royalty_coin: Optional[Coin] = None
|
|
951
940
|
parent_spend: Optional[CoinSpend] = None
|
|
952
941
|
while True:
|
|
953
|
-
duplicate_payments: list[tuple[bytes32,
|
|
954
|
-
deduped_payment_list: list[tuple[bytes32,
|
|
942
|
+
duplicate_payments: list[tuple[bytes32, CreateCoin]] = []
|
|
943
|
+
deduped_payment_list: list[tuple[bytes32, CreateCoin]] = []
|
|
955
944
|
for launcher_id, payment in payments:
|
|
956
945
|
if payment in [p for _, p in deduped_payment_list]:
|
|
957
946
|
duplicate_payments.append((launcher_id, payment))
|
|
@@ -970,7 +959,7 @@ class NFTWallet:
|
|
|
970
959
|
(
|
|
971
960
|
None,
|
|
972
961
|
[
|
|
973
|
-
|
|
962
|
+
CreateCoin(
|
|
974
963
|
OFFER_MOD_HASH,
|
|
975
964
|
uint64(sum(p.amount for _, p in duplicate_payments)),
|
|
976
965
|
).as_condition_args()
|
|
@@ -1227,7 +1216,7 @@ class NFTWallet:
|
|
|
1227
1216
|
new_p2_puzhash = p2_puzzle.get_tree_hash()
|
|
1228
1217
|
assert new_p2_puzhash is not None
|
|
1229
1218
|
# make the primaries for the DID spend
|
|
1230
|
-
primaries = [
|
|
1219
|
+
primaries = [CreateCoin(new_innerpuzhash, uint64(did_coin.amount), [bytes(new_p2_puzhash)])]
|
|
1231
1220
|
|
|
1232
1221
|
# Ensure we have an xch coin of high enough amount
|
|
1233
1222
|
assert isinstance(fee, uint64)
|
|
@@ -1260,10 +1249,10 @@ class NFTWallet:
|
|
|
1260
1249
|
for mint_number in range(mint_number_start, mint_number_end):
|
|
1261
1250
|
# Create the puzzle, solution and coin spend for the intermediate launcher
|
|
1262
1251
|
intermediate_launcher_puz = did_wallet_puzzles.INTERMEDIATE_LAUNCHER_MOD.curry(
|
|
1263
|
-
|
|
1252
|
+
SINGLETON_LAUNCHER_PUZZLE_HASH, mint_number, mint_total
|
|
1264
1253
|
)
|
|
1265
1254
|
intermediate_launcher_ph = intermediate_launcher_puz.get_tree_hash()
|
|
1266
|
-
primaries.append(
|
|
1255
|
+
primaries.append(CreateCoin(intermediate_launcher_ph, uint64(0), [intermediate_launcher_ph]))
|
|
1267
1256
|
intermediate_launcher_sol = Program.to([])
|
|
1268
1257
|
intermediate_launcher_coin = Coin(did_coin.name(), intermediate_launcher_ph, uint64(0))
|
|
1269
1258
|
intermediate_launcher_coin_spend = make_spend(
|
|
@@ -1278,9 +1267,7 @@ class NFTWallet:
|
|
|
1278
1267
|
did_announcements.add(std_hash(intermediate_launcher_coin.name() + intermediate_announcement_message))
|
|
1279
1268
|
|
|
1280
1269
|
# Create the launcher coin, and add its id to a list to be asserted in the DID spend
|
|
1281
|
-
launcher_coin = Coin(
|
|
1282
|
-
intermediate_launcher_coin.name(), chia.wallet.singleton.SINGLETON_LAUNCHER_PUZZLE_HASH, amount
|
|
1283
|
-
)
|
|
1270
|
+
launcher_coin = Coin(intermediate_launcher_coin.name(), SINGLETON_LAUNCHER_PUZZLE_HASH, amount)
|
|
1284
1271
|
launcher_ids.append(launcher_coin.name())
|
|
1285
1272
|
|
|
1286
1273
|
# Grab the metadata from metadata_list. The index for metadata_list
|
|
@@ -1295,7 +1282,7 @@ class NFTWallet:
|
|
|
1295
1282
|
metadata["royalty_pc"],
|
|
1296
1283
|
royalty_puzzle_hash=metadata["royalty_ph"],
|
|
1297
1284
|
)
|
|
1298
|
-
eve_fullpuz =
|
|
1285
|
+
eve_fullpuz = nft_puzzle_utils.create_full_puzzle(
|
|
1299
1286
|
launcher_coin.name(), metadata["program"], NFT_METADATA_UPDATER.get_tree_hash(), inner_puzzle
|
|
1300
1287
|
)
|
|
1301
1288
|
|
|
@@ -1305,9 +1292,7 @@ class NFTWallet:
|
|
|
1305
1292
|
|
|
1306
1293
|
genesis_launcher_solution = Program.to([eve_fullpuz.get_tree_hash(), amount, []])
|
|
1307
1294
|
|
|
1308
|
-
launcher_cs = make_spend(
|
|
1309
|
-
launcher_coin, chia.wallet.singleton.SINGLETON_LAUNCHER_PUZZLE, genesis_launcher_solution
|
|
1310
|
-
)
|
|
1295
|
+
launcher_cs = make_spend(launcher_coin, SINGLETON_LAUNCHER_PUZZLE, genesis_launcher_solution)
|
|
1311
1296
|
launcher_spends.append(launcher_cs)
|
|
1312
1297
|
|
|
1313
1298
|
eve_coin = Coin(launcher_coin.name(), eve_fullpuz.get_tree_hash(), uint64(amount))
|
|
@@ -1364,7 +1349,7 @@ class NFTWallet:
|
|
|
1364
1349
|
change: uint64 = uint64(spend_value - total_amount)
|
|
1365
1350
|
if xch_change_ph is None:
|
|
1366
1351
|
xch_change_ph = await self.standard_wallet.get_new_puzzlehash()
|
|
1367
|
-
xch_payment =
|
|
1352
|
+
xch_payment = CreateCoin(xch_change_ph, change, [xch_change_ph])
|
|
1368
1353
|
|
|
1369
1354
|
xch_coins_iter = iter(xch_coins)
|
|
1370
1355
|
xch_coin = next(xch_coins_iter)
|
|
@@ -1409,7 +1394,7 @@ class NFTWallet:
|
|
|
1409
1394
|
),
|
|
1410
1395
|
)
|
|
1411
1396
|
did_inner_sol: Program = Program.to([1, did_p2_solution])
|
|
1412
|
-
did_full_puzzle: Program =
|
|
1397
|
+
did_full_puzzle: Program = create_singleton_puzzle(
|
|
1413
1398
|
innerpuz,
|
|
1414
1399
|
did_wallet.did_info.origin_coin.name(),
|
|
1415
1400
|
)
|
|
@@ -1521,11 +1506,11 @@ class NFTWallet:
|
|
|
1521
1506
|
# Loop to create each intermediate coin, launcher, eve and (optional) transfer spends
|
|
1522
1507
|
for mint_number in range(mint_number_start, mint_number_end):
|
|
1523
1508
|
# Create the puzzle, solution and coin spend for the intermediate launcher
|
|
1524
|
-
intermediate_launcher_puz =
|
|
1525
|
-
|
|
1509
|
+
intermediate_launcher_puz = did_wallet_puzzles.INTERMEDIATE_LAUNCHER_MOD.curry(
|
|
1510
|
+
SINGLETON_LAUNCHER_PUZZLE_HASH, mint_number, mint_total
|
|
1526
1511
|
)
|
|
1527
1512
|
intermediate_launcher_ph = intermediate_launcher_puz.get_tree_hash()
|
|
1528
|
-
primaries.append(
|
|
1513
|
+
primaries.append(CreateCoin(intermediate_launcher_ph, uint64(1), [intermediate_launcher_ph]))
|
|
1529
1514
|
intermediate_launcher_sol = Program.to([])
|
|
1530
1515
|
intermediate_launcher_coin = Coin(funding_coin.name(), intermediate_launcher_ph, uint64(1))
|
|
1531
1516
|
intermediate_launcher_coin_spend = make_spend(
|
|
@@ -1540,7 +1525,7 @@ class NFTWallet:
|
|
|
1540
1525
|
coin_announcements.add(std_hash(intermediate_launcher_coin.name() + intermediate_announcement_message))
|
|
1541
1526
|
|
|
1542
1527
|
# Create the launcher coin, and add its id to a list to be asserted in the XCH spend
|
|
1543
|
-
launcher_coin = Coin(intermediate_launcher_coin.name(),
|
|
1528
|
+
launcher_coin = Coin(intermediate_launcher_coin.name(), SINGLETON_LAUNCHER_PUZZLE_HASH, amount)
|
|
1544
1529
|
launcher_ids.append(launcher_coin.name())
|
|
1545
1530
|
|
|
1546
1531
|
# Grab the metadata from metadata_list. The index for metadata_list
|
|
@@ -1556,7 +1541,7 @@ class NFTWallet:
|
|
|
1556
1541
|
metadata["royalty_pc"],
|
|
1557
1542
|
royalty_puzzle_hash=metadata["royalty_ph"],
|
|
1558
1543
|
)
|
|
1559
|
-
eve_fullpuz =
|
|
1544
|
+
eve_fullpuz = nft_puzzle_utils.create_full_puzzle(
|
|
1560
1545
|
launcher_coin.name(), metadata["program"], NFT_METADATA_UPDATER.get_tree_hash(), inner_puzzle
|
|
1561
1546
|
)
|
|
1562
1547
|
|
|
@@ -1566,7 +1551,7 @@ class NFTWallet:
|
|
|
1566
1551
|
|
|
1567
1552
|
genesis_launcher_solution = Program.to([eve_fullpuz.get_tree_hash(), amount, []])
|
|
1568
1553
|
|
|
1569
|
-
launcher_cs = make_spend(launcher_coin,
|
|
1554
|
+
launcher_cs = make_spend(launcher_coin, SINGLETON_LAUNCHER_PUZZLE, genesis_launcher_solution)
|
|
1570
1555
|
launcher_spends.append(launcher_cs)
|
|
1571
1556
|
|
|
1572
1557
|
eve_coin = Coin(launcher_coin.name(), eve_fullpuz.get_tree_hash(), uint64(amount))
|
|
@@ -1622,7 +1607,7 @@ class NFTWallet:
|
|
|
1622
1607
|
xch_spends = []
|
|
1623
1608
|
if xch_change_ph is None:
|
|
1624
1609
|
xch_change_ph = await self.standard_wallet.get_new_puzzlehash()
|
|
1625
|
-
xch_payment =
|
|
1610
|
+
xch_payment = CreateCoin(xch_change_ph, change, [xch_change_ph])
|
|
1626
1611
|
|
|
1627
1612
|
first = True
|
|
1628
1613
|
for xch_coin in xch_coins:
|
|
@@ -3,21 +3,17 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from typing import Callable, Optional, Union
|
|
5
5
|
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
6
7
|
from clvm_tools.binutils import disassemble
|
|
7
8
|
|
|
8
9
|
from chia.types.blockchain_format.program import Program
|
|
9
|
-
from chia.
|
|
10
|
+
from chia.wallet.nft_wallet.nft_puzzles import NFT_OWNERSHIP_LAYER
|
|
10
11
|
from chia.wallet.puzzle_drivers import PuzzleInfo, Solver
|
|
11
|
-
from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile
|
|
12
12
|
from chia.wallet.uncurried_puzzle import UncurriedPuzzle, uncurry_puzzle
|
|
13
13
|
|
|
14
|
-
OWNERSHIP_LAYER_MOD = load_clvm_maybe_recompile(
|
|
15
|
-
"nft_ownership_layer.clsp", package_or_requirement="chia.wallet.nft_wallet.puzzles"
|
|
16
|
-
)
|
|
17
|
-
|
|
18
14
|
|
|
19
15
|
def match_ownership_layer_puzzle(puzzle: UncurriedPuzzle) -> tuple[bool, list[Program]]:
|
|
20
|
-
if puzzle.mod ==
|
|
16
|
+
if puzzle.mod == NFT_OWNERSHIP_LAYER:
|
|
21
17
|
return True, list(puzzle.args.as_iter())
|
|
22
18
|
return False, []
|
|
23
19
|
|
|
@@ -25,7 +21,7 @@ def match_ownership_layer_puzzle(puzzle: UncurriedPuzzle) -> tuple[bool, list[Pr
|
|
|
25
21
|
def puzzle_for_ownership_layer(
|
|
26
22
|
current_owner: Union[Program, bytes], transfer_program: Program, inner_puzzle: Program
|
|
27
23
|
) -> Program:
|
|
28
|
-
return
|
|
24
|
+
return NFT_OWNERSHIP_LAYER.curry(NFT_OWNERSHIP_LAYER.get_tree_hash(), current_owner, transfer_program, inner_puzzle)
|
|
29
25
|
|
|
30
26
|
|
|
31
27
|
def solution_for_ownership_layer(inner_solution: Program) -> Program:
|
|
@@ -3,11 +3,12 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from typing import Any, Callable, Optional
|
|
5
5
|
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint64
|
|
8
|
+
|
|
6
9
|
from chia.types.blockchain_format.coin import Coin
|
|
7
10
|
from chia.types.blockchain_format.program import Program
|
|
8
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
9
11
|
from chia.types.coin_spend import CoinSpend
|
|
10
|
-
from chia.util.ints import uint64
|
|
11
12
|
from chia.wallet.lineage_proof import LineageProof
|
|
12
13
|
from chia.wallet.puzzle_drivers import PuzzleInfo, Solver
|
|
13
14
|
from chia.wallet.puzzles.singleton_top_layer_v1_1 import (
|
|
@@ -3,29 +3,25 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from typing import Callable, Optional
|
|
5
5
|
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint16
|
|
8
|
+
|
|
6
9
|
from chia.types.blockchain_format.program import Program
|
|
7
|
-
from chia.
|
|
8
|
-
from chia.util.ints import uint16
|
|
10
|
+
from chia.wallet.nft_wallet.nft_puzzles import NFT_TRANSFER_PROGRAM_DEFAULT
|
|
9
11
|
from chia.wallet.puzzle_drivers import PuzzleInfo, Solver
|
|
10
|
-
from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile
|
|
11
12
|
from chia.wallet.puzzles.singleton_top_layer_v1_1 import SINGLETON_LAUNCHER_HASH, SINGLETON_MOD_HASH
|
|
12
13
|
from chia.wallet.uncurried_puzzle import UncurriedPuzzle
|
|
13
14
|
|
|
14
|
-
TRANSFER_PROGRAM_MOD = load_clvm_maybe_recompile(
|
|
15
|
-
"nft_ownership_transfer_program_one_way_claim_with_royalties.clsp",
|
|
16
|
-
package_or_requirement="chia.wallet.nft_wallet.puzzles",
|
|
17
|
-
)
|
|
18
|
-
|
|
19
15
|
|
|
20
16
|
def match_transfer_program_puzzle(puzzle: UncurriedPuzzle) -> tuple[bool, list[Program]]:
|
|
21
|
-
if puzzle.mod ==
|
|
17
|
+
if puzzle.mod == NFT_TRANSFER_PROGRAM_DEFAULT:
|
|
22
18
|
return True, list(puzzle.args.as_iter())
|
|
23
19
|
return False, []
|
|
24
20
|
|
|
25
21
|
|
|
26
22
|
def puzzle_for_transfer_program(launcher_id: bytes32, royalty_puzzle_hash: bytes32, percentage: uint16) -> Program:
|
|
27
23
|
singleton_struct = Program.to((SINGLETON_MOD_HASH, (launcher_id, SINGLETON_LAUNCHER_HASH)))
|
|
28
|
-
return
|
|
24
|
+
return NFT_TRANSFER_PROGRAM_DEFAULT.curry(
|
|
29
25
|
singleton_struct,
|
|
30
26
|
royalty_puzzle_hash,
|
|
31
27
|
percentage,
|
|
@@ -4,20 +4,18 @@ import logging
|
|
|
4
4
|
from dataclasses import dataclass
|
|
5
5
|
from typing import Optional, TypeVar
|
|
6
6
|
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
8
|
+
from chia_rs.sized_ints import uint16
|
|
9
|
+
|
|
7
10
|
from chia.protocols.wallet_protocol import CoinState
|
|
8
11
|
from chia.types.blockchain_format.program import Program
|
|
9
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
10
12
|
from chia.types.coin_spend import CoinSpend
|
|
11
|
-
from chia.util.ints import uint16
|
|
12
13
|
from chia.util.streamable import Streamable, streamable
|
|
13
|
-
from chia.wallet.
|
|
14
|
+
from chia.wallet.nft_wallet.nft_puzzles import NFT_OWNERSHIP_LAYER
|
|
15
|
+
from chia.wallet.nft_wallet.nft_puzzles import NFT_STATE_LAYER_MOD as NFT_MOD
|
|
16
|
+
from chia.wallet.singleton import SINGLETON_TOP_LAYER_MOD
|
|
14
17
|
|
|
15
18
|
log = logging.getLogger(__name__)
|
|
16
|
-
SINGLETON_TOP_LAYER_MOD = load_clvm_maybe_recompile("singleton_top_layer_v1_1.clsp")
|
|
17
|
-
NFT_MOD = load_clvm_maybe_recompile("nft_state_layer.clsp", package_or_requirement="chia.wallet.nft_wallet.puzzles")
|
|
18
|
-
NFT_OWNERSHIP_LAYER = load_clvm_maybe_recompile(
|
|
19
|
-
"nft_ownership_layer.clsp", package_or_requirement="chia.wallet.nft_wallet.puzzles"
|
|
20
|
-
)
|
|
21
19
|
|
|
22
20
|
_T_UncurriedNFT = TypeVar("_T_UncurriedNFT", bound="UncurriedNFT")
|
|
23
21
|
|
|
@@ -4,14 +4,14 @@ import logging
|
|
|
4
4
|
from typing import Any, Optional
|
|
5
5
|
|
|
6
6
|
from chia_rs import G2Element
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
8
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
7
9
|
|
|
8
10
|
from chia.protocols.wallet_protocol import CoinState
|
|
9
11
|
from chia.types.blockchain_format.coin import Coin
|
|
10
12
|
from chia.types.blockchain_format.program import Program
|
|
11
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
12
13
|
from chia.types.coin_spend import CoinSpend, make_spend
|
|
13
14
|
from chia.util.db_wrapper import DBWrapper2
|
|
14
|
-
from chia.util.ints import uint32, uint64
|
|
15
15
|
from chia.wallet.conditions import AssertCoinAnnouncement, Condition
|
|
16
16
|
from chia.wallet.notification_store import Notification, NotificationStore
|
|
17
17
|
from chia.wallet.util.compute_memos import compute_memos_for_spend
|
|
@@ -101,13 +101,13 @@ class NotificationManager:
|
|
|
101
101
|
)
|
|
102
102
|
extra_spend_bundle = WalletSpendBundle([notification_spend], G2Element())
|
|
103
103
|
await self.wallet_state_manager.main_wallet.generate_signed_transaction(
|
|
104
|
-
amount,
|
|
105
|
-
notification_hash,
|
|
104
|
+
[amount],
|
|
105
|
+
[notification_hash],
|
|
106
106
|
action_scope,
|
|
107
107
|
fee,
|
|
108
108
|
coins=coins,
|
|
109
109
|
origin_id=origin_coin,
|
|
110
|
-
memos=[target, msg],
|
|
110
|
+
memos=[[target, msg]],
|
|
111
111
|
extra_conditions=(
|
|
112
112
|
*extra_conditions,
|
|
113
113
|
AssertCoinAnnouncement(asserted_id=notification_coin.name(), asserted_msg=b""),
|
|
@@ -5,9 +5,10 @@ import logging
|
|
|
5
5
|
import sqlite3
|
|
6
6
|
from typing import Optional
|
|
7
7
|
|
|
8
|
-
from
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
10
|
+
|
|
9
11
|
from chia.util.db_wrapper import DBWrapper2
|
|
10
|
-
from chia.util.ints import uint32, uint64
|
|
11
12
|
from chia.util.streamable import Streamable, streamable
|
|
12
13
|
|
|
13
14
|
|
chia/wallet/outer_puzzles.py
CHANGED
|
@@ -3,8 +3,9 @@ from __future__ import annotations
|
|
|
3
3
|
from enum import Enum
|
|
4
4
|
from typing import Optional
|
|
5
5
|
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
|
|
6
8
|
from chia.types.blockchain_format.program import Program
|
|
7
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
8
9
|
from chia.wallet.cat_wallet.cat_outer_puzzle import CATOuterPuzzle
|
|
9
10
|
from chia.wallet.driver_protocol import DriverProtocol
|
|
10
11
|
from chia.wallet.nft_wallet.metadata_outer_puzzle import MetadataOuterPuzzle
|
|
@@ -3,29 +3,42 @@ from __future__ import annotations
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import Any, Optional, Union
|
|
5
5
|
|
|
6
|
+
from chia_puzzles_py.programs import (
|
|
7
|
+
AUGMENTED_CONDITION as AUGMENTED_CONDITION_BYTES,
|
|
8
|
+
)
|
|
9
|
+
from chia_puzzles_py.programs import (
|
|
10
|
+
AUGMENTED_CONDITION_HASH as AUGMENTED_CONDITION_HASH_BYTES,
|
|
11
|
+
)
|
|
12
|
+
from chia_puzzles_py.programs import (
|
|
13
|
+
P2_1_OF_N as P2_1_OF_N_BYTES,
|
|
14
|
+
)
|
|
15
|
+
from chia_puzzles_py.programs import (
|
|
16
|
+
P2_PUZZLE_HASH,
|
|
17
|
+
P2_PUZZLE_HASH_HASH,
|
|
18
|
+
)
|
|
19
|
+
from chia_rs.sized_bytes import bytes32
|
|
20
|
+
from chia_rs.sized_ints import uint64
|
|
21
|
+
|
|
6
22
|
from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
|
7
23
|
from chia.types.blockchain_format.coin import Coin
|
|
8
24
|
from chia.types.blockchain_format.program import Program
|
|
9
25
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
10
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
11
26
|
from chia.types.coin_spend import CoinSpend, make_spend
|
|
12
27
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
13
28
|
from chia.util.condition_tools import conditions_for_solution
|
|
14
|
-
from chia.util.ints import uint64
|
|
15
29
|
from chia.util.streamable import VersionedBlob
|
|
16
30
|
from chia.wallet.puzzles.clawback.metadata import ClawbackMetadata
|
|
17
|
-
from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile
|
|
18
31
|
from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import MOD
|
|
19
32
|
from chia.wallet.uncurried_puzzle import UncurriedPuzzle
|
|
20
33
|
from chia.wallet.util.curry_and_treehash import calculate_hash_of_quoted_mod_hash, curry_and_treehash
|
|
21
34
|
from chia.wallet.util.merkle_tree import MerkleTree
|
|
22
35
|
from chia.wallet.util.wallet_types import RemarkDataType
|
|
23
36
|
|
|
24
|
-
P2_1_OF_N =
|
|
25
|
-
P2_CURRIED_PUZZLE_MOD =
|
|
26
|
-
P2_CURRIED_PUZZLE_MOD_HASH_QUOTED = calculate_hash_of_quoted_mod_hash(
|
|
27
|
-
AUGMENTED_CONDITION =
|
|
28
|
-
AUGMENTED_CONDITION_HASH =
|
|
37
|
+
P2_1_OF_N = Program.from_bytes(P2_1_OF_N_BYTES)
|
|
38
|
+
P2_CURRIED_PUZZLE_MOD = Program.from_bytes(P2_PUZZLE_HASH)
|
|
39
|
+
P2_CURRIED_PUZZLE_MOD_HASH_QUOTED = calculate_hash_of_quoted_mod_hash(P2_PUZZLE_HASH_HASH)
|
|
40
|
+
AUGMENTED_CONDITION = Program.from_bytes(AUGMENTED_CONDITION_BYTES)
|
|
41
|
+
AUGMENTED_CONDITION_HASH = bytes32(AUGMENTED_CONDITION_HASH_BYTES)
|
|
29
42
|
log = logging.getLogger(__name__)
|
|
30
43
|
|
|
31
44
|
|
|
@@ -3,8 +3,9 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from enum import IntEnum
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint16, uint64
|
|
8
|
+
|
|
8
9
|
from chia.util.streamable import Streamable, streamable
|
|
9
10
|
from chia.wallet.wallet_puzzle_store import WalletPuzzleStore
|
|
10
11
|
|
|
@@ -2,12 +2,13 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from typing import Any
|
|
4
4
|
|
|
5
|
+
from chia_rs.sized_bytes import bytes32
|
|
6
|
+
from chia_rs.sized_ints import uint64
|
|
7
|
+
|
|
5
8
|
from chia.types.blockchain_format.program import Program
|
|
6
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
7
9
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
8
|
-
from chia.util.ints import uint64
|
|
9
10
|
from chia.util.streamable import VersionedBlob
|
|
10
|
-
from chia.wallet.
|
|
11
|
+
from chia.wallet.conditions import CreateCoin
|
|
11
12
|
from chia.wallet.puzzles.clawback.drivers import create_merkle_puzzle
|
|
12
13
|
from chia.wallet.puzzles.clawback.metadata import ClawbackMetadata, ClawbackVersion
|
|
13
14
|
from chia.wallet.util.wallet_types import RemarkDataType
|
|
@@ -41,7 +42,7 @@ class ClawbackPuzzleDecorator:
|
|
|
41
42
|
)
|
|
42
43
|
|
|
43
44
|
def solve(
|
|
44
|
-
self, inner_puzzle: Program, primaries: list[
|
|
45
|
+
self, inner_puzzle: Program, primaries: list[CreateCoin], inner_solution: Program
|
|
45
46
|
) -> tuple[Program, Program]:
|
|
46
47
|
# Append REMARK condition [1, "CLAWBACK", TIME_LOCK, SENDER_PUZHSAH, RECIPIENT_PUZHSAH]
|
|
47
48
|
if len(primaries) == 1:
|
|
@@ -7,16 +7,6 @@
|
|
|
7
7
|
"covenant_layer": "b982796850336aabf9ab17c3f21e299f0c633444117ab5e9ebeafadf1860d9fc",
|
|
8
8
|
"create_nft_launcher_from_did": "7a32d2d9571d3436791c0ad3d7fcfdb9c43ace2b0f0ff13f98d29f0cc093f445",
|
|
9
9
|
"credential_restriction": "2fdfc1f058cfd65e7ec4e253bfeb394da163ecd0036f508df8629b0a2b8fde96",
|
|
10
|
-
"dao_cat_eve": "488f55bedaca5a599544dfd5ab341e2e5c7e6fca67d9b98a3d856f876c52f53e",
|
|
11
|
-
"dao_cat_launcher": "a01a838d18d4e031e937c79fa3f80f213fa00a3e64af6c16a1f137770cd3a567",
|
|
12
|
-
"dao_finished_state": "694c99e1fb07671771bbca3d110880693a9ecc37a6529891ec979d0f3e760eba",
|
|
13
|
-
"dao_lockup": "d6215f0916715a69fbbf2d1a679f437fde81787adeb90c666642fb9c2deff7ce",
|
|
14
|
-
"dao_proposal": "fe6d5c0373c1750598d137ce50b5b025a203655ccab4ab3329315abad49c3586",
|
|
15
|
-
"dao_proposal_timer": "1acd912fca662d1474f7a6c762280fc1430875bef518883387086c1125027526",
|
|
16
|
-
"dao_proposal_validator": "92209b0f7efb2dbaaaa3aab94dcadcafa9d008d39661763841c7d92065b3fd34",
|
|
17
|
-
"dao_spend_p2_singleton_v2": "7bc8942159e600f56a87e1d9c059c8705307ec2fb996a949503298dedfed00be",
|
|
18
|
-
"dao_treasury": "637d78acd395b6bb03211bcfc5f5f2e878cba2d62b2f53871d49a8b928411b19",
|
|
19
|
-
"dao_update_proposal": "fc032384cfece9b542c3e1ea77ba119fb1013a3d74b622302c0b670447e4343d",
|
|
20
10
|
"decompress_coin_spend_entry": "9d98ed08770d31be4bd1bde4705dab388db5e7e9c349f5a76fc3c347aa3a0b79",
|
|
21
11
|
"decompress_coin_spend_entry_with_prefix": "92aa4bc8060a8836355a1884075141b4791ce1b67ae6092bb166b2845954bc89",
|
|
22
12
|
"decompress_puzzle": "fe94c58f1117afe315e0450daca1c62460ec1a1c439cd4018d79967a5d7d1370",
|
|
@@ -12,10 +12,11 @@ the doctor ordered.
|
|
|
12
12
|
|
|
13
13
|
from __future__ import annotations
|
|
14
14
|
|
|
15
|
+
from chia_puzzles_py.programs import P2_CONDITIONS
|
|
16
|
+
|
|
15
17
|
from chia.types.blockchain_format.program import Program
|
|
16
|
-
from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile
|
|
17
18
|
|
|
18
|
-
MOD =
|
|
19
|
+
MOD = Program.from_bytes(P2_CONDITIONS)
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
def puzzle_for_conditions(conditions) -> Program:
|
|
@@ -7,10 +7,11 @@ is returned literally.
|
|
|
7
7
|
|
|
8
8
|
from __future__ import annotations
|
|
9
9
|
|
|
10
|
+
from chia_puzzles_py.programs import P2_DELEGATED_CONDITIONS
|
|
11
|
+
|
|
10
12
|
from chia.types.blockchain_format.program import Program
|
|
11
|
-
from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile
|
|
12
13
|
|
|
13
|
-
MOD =
|
|
14
|
+
MOD = Program.from_bytes(P2_DELEGATED_CONDITIONS)
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
def puzzle_for_pk(public_key: Program) -> Program:
|