chia-blockchain 2.5.2rc2__py3-none-any.whl → 2.5.3__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.3.dist-info}/METADATA +3 -2
- chia_blockchain-2.5.3.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.3.dist-info}/LICENSE +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3.dist-info}/WHEEL +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3.dist-info}/entry_points.txt +0 -0
|
@@ -3,16 +3,33 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass, replace
|
|
4
4
|
from typing import Optional, TypeVar
|
|
5
5
|
|
|
6
|
+
from chia_puzzles_py.programs import ACS_TRANSFER_PROGRAM as ACS_TRANSFER_PROGRAM_BYTES
|
|
7
|
+
from chia_puzzles_py.programs import COVENANT_LAYER as COVENANT_LAYER_BYTES
|
|
8
|
+
from chia_puzzles_py.programs import COVENANT_LAYER_HASH as COVENANT_LAYER_HASH_BYTES
|
|
9
|
+
from chia_puzzles_py.programs import EML_COVENANT_MORPHER as EML_COVENANT_MORPHER_BYTES
|
|
10
|
+
from chia_puzzles_py.programs import EML_COVENANT_MORPHER_HASH as EML_COVENANT_MORPHER_HASH_BYTES
|
|
11
|
+
from chia_puzzles_py.programs import EML_TRANSFER_PROGRAM_COVENANT_ADAPTER as EML_TP_COVENANT_ADAPTER_BYTES
|
|
12
|
+
from chia_puzzles_py.programs import EML_TRANSFER_PROGRAM_COVENANT_ADAPTER_HASH as EML_TP_COVENANT_ADAPTER_HASH_BYTES
|
|
13
|
+
from chia_puzzles_py.programs import EML_UPDATE_METADATA_WITH_DID as EML_DID_TP_BYTES
|
|
14
|
+
from chia_puzzles_py.programs import EXIGENT_METADATA_LAYER as EXIGENT_METADATA_LAYER_BYTES
|
|
15
|
+
from chia_puzzles_py.programs import EXIGENT_METADATA_LAYER_HASH as EXIGENT_METADATA_LAYER_HASH_BYTES
|
|
16
|
+
from chia_puzzles_py.programs import P2_ANNOUNCED_DELEGATED_PUZZLE as P2_ANNOUNCED_DELEGATED_PUZZLE_BYTES
|
|
17
|
+
from chia_puzzles_py.programs import P2_ANNOUNCED_DELEGATED_PUZZLE_HASH as P2_ANNOUNCED_DELEGATED_PUZZLE_HASH_BYTES
|
|
18
|
+
from chia_puzzles_py.programs import REVOCATION_LAYER as REVOCATION_LAYER_BYTES
|
|
19
|
+
from chia_puzzles_py.programs import REVOCATION_LAYER_HASH as REVOCATION_LAYER_HASH_BYTES
|
|
20
|
+
from chia_puzzles_py.programs import STANDARD_VC_REVOCATION_PUZZLE as STANDARD_VC_REVOCATION_PUZZLE_BYTES
|
|
21
|
+
from chia_puzzles_py.programs import STD_PARENT_MORPHER as STD_PARENT_MORPHER_BYTES
|
|
22
|
+
from chia_puzzles_py.programs import STD_PARENT_MORPHER_HASH as STD_PARENT_MORPHER_HASH_BYTES
|
|
23
|
+
from chia_rs.sized_bytes import bytes32
|
|
24
|
+
from chia_rs.sized_ints import uint64
|
|
25
|
+
|
|
6
26
|
from chia.types.blockchain_format.coin import Coin
|
|
7
27
|
from chia.types.blockchain_format.program import Program
|
|
8
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
9
28
|
from chia.types.coin_spend import CoinSpend, compute_additions, make_spend
|
|
10
29
|
from chia.util.hash import std_hash
|
|
11
|
-
from chia.util.ints import uint64
|
|
12
30
|
from chia.util.streamable import Streamable, streamable
|
|
13
31
|
from chia.wallet.conditions import Condition, CreatePuzzleAnnouncement
|
|
14
32
|
from chia.wallet.lineage_proof import LineageProof
|
|
15
|
-
from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile
|
|
16
33
|
from chia.wallet.puzzles.singleton_top_layer_v1_1 import (
|
|
17
34
|
SINGLETON_LAUNCHER,
|
|
18
35
|
SINGLETON_LAUNCHER_HASH,
|
|
@@ -25,67 +42,32 @@ from chia.wallet.puzzles.singleton_top_layer_v1_1 import (
|
|
|
25
42
|
from chia.wallet.uncurried_puzzle import UncurriedPuzzle, uncurry_puzzle
|
|
26
43
|
|
|
27
44
|
# Mods
|
|
28
|
-
EXTIGENT_METADATA_LAYER =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
)
|
|
38
|
-
COVENANT_LAYER: Program = load_clvm_maybe_recompile(
|
|
39
|
-
"covenant_layer.clsp", package_or_requirement="chia.wallet.vc_wallet.vc_puzzles", include_standard_libraries=True
|
|
40
|
-
)
|
|
41
|
-
STD_COVENANT_PARENT_MORPHER: Program = load_clvm_maybe_recompile(
|
|
42
|
-
"std_parent_morpher.clsp",
|
|
43
|
-
package_or_requirement="chia.wallet.vc_wallet.vc_puzzles",
|
|
44
|
-
include_standard_libraries=True,
|
|
45
|
-
)
|
|
46
|
-
EML_TP_COVENANT_ADAPTER: Program = load_clvm_maybe_recompile(
|
|
47
|
-
"eml_transfer_program_covenant_adapter.clsp",
|
|
48
|
-
package_or_requirement="chia.wallet.vc_wallet.vc_puzzles",
|
|
49
|
-
include_standard_libraries=True,
|
|
50
|
-
)
|
|
51
|
-
EML_DID_TP: Program = load_clvm_maybe_recompile(
|
|
52
|
-
"eml_update_metadata_with_DID.clsp",
|
|
53
|
-
package_or_requirement="chia.wallet.vc_wallet.vc_puzzles",
|
|
54
|
-
include_standard_libraries=True,
|
|
55
|
-
)
|
|
56
|
-
EXTIGENT_METADATA_LAYER_COVENANT_MORPHER: Program = load_clvm_maybe_recompile(
|
|
57
|
-
"eml_covenant_morpher.clsp",
|
|
58
|
-
package_or_requirement="chia.wallet.vc_wallet.vc_puzzles",
|
|
59
|
-
include_standard_libraries=True,
|
|
60
|
-
)
|
|
61
|
-
VIRAL_BACKDOOR: Program = load_clvm_maybe_recompile(
|
|
62
|
-
"viral_backdoor.clsp", package_or_requirement="chia.wallet.vc_wallet.vc_puzzles", include_standard_libraries=True
|
|
63
|
-
)
|
|
64
|
-
# (mod (METADATA conditions . solution) (if solution solution (list METADATA () ())))
|
|
65
|
-
# (a (i 7 (q . 7) (q 4 2 (q () ()))) 1)
|
|
66
|
-
ACS_TRANSFER_PROGRAM: Program = Program.to([2, [3, 7, (1, 7), [1, 4, 2, [1, None, None]]], 1])
|
|
67
|
-
|
|
45
|
+
EXTIGENT_METADATA_LAYER = Program.from_bytes(EXIGENT_METADATA_LAYER_BYTES)
|
|
46
|
+
P2_ANNOUNCED_DELEGATED_PUZZLE: Program = Program.from_bytes(P2_ANNOUNCED_DELEGATED_PUZZLE_BYTES)
|
|
47
|
+
COVENANT_LAYER: Program = Program.from_bytes(COVENANT_LAYER_BYTES)
|
|
48
|
+
STD_COVENANT_PARENT_MORPHER: Program = Program.from_bytes(STD_PARENT_MORPHER_BYTES)
|
|
49
|
+
EML_TP_COVENANT_ADAPTER: Program = Program.from_bytes(EML_TP_COVENANT_ADAPTER_BYTES)
|
|
50
|
+
EML_DID_TP: Program = Program.from_bytes(EML_DID_TP_BYTES)
|
|
51
|
+
EXTIGENT_METADATA_LAYER_COVENANT_MORPHER: Program = Program.from_bytes(EML_COVENANT_MORPHER_BYTES)
|
|
52
|
+
REVOCATION_LAYER: Program = Program.from_bytes(REVOCATION_LAYER_BYTES)
|
|
53
|
+
ACS_TRANSFER_PROGRAM: Program = Program.from_bytes(ACS_TRANSFER_PROGRAM_BYTES)
|
|
68
54
|
|
|
69
55
|
# Hashes
|
|
70
|
-
EXTIGENT_METADATA_LAYER_HASH =
|
|
71
|
-
P2_ANNOUNCED_DELEGATED_PUZZLE_HASH: bytes32 =
|
|
72
|
-
COVENANT_LAYER_HASH: bytes32 =
|
|
73
|
-
STD_COVENANT_PARENT_MORPHER_HASH: bytes32 =
|
|
74
|
-
EML_TP_COVENANT_ADAPTER_HASH: bytes32 =
|
|
75
|
-
EXTIGENT_METADATA_LAYER_COVENANT_MORPHER_HASH: bytes32 =
|
|
76
|
-
|
|
56
|
+
EXTIGENT_METADATA_LAYER_HASH = bytes32(EXIGENT_METADATA_LAYER_HASH_BYTES)
|
|
57
|
+
P2_ANNOUNCED_DELEGATED_PUZZLE_HASH: bytes32 = bytes32(P2_ANNOUNCED_DELEGATED_PUZZLE_HASH_BYTES)
|
|
58
|
+
COVENANT_LAYER_HASH: bytes32 = bytes32(COVENANT_LAYER_HASH_BYTES)
|
|
59
|
+
STD_COVENANT_PARENT_MORPHER_HASH: bytes32 = bytes32(STD_PARENT_MORPHER_HASH_BYTES)
|
|
60
|
+
EML_TP_COVENANT_ADAPTER_HASH: bytes32 = bytes32(EML_TP_COVENANT_ADAPTER_HASH_BYTES)
|
|
61
|
+
EXTIGENT_METADATA_LAYER_COVENANT_MORPHER_HASH: bytes32 = bytes32(EML_COVENANT_MORPHER_HASH_BYTES)
|
|
62
|
+
REVOCATION_LAYER_HASH: bytes32 = bytes32(REVOCATION_LAYER_HASH_BYTES)
|
|
77
63
|
|
|
78
64
|
|
|
79
65
|
# Standard brick puzzle uses the mods above
|
|
80
|
-
STANDARD_BRICK_PUZZLE: Program =
|
|
81
|
-
"standard_vc_backdoor_puzzle.clsp",
|
|
82
|
-
package_or_requirement="chia.wallet.vc_wallet.vc_puzzles",
|
|
83
|
-
include_standard_libraries=True,
|
|
84
|
-
).curry(
|
|
66
|
+
STANDARD_BRICK_PUZZLE: Program = Program.from_bytes(STANDARD_VC_REVOCATION_PUZZLE_BYTES).curry(
|
|
85
67
|
SINGLETON_MOD_HASH,
|
|
86
68
|
Program.to(SINGLETON_LAUNCHER_HASH).get_tree_hash(),
|
|
87
69
|
EXTIGENT_METADATA_LAYER_HASH,
|
|
88
|
-
|
|
70
|
+
REVOCATION_LAYER_HASH,
|
|
89
71
|
ACS_TRANSFER_PROGRAM.get_tree_hash(),
|
|
90
72
|
)
|
|
91
73
|
STANDARD_BRICK_PUZZLE_HASH: bytes32 = STANDARD_BRICK_PUZZLE.get_tree_hash()
|
|
@@ -190,22 +172,22 @@ def solve_did_tp(
|
|
|
190
172
|
##############################
|
|
191
173
|
# P2 Puzzle or Hidden Puzzle #
|
|
192
174
|
##############################
|
|
193
|
-
def
|
|
194
|
-
return
|
|
195
|
-
|
|
175
|
+
def create_revocation_layer(hidden_puzzle_hash: bytes32, inner_puzzle_hash: bytes32) -> Program:
|
|
176
|
+
return REVOCATION_LAYER.curry(
|
|
177
|
+
REVOCATION_LAYER_HASH,
|
|
196
178
|
hidden_puzzle_hash,
|
|
197
179
|
inner_puzzle_hash,
|
|
198
180
|
)
|
|
199
181
|
|
|
200
182
|
|
|
201
|
-
def
|
|
202
|
-
if uncurried_puzzle.mod ==
|
|
183
|
+
def match_revocation_layer(uncurried_puzzle: UncurriedPuzzle) -> Optional[tuple[bytes32, bytes32]]:
|
|
184
|
+
if uncurried_puzzle.mod == REVOCATION_LAYER:
|
|
203
185
|
return bytes32(uncurried_puzzle.args.at("rf").as_atom()), bytes32(uncurried_puzzle.args.at("rrf").as_atom())
|
|
204
186
|
else:
|
|
205
187
|
return None # pragma: no cover
|
|
206
188
|
|
|
207
189
|
|
|
208
|
-
def
|
|
190
|
+
def solve_revocation_layer(puzzle_reveal: Program, inner_solution: Program, hidden: bool = False) -> Program:
|
|
209
191
|
solution: Program = Program.to(
|
|
210
192
|
[
|
|
211
193
|
hidden,
|
|
@@ -371,7 +353,7 @@ class VerifiedCredential(Streamable):
|
|
|
371
353
|
inner_transfer_program,
|
|
372
354
|
)
|
|
373
355
|
)
|
|
374
|
-
wrapped_inner_puzzle_hash: bytes32 =
|
|
356
|
+
wrapped_inner_puzzle_hash: bytes32 = create_revocation_layer(
|
|
375
357
|
STANDARD_BRICK_PUZZLE_HASH,
|
|
376
358
|
new_inner_puzzle_hash,
|
|
377
359
|
).get_tree_hash()
|
|
@@ -485,7 +467,7 @@ class VerifiedCredential(Streamable):
|
|
|
485
467
|
)
|
|
486
468
|
|
|
487
469
|
def wrap_inner_with_backdoor(self) -> Program:
|
|
488
|
-
return
|
|
470
|
+
return create_revocation_layer(
|
|
489
471
|
self.hidden_puzzle().get_tree_hash(),
|
|
490
472
|
self.inner_puzzle_hash,
|
|
491
473
|
)
|
|
@@ -543,7 +525,7 @@ class VerifiedCredential(Streamable):
|
|
|
543
525
|
|
|
544
526
|
# ...and layer below EML
|
|
545
527
|
layer_below_eml: UncurriedPuzzle = uncurry_puzzle(layer_below_singleton.args.at("rrrrf"))
|
|
546
|
-
if layer_below_eml.mod !=
|
|
528
|
+
if layer_below_eml.mod != REVOCATION_LAYER:
|
|
547
529
|
return False, "VC did not have a provider backdoor" # pragma: no cover
|
|
548
530
|
hidden_puzzle_hash = bytes32(layer_below_eml.args.at("rf").as_atom())
|
|
549
531
|
if hidden_puzzle_hash != STANDARD_BRICK_PUZZLE_HASH:
|
|
@@ -616,7 +598,7 @@ class VerifiedCredential(Streamable):
|
|
|
616
598
|
parent_proof_hash: bytes32 = metadata_layer.args.at("rf").get_tree_hash()
|
|
617
599
|
eml_lineage_proof = VCLineageProof(
|
|
618
600
|
parent_name=parent_coin.parent_coin_info,
|
|
619
|
-
inner_puzzle_hash=
|
|
601
|
+
inner_puzzle_hash=create_revocation_layer(
|
|
620
602
|
STANDARD_BRICK_PUZZLE_HASH,
|
|
621
603
|
bytes32(uncurry_puzzle(metadata_layer.args.at("rrrrf")).args.at("rrf").as_atom()),
|
|
622
604
|
).get_tree_hash(),
|
|
@@ -720,7 +702,7 @@ class VerifiedCredential(Streamable):
|
|
|
720
702
|
uint64(self.coin.amount),
|
|
721
703
|
Program.to(
|
|
722
704
|
[ # solve EML
|
|
723
|
-
|
|
705
|
+
solve_revocation_layer(
|
|
724
706
|
inner_puzzle,
|
|
725
707
|
inner_solution,
|
|
726
708
|
),
|
|
@@ -773,7 +755,7 @@ class VerifiedCredential(Streamable):
|
|
|
773
755
|
uint64(self.coin.amount),
|
|
774
756
|
Program.to(
|
|
775
757
|
[ # solve EML
|
|
776
|
-
|
|
758
|
+
solve_revocation_layer(
|
|
777
759
|
self.hidden_puzzle(),
|
|
778
760
|
solve_std_vc_backdoor(
|
|
779
761
|
self.launcher_id,
|
|
@@ -5,12 +5,12 @@ from functools import cmp_to_key
|
|
|
5
5
|
from typing import Optional, TypeVar
|
|
6
6
|
|
|
7
7
|
from aiosqlite import Row
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
8
10
|
|
|
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.util.db_wrapper import DBWrapper2
|
|
13
|
-
from chia.util.ints import uint32, uint64
|
|
14
14
|
from chia.util.streamable import Streamable, streamable
|
|
15
15
|
from chia.wallet.lineage_proof import LineageProof
|
|
16
16
|
from chia.wallet.util.merkle_utils import list_to_binary_tree
|
|
@@ -6,6 +6,8 @@ import traceback
|
|
|
6
6
|
from typing import TYPE_CHECKING, Optional, TypeVar, Union
|
|
7
7
|
|
|
8
8
|
from chia_rs import G1Element, G2Element
|
|
9
|
+
from chia_rs.sized_bytes import bytes32
|
|
10
|
+
from chia_rs.sized_ints import uint32, uint64, uint128
|
|
9
11
|
from clvm.casts import int_to_bytes
|
|
10
12
|
from typing_extensions import Unpack
|
|
11
13
|
|
|
@@ -14,21 +16,19 @@ from chia.server.ws_connection import WSChiaConnection
|
|
|
14
16
|
from chia.types.blockchain_format.coin import Coin, coin_as_list
|
|
15
17
|
from chia.types.blockchain_format.program import Program
|
|
16
18
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
17
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
18
19
|
from chia.types.coin_spend import CoinSpend, make_spend
|
|
19
20
|
from chia.util.hash import std_hash
|
|
20
|
-
from chia.util.ints import uint32, uint64, uint128
|
|
21
21
|
from chia.util.streamable import Streamable
|
|
22
22
|
from chia.wallet.conditions import (
|
|
23
23
|
AssertCoinAnnouncement,
|
|
24
24
|
Condition,
|
|
25
|
+
CreateCoin,
|
|
25
26
|
CreateCoinAnnouncement,
|
|
26
27
|
CreatePuzzleAnnouncement,
|
|
27
28
|
UnknownCondition,
|
|
28
29
|
parse_timelock_info,
|
|
29
30
|
)
|
|
30
31
|
from chia.wallet.did_wallet.did_wallet import DIDWallet
|
|
31
|
-
from chia.wallet.payment import Payment
|
|
32
32
|
from chia.wallet.puzzle_drivers import Solver
|
|
33
33
|
from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import solution_for_delegated_puzzle
|
|
34
34
|
from chia.wallet.trading.offer import Offer
|
|
@@ -234,18 +234,21 @@ class VCWallet:
|
|
|
234
234
|
|
|
235
235
|
async def generate_signed_transaction(
|
|
236
236
|
self,
|
|
237
|
-
|
|
237
|
+
amounts: list[uint64],
|
|
238
|
+
puzzle_hashes: list[bytes32],
|
|
238
239
|
action_scope: WalletActionScope,
|
|
239
240
|
fee: uint64 = uint64(0),
|
|
240
|
-
|
|
241
|
+
coins: Optional[set[Coin]] = None,
|
|
242
|
+
memos: Optional[list[list[bytes]]] = None,
|
|
241
243
|
extra_conditions: tuple[Condition, ...] = tuple(),
|
|
242
244
|
**kwargs: Unpack[GSTOptionalArgs],
|
|
243
245
|
) -> None:
|
|
244
246
|
new_proof_hash: Optional[bytes32] = kwargs.get(
|
|
245
247
|
"new_proof_hash", None
|
|
246
|
-
) # Requires that this key
|
|
248
|
+
) # Requires that this key possesses the DID to update the specified VC
|
|
247
249
|
provider_inner_puzhash: Optional[bytes32] = kwargs.get("provider_inner_puzhash", None)
|
|
248
250
|
self_revoke: Optional[bool] = kwargs.get("self_revoke", False)
|
|
251
|
+
potential_vc_id: Optional[bytes32] = kwargs.get("vc_id", None)
|
|
249
252
|
"""
|
|
250
253
|
Entry point for two standard actions:
|
|
251
254
|
- Cycle the singleton and make an announcement authorizing something
|
|
@@ -254,18 +257,39 @@ class VCWallet:
|
|
|
254
257
|
Returns a 1 - 3 TransactionRecord objects depending on whether or not there's a fee and whether or not there's
|
|
255
258
|
a DID announcement involved.
|
|
256
259
|
"""
|
|
260
|
+
if len(amounts) > 1 or amounts[0] != 1:
|
|
261
|
+
raise ValueError("VCWallet.generate_signed_transaction only accepts `amounts=[uint64(1)]`")
|
|
262
|
+
if len(puzzle_hashes) != 1:
|
|
263
|
+
raise ValueError("Can only send a single VC to a single new puzzle hash")
|
|
264
|
+
if memos is not None:
|
|
265
|
+
raise ValueError("Memos not currently supported for VC wallets")
|
|
266
|
+
if coins is not None and len(list(coins)) != 1:
|
|
267
|
+
raise ValueError("Can only spend a single VC at a time")
|
|
257
268
|
# Find verified credential
|
|
258
|
-
|
|
269
|
+
if coins is not None:
|
|
270
|
+
coin_id = next(iter(coins)).name()
|
|
271
|
+
potential_vc_record = await self.store.get_vc_record_by_coin_id(coin_id)
|
|
272
|
+
if potential_vc_record is None:
|
|
273
|
+
raise ValueError(f"Could not find a VC record for coin ID: {coin_id}")
|
|
274
|
+
vc_record: VCRecord = potential_vc_record
|
|
275
|
+
lookup_info = ("coin ID", coin_id)
|
|
276
|
+
elif potential_vc_id is not None:
|
|
277
|
+
vc_record = await self.get_vc_record_for_launcher_id(potential_vc_id)
|
|
278
|
+
lookup_info = ("launcher ID", potential_vc_id)
|
|
279
|
+
else:
|
|
280
|
+
raise ValueError("Must specify either a vc_id or a specific VC coin")
|
|
281
|
+
|
|
259
282
|
if vc_record.confirmed_at_height == 0:
|
|
260
283
|
raise ValueError(
|
|
261
|
-
f"Verified credential {
|
|
284
|
+
f"Verified credential with {lookup_info[0]} {lookup_info[1].hex()}"
|
|
285
|
+
"is not confirmed, please try again later."
|
|
262
286
|
) # pragma: no cover
|
|
263
287
|
inner_puzhash: bytes32 = vc_record.vc.inner_puzzle_hash
|
|
264
288
|
inner_puzzle: Program = await self.standard_wallet.puzzle_for_puzzle_hash(inner_puzhash)
|
|
265
|
-
if new_inner_puzhash is None:
|
|
266
|
-
new_inner_puzhash = inner_puzhash
|
|
267
289
|
|
|
268
|
-
primaries: list[
|
|
290
|
+
primaries: list[CreateCoin] = [
|
|
291
|
+
CreateCoin(puzzle_hashes[0], uint64(vc_record.vc.coin.amount), [puzzle_hashes[0]])
|
|
292
|
+
]
|
|
269
293
|
|
|
270
294
|
if fee > 0:
|
|
271
295
|
coin_name = vc_record.vc.coin.name()
|
|
@@ -309,7 +333,7 @@ class VCWallet:
|
|
|
309
333
|
if wallet.type() == WalletType.DECENTRALIZED_ID:
|
|
310
334
|
assert isinstance(wallet, DIDWallet)
|
|
311
335
|
if bytes32.fromhex(wallet.get_my_DID()) == vc_record.vc.proof_provider:
|
|
312
|
-
self.log.debug("Creating announcement from DID for vc: %s",
|
|
336
|
+
self.log.debug("Creating announcement from DID for vc: %s", vc_record.vc.launcher_id.hex())
|
|
313
337
|
await wallet.create_message_spend(action_scope, extra_conditions=(did_announcement,))
|
|
314
338
|
break
|
|
315
339
|
else:
|
|
@@ -325,7 +349,7 @@ class VCWallet:
|
|
|
325
349
|
TransactionRecord(
|
|
326
350
|
confirmed_at_height=uint32(0),
|
|
327
351
|
created_at_time=now,
|
|
328
|
-
to_puzzle_hash=
|
|
352
|
+
to_puzzle_hash=puzzle_hashes[0],
|
|
329
353
|
amount=uint64(1),
|
|
330
354
|
fee_amount=uint64(fee),
|
|
331
355
|
confirmed=False,
|
|
@@ -370,9 +394,11 @@ class VCWallet:
|
|
|
370
394
|
break
|
|
371
395
|
else:
|
|
372
396
|
await self.generate_signed_transaction(
|
|
373
|
-
|
|
397
|
+
[uint64(1)],
|
|
398
|
+
[await self.standard_wallet.get_puzzle_hash(new=not action_scope.config.tx_config.reuse_puzhash)],
|
|
374
399
|
action_scope,
|
|
375
400
|
fee,
|
|
401
|
+
vc_id=vc.launcher_id,
|
|
376
402
|
self_revoke=True,
|
|
377
403
|
)
|
|
378
404
|
return
|
|
@@ -537,8 +563,14 @@ class VCWallet:
|
|
|
537
563
|
) as inner_action_scope:
|
|
538
564
|
for launcher_id, vc in vcs.items():
|
|
539
565
|
await self.generate_signed_transaction(
|
|
540
|
-
|
|
566
|
+
[uint64(1)],
|
|
567
|
+
[
|
|
568
|
+
await self.standard_wallet.get_puzzle_hash(
|
|
569
|
+
new=not inner_action_scope.config.tx_config.reuse_puzhash
|
|
570
|
+
)
|
|
571
|
+
],
|
|
541
572
|
inner_action_scope,
|
|
573
|
+
vc_id=launcher_id,
|
|
542
574
|
extra_conditions=(
|
|
543
575
|
*announcements_to_assert[launcher_id],
|
|
544
576
|
*announcements_to_make[launcher_id],
|
chia/wallet/wallet.py
CHANGED
|
@@ -5,19 +5,25 @@ import time
|
|
|
5
5
|
from typing import TYPE_CHECKING, Any, ClassVar, Optional, cast
|
|
6
6
|
|
|
7
7
|
from chia_rs import AugSchemeMPL, G1Element, G2Element, PrivateKey
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import uint32, uint64, uint128
|
|
8
10
|
from typing_extensions import Unpack
|
|
9
11
|
|
|
10
12
|
from chia.types.blockchain_format.coin import Coin
|
|
11
13
|
from chia.types.blockchain_format.program import Program
|
|
12
14
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
13
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
14
15
|
from chia.types.coin_spend import CoinSpend, make_spend
|
|
15
16
|
from chia.types.signing_mode import CHIP_0002_SIGN_MESSAGE_PREFIX, SigningMode
|
|
16
17
|
from chia.util.hash import std_hash
|
|
17
|
-
from chia.util.ints import uint32, uint64, uint128
|
|
18
18
|
from chia.util.streamable import Streamable
|
|
19
19
|
from chia.wallet.coin_selection import select_coins
|
|
20
|
-
from chia.wallet.conditions import
|
|
20
|
+
from chia.wallet.conditions import (
|
|
21
|
+
AssertCoinAnnouncement,
|
|
22
|
+
Condition,
|
|
23
|
+
CreateCoin,
|
|
24
|
+
CreateCoinAnnouncement,
|
|
25
|
+
parse_timelock_info,
|
|
26
|
+
)
|
|
21
27
|
from chia.wallet.derivation_record import DerivationRecord
|
|
22
28
|
from chia.wallet.derive_keys import (
|
|
23
29
|
MAX_POOL_WALLETS,
|
|
@@ -25,7 +31,6 @@ from chia.wallet.derive_keys import (
|
|
|
25
31
|
_derive_path_unhardened,
|
|
26
32
|
master_sk_to_singleton_owner_sk,
|
|
27
33
|
)
|
|
28
|
-
from chia.wallet.payment import Payment
|
|
29
34
|
from chia.wallet.puzzles.clawback.metadata import ClawbackMetadata
|
|
30
35
|
from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import (
|
|
31
36
|
DEFAULT_HIDDEN_PUZZLE_HASH,
|
|
@@ -36,7 +41,7 @@ from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import (
|
|
|
36
41
|
puzzle_hash_for_synthetic_public_key,
|
|
37
42
|
solution_for_conditions,
|
|
38
43
|
)
|
|
39
|
-
from chia.wallet.puzzles.puzzle_utils import
|
|
44
|
+
from chia.wallet.puzzles.puzzle_utils import make_reserve_fee_condition
|
|
40
45
|
from chia.wallet.signer_protocol import (
|
|
41
46
|
PathHint,
|
|
42
47
|
Signature,
|
|
@@ -206,7 +211,7 @@ class Wallet:
|
|
|
206
211
|
|
|
207
212
|
def make_solution(
|
|
208
213
|
self,
|
|
209
|
-
primaries: list[
|
|
214
|
+
primaries: list[CreateCoin],
|
|
210
215
|
conditions: tuple[Condition, ...] = tuple(),
|
|
211
216
|
fee: uint64 = uint64(0),
|
|
212
217
|
) -> Program:
|
|
@@ -214,7 +219,7 @@ class Wallet:
|
|
|
214
219
|
condition_list: list[Any] = [condition.to_program() for condition in conditions]
|
|
215
220
|
if len(primaries) > 0:
|
|
216
221
|
for primary in primaries:
|
|
217
|
-
condition_list.append(
|
|
222
|
+
condition_list.append(primary.to_program())
|
|
218
223
|
if fee:
|
|
219
224
|
condition_list.append(make_reserve_fee_condition(fee))
|
|
220
225
|
|
|
@@ -257,14 +262,13 @@ class Wallet:
|
|
|
257
262
|
|
|
258
263
|
async def _generate_unsigned_transaction(
|
|
259
264
|
self,
|
|
260
|
-
|
|
261
|
-
|
|
265
|
+
amounts: list[uint64],
|
|
266
|
+
newpuzzlehashes: list[bytes32],
|
|
262
267
|
action_scope: WalletActionScope,
|
|
263
268
|
fee: uint64 = uint64(0),
|
|
264
269
|
origin_id: Optional[bytes32] = None,
|
|
265
270
|
coins: Optional[set[Coin]] = None,
|
|
266
|
-
|
|
267
|
-
memos: Optional[list[bytes]] = None,
|
|
271
|
+
memos: Optional[list[list[bytes]]] = None,
|
|
268
272
|
negative_change_allowed: bool = False,
|
|
269
273
|
puzzle_decorator_override: Optional[list[dict[str, Any]]] = None,
|
|
270
274
|
extra_conditions: tuple[Condition, ...] = tuple(),
|
|
@@ -277,11 +281,7 @@ class Wallet:
|
|
|
277
281
|
if puzzle_decorator_override is not None:
|
|
278
282
|
decorator_manager = PuzzleDecoratorManager.create(puzzle_decorator_override)
|
|
279
283
|
|
|
280
|
-
|
|
281
|
-
if primaries_input is not None:
|
|
282
|
-
primaries.extend(primaries_input)
|
|
283
|
-
|
|
284
|
-
total_amount = amount + sum(primary.amount for primary in primaries) + fee
|
|
284
|
+
total_amount = sum(amounts) + fee
|
|
285
285
|
total_balance = await self.get_spendable_balance()
|
|
286
286
|
if coins is None:
|
|
287
287
|
if total_amount > total_balance:
|
|
@@ -307,7 +307,7 @@ class Wallet:
|
|
|
307
307
|
primary_announcement: Optional[AssertCoinAnnouncement] = None
|
|
308
308
|
|
|
309
309
|
# Check for duplicates
|
|
310
|
-
all_primaries_list =
|
|
310
|
+
all_primaries_list = list(zip(amounts, newpuzzlehashes))
|
|
311
311
|
if len(set(all_primaries_list)) != len(all_primaries_list):
|
|
312
312
|
raise ValueError("Cannot create two identical coins")
|
|
313
313
|
for coin in coins:
|
|
@@ -315,16 +315,27 @@ class Wallet:
|
|
|
315
315
|
if origin_id in {None, coin.name()}:
|
|
316
316
|
origin_id = coin.name()
|
|
317
317
|
inner_puzzle = await self.puzzle_for_puzzle_hash(coin.puzzle_hash)
|
|
318
|
-
|
|
319
|
-
inner_puzzle, newpuzzlehash
|
|
320
|
-
|
|
321
|
-
|
|
318
|
+
decorated_target_puzzle_hashes = [
|
|
319
|
+
decorator_manager.decorate_target_puzzle_hash(inner_puzzle, newpuzzlehash)
|
|
320
|
+
for newpuzzlehash in newpuzzlehashes
|
|
321
|
+
]
|
|
322
322
|
if memos is None:
|
|
323
|
-
memos = []
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
323
|
+
memos = [[]] * len(amounts)
|
|
324
|
+
decorated_memos = [
|
|
325
|
+
decorator_manager.decorate_memos(inner_puzzle, newpuzzlehash, mems)
|
|
326
|
+
for newpuzzlehash, mems in zip(newpuzzlehashes, memos)
|
|
327
|
+
]
|
|
328
|
+
|
|
329
|
+
primaries = [
|
|
330
|
+
CreateCoin(decorated_target_puzzle_hash, amount, mems)
|
|
331
|
+
for decorated_target_puzzle_hash, amount, mems in zip(
|
|
332
|
+
decorated_target_puzzle_hashes, amounts, decorated_memos
|
|
333
|
+
)
|
|
334
|
+
]
|
|
335
|
+
target_primaries = [
|
|
336
|
+
CreateCoin(newpuzzlehash, amount, mems)
|
|
337
|
+
for newpuzzlehash, amount, mems in zip(newpuzzlehashes, amounts, decorated_memos)
|
|
338
|
+
]
|
|
328
339
|
|
|
329
340
|
if change > 0:
|
|
330
341
|
if action_scope.config.tx_config.reuse_puzhash:
|
|
@@ -336,7 +347,7 @@ class Wallet:
|
|
|
336
347
|
break
|
|
337
348
|
else:
|
|
338
349
|
change_puzzle_hash = await self.get_new_puzzlehash()
|
|
339
|
-
primaries.append(
|
|
350
|
+
primaries.append(CreateCoin(change_puzzle_hash, uint64(change)))
|
|
340
351
|
message_list: list[bytes32] = [c.name() for c in coins]
|
|
341
352
|
for primary in primaries:
|
|
342
353
|
message_list.append(Coin(coin.name(), primary.puzzle_hash, primary.amount).name())
|
|
@@ -347,7 +358,7 @@ class Wallet:
|
|
|
347
358
|
fee=fee,
|
|
348
359
|
conditions=(*extra_conditions, CreateCoinAnnouncement(message)),
|
|
349
360
|
)
|
|
350
|
-
solution = decorator_manager.solve(inner_puzzle,
|
|
361
|
+
solution = decorator_manager.solve(inner_puzzle, target_primaries, solution)
|
|
351
362
|
primary_announcement = AssertCoinAnnouncement(asserted_id=coin.name(), asserted_msg=message)
|
|
352
363
|
|
|
353
364
|
spends.append(
|
|
@@ -393,38 +404,33 @@ class Wallet:
|
|
|
393
404
|
|
|
394
405
|
async def generate_signed_transaction(
|
|
395
406
|
self,
|
|
396
|
-
|
|
397
|
-
|
|
407
|
+
amounts: list[uint64],
|
|
408
|
+
puzzle_hashes: list[bytes32],
|
|
398
409
|
action_scope: WalletActionScope,
|
|
399
410
|
fee: uint64 = uint64(0),
|
|
400
411
|
coins: Optional[set[Coin]] = None,
|
|
401
|
-
|
|
402
|
-
memos: Optional[list[bytes]] = None,
|
|
403
|
-
puzzle_decorator_override: Optional[list[dict[str, Any]]] = None,
|
|
412
|
+
memos: Optional[list[list[bytes]]] = None,
|
|
404
413
|
extra_conditions: tuple[Condition, ...] = tuple(),
|
|
405
414
|
**kwargs: Unpack[GSTOptionalArgs],
|
|
406
415
|
) -> None:
|
|
407
416
|
origin_id: Optional[bytes32] = kwargs.get("origin_id", None)
|
|
408
417
|
negative_change_allowed: bool = kwargs.get("negative_change_allowed", False)
|
|
418
|
+
puzzle_decorator_override: Optional[list[dict[str, Any]]] = kwargs.get("puzzle_decorator_override", None)
|
|
409
419
|
"""
|
|
410
420
|
Use this to generate transaction.
|
|
411
421
|
Note: this must be called under a wallet state manager lock
|
|
412
422
|
The first output is (amount, puzzle_hash, memos), and the rest of the outputs are in primaries.
|
|
413
423
|
"""
|
|
414
|
-
|
|
415
|
-
non_change_amount = amount
|
|
416
|
-
else:
|
|
417
|
-
non_change_amount = uint64(amount + sum(p.amount for p in primaries))
|
|
424
|
+
non_change_amount = uint64(sum(amounts))
|
|
418
425
|
|
|
419
|
-
self.log.debug("Generating transaction for: %s %s %s",
|
|
426
|
+
self.log.debug("Generating transaction for: %s %s %s", puzzle_hashes, amounts, repr(coins))
|
|
420
427
|
transaction = await self._generate_unsigned_transaction(
|
|
421
|
-
|
|
422
|
-
|
|
428
|
+
amounts,
|
|
429
|
+
puzzle_hashes,
|
|
423
430
|
action_scope,
|
|
424
431
|
fee,
|
|
425
432
|
origin_id,
|
|
426
433
|
coins,
|
|
427
|
-
primaries,
|
|
428
434
|
memos,
|
|
429
435
|
negative_change_allowed,
|
|
430
436
|
puzzle_decorator_override=puzzle_decorator_override,
|
|
@@ -449,7 +455,7 @@ class Wallet:
|
|
|
449
455
|
TransactionRecord(
|
|
450
456
|
confirmed_at_height=uint32(0),
|
|
451
457
|
created_at_time=now,
|
|
452
|
-
to_puzzle_hash=puzzle_hash,
|
|
458
|
+
to_puzzle_hash=add_list[0].puzzle_hash if len(add_list) > 0 else bytes32.zeros,
|
|
453
459
|
amount=uint64(non_change_amount),
|
|
454
460
|
fee_amount=uint64(fee),
|
|
455
461
|
confirmed=False,
|
|
@@ -475,8 +481,8 @@ class Wallet:
|
|
|
475
481
|
) -> None:
|
|
476
482
|
chia_coins = await self.select_coins(fee, action_scope)
|
|
477
483
|
await self.generate_signed_transaction(
|
|
478
|
-
|
|
479
|
-
|
|
484
|
+
[],
|
|
485
|
+
[],
|
|
480
486
|
action_scope,
|
|
481
487
|
fee=fee,
|
|
482
488
|
coins=chia_coins,
|
|
@@ -601,8 +607,7 @@ class Wallet:
|
|
|
601
607
|
if fingerprint_as_int not in pk_lookup:
|
|
602
608
|
if not partial_allowed:
|
|
603
609
|
raise ValueError(
|
|
604
|
-
"No pubkey found (or path hinted to) for "
|
|
605
|
-
f"fingerprint {int.from_bytes(fingerprint, 'big')}"
|
|
610
|
+
f"No pubkey found (or path hinted to) for fingerprint {int.from_bytes(fingerprint, 'big')}"
|
|
606
611
|
)
|
|
607
612
|
else:
|
|
608
613
|
aggregate_responses_at_end = False
|
|
@@ -5,6 +5,7 @@ from collections.abc import AsyncIterator
|
|
|
5
5
|
from dataclasses import dataclass, field, replace
|
|
6
6
|
from typing import TYPE_CHECKING, Optional, cast, final
|
|
7
7
|
|
|
8
|
+
from chia.data_layer.singleton_record import SingletonRecord
|
|
8
9
|
from chia.types.blockchain_format.coin import Coin
|
|
9
10
|
from chia.util.action_scope import ActionScope
|
|
10
11
|
from chia.util.streamable import Streamable, streamable
|
|
@@ -25,6 +26,7 @@ class _StreamableWalletSideEffects(Streamable):
|
|
|
25
26
|
signing_responses: list[SigningResponse]
|
|
26
27
|
extra_spends: list[WalletSpendBundle]
|
|
27
28
|
selected_coins: list[Coin]
|
|
29
|
+
singleton_records: list[SingletonRecord]
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
@dataclass
|
|
@@ -33,6 +35,7 @@ class WalletSideEffects:
|
|
|
33
35
|
signing_responses: list[SigningResponse] = field(default_factory=list)
|
|
34
36
|
extra_spends: list[WalletSpendBundle] = field(default_factory=list)
|
|
35
37
|
selected_coins: list[Coin] = field(default_factory=list)
|
|
38
|
+
singleton_records: list[SingletonRecord] = field(default_factory=list)
|
|
36
39
|
|
|
37
40
|
def __bytes__(self) -> bytes:
|
|
38
41
|
return bytes(_StreamableWalletSideEffects(**self.__dict__))
|
|
@@ -93,4 +96,5 @@ async def new_wallet_action_scope(
|
|
|
93
96
|
sign=sign,
|
|
94
97
|
additional_signing_responses=self.side_effects.signing_responses,
|
|
95
98
|
extra_spends=self.side_effects.extra_spends,
|
|
99
|
+
singleton_records=self.side_effects.singleton_records,
|
|
96
100
|
)
|