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
chia/wallet/wallet_blockchain.py
CHANGED
|
@@ -3,18 +3,19 @@ from __future__ import annotations
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import TYPE_CHECKING, ClassVar, Optional, cast
|
|
5
5
|
|
|
6
|
+
from chia_rs import ConsensusConstants
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
8
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
9
|
+
|
|
6
10
|
from chia.consensus.block_header_validation import validate_finished_header_block
|
|
7
11
|
from chia.consensus.block_record import BlockRecord
|
|
8
12
|
from chia.consensus.blockchain import AddBlockResult
|
|
9
|
-
from chia.consensus.constants import ConsensusConstants
|
|
10
13
|
from chia.consensus.find_fork_point import find_fork_point_in_chain
|
|
11
14
|
from chia.consensus.full_block_to_block_record import block_to_block_record
|
|
12
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
13
15
|
from chia.types.header_block import HeaderBlock
|
|
14
16
|
from chia.types.validation_state import ValidationState
|
|
15
17
|
from chia.types.weight_proof import WeightProof
|
|
16
18
|
from chia.util.errors import Err
|
|
17
|
-
from chia.util.ints import uint32, uint64
|
|
18
19
|
from chia.wallet.key_val_store import KeyValStore
|
|
19
20
|
from chia.wallet.wallet_weight_proof_handler import WalletWeightProofHandler
|
|
20
21
|
|
|
@@ -173,9 +174,9 @@ class WalletBlockchain:
|
|
|
173
174
|
if self._peak is not None:
|
|
174
175
|
return self._peak
|
|
175
176
|
header_block = await self._basic_store.get_object("PEAK_BLOCK", HeaderBlock)
|
|
176
|
-
assert header_block is None or isinstance(
|
|
177
|
-
|
|
178
|
-
)
|
|
177
|
+
assert header_block is None or isinstance(header_block, HeaderBlock), (
|
|
178
|
+
f"get_peak_block expected Optional[HeaderBlock], got {type(header_block)}"
|
|
179
|
+
)
|
|
179
180
|
return header_block
|
|
180
181
|
|
|
181
182
|
async def set_finished_sync_up_to(self, height: int, *, in_rollback: bool = False) -> None:
|
|
@@ -192,7 +193,11 @@ class WalletBlockchain:
|
|
|
192
193
|
def get_latest_timestamp(self) -> uint64:
|
|
193
194
|
return self._latest_timestamp
|
|
194
195
|
|
|
195
|
-
def contains_block(self, header_hash: bytes32) -> bool:
|
|
196
|
+
def contains_block(self, header_hash: bytes32, height: Optional[uint32] = None) -> bool:
|
|
197
|
+
"""
|
|
198
|
+
True if we have already added this block to the chain. This may return false for orphan blocks
|
|
199
|
+
that we have added but no longer keep in memory.
|
|
200
|
+
"""
|
|
196
201
|
return header_hash in self._block_records
|
|
197
202
|
|
|
198
203
|
def contains_height(self, height: uint32) -> bool:
|
|
@@ -3,10 +3,11 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
4
|
from typing import Any, Optional, Union
|
|
5
5
|
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint8, uint32, uint64
|
|
8
|
+
|
|
6
9
|
from chia.types.blockchain_format.coin import Coin
|
|
7
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
8
10
|
from chia.types.coin_record import CoinRecord
|
|
9
|
-
from chia.util.ints import uint8, uint32, uint64
|
|
10
11
|
from chia.util.streamable import VersionedBlob
|
|
11
12
|
from chia.wallet.puzzles.clawback.metadata import ClawbackMetadata, ClawbackVersion
|
|
12
13
|
from chia.wallet.util.wallet_types import CoinType, StreamableWalletIdentifier, WalletType
|
chia/wallet/wallet_coin_store.py
CHANGED
|
@@ -5,11 +5,12 @@ from dataclasses import dataclass
|
|
|
5
5
|
from enum import IntEnum
|
|
6
6
|
from typing import Optional
|
|
7
7
|
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import uint8, uint32, uint64
|
|
10
|
+
|
|
8
11
|
from chia.types.blockchain_format.coin import Coin
|
|
9
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
10
12
|
from chia.util.db_wrapper import DBWrapper2, execute_fetchone
|
|
11
13
|
from chia.util.hash import std_hash
|
|
12
|
-
from chia.util.ints import uint8, uint32, uint64
|
|
13
14
|
from chia.util.lru_cache import LRUCache
|
|
14
15
|
from chia.util.streamable import Streamable, UInt32Range, UInt64Range, VersionedBlob, streamable
|
|
15
16
|
from chia.wallet.util.query_filter import AmountFilter, FilterMode, HashFilter
|
chia/wallet/wallet_info.py
CHANGED
|
@@ -2,10 +2,11 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from typing import Optional
|
|
4
4
|
|
|
5
|
+
from chia_rs.sized_bytes import bytes32
|
|
6
|
+
from chia_rs.sized_ints import uint32
|
|
7
|
+
|
|
5
8
|
from chia.protocols.wallet_protocol import CoinState
|
|
6
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
7
9
|
from chia.util.db_wrapper import DBWrapper2
|
|
8
|
-
from chia.util.ints import uint32
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class WalletInterestedStore:
|
chia/wallet/wallet_nft_store.py
CHANGED
|
@@ -5,11 +5,12 @@ import logging
|
|
|
5
5
|
from sqlite3 import Row
|
|
6
6
|
from typing import Optional, TypeVar, Union
|
|
7
7
|
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import uint32
|
|
10
|
+
|
|
8
11
|
from chia.types.blockchain_format.coin import Coin
|
|
9
12
|
from chia.types.blockchain_format.program import Program
|
|
10
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
11
13
|
from chia.util.db_wrapper import DBWrapper2, execute_fetchone
|
|
12
|
-
from chia.util.ints import uint32
|
|
13
14
|
from chia.wallet.lineage_proof import LineageProof
|
|
14
15
|
from chia.wallet.nft_wallet.nft_info import DEFAULT_STATUS, IN_TRANSACTION_STATUS, NFTCoinInfo
|
|
15
16
|
|
|
@@ -218,8 +219,7 @@ class WalletNftStore:
|
|
|
218
219
|
async with self.db_wrapper.reader_no_transaction() as conn:
|
|
219
220
|
rows = await execute_fetchone(
|
|
220
221
|
conn,
|
|
221
|
-
"SELECT EXISTS(SELECT nft_id"
|
|
222
|
-
" from users_nfts WHERE removed_height is NULL and nft_coin_id=? LIMIT 1)",
|
|
222
|
+
"SELECT EXISTS(SELECT nft_id from users_nfts WHERE removed_height is NULL and nft_coin_id=? LIMIT 1)",
|
|
223
223
|
(coin_id.hex(),),
|
|
224
224
|
)
|
|
225
225
|
return True if rows and rows[0] == 1 else False
|
chia/wallet/wallet_node.py
CHANGED
|
@@ -14,11 +14,12 @@ from pathlib import Path
|
|
|
14
14
|
from typing import TYPE_CHECKING, Any, ClassVar, Literal, Optional, Union, cast, overload
|
|
15
15
|
|
|
16
16
|
import aiosqlite
|
|
17
|
-
from chia_rs import AugSchemeMPL, G1Element, G2Element, PrivateKey
|
|
17
|
+
from chia_rs import AugSchemeMPL, ConsensusConstants, G1Element, G2Element, PrivateKey
|
|
18
|
+
from chia_rs.sized_bytes import bytes32
|
|
19
|
+
from chia_rs.sized_ints import uint16, uint32, uint64, uint128
|
|
18
20
|
from packaging.version import Version
|
|
19
21
|
|
|
20
22
|
from chia.consensus.blockchain import AddBlockResult
|
|
21
|
-
from chia.consensus.constants import ConsensusConstants
|
|
22
23
|
from chia.daemon.keychain_proxy import KeychainProxy, connect_to_keychain_and_validate, wrap_local_keychain
|
|
23
24
|
from chia.full_node.full_node_api import FullNodeAPI
|
|
24
25
|
from chia.protocols.full_node_protocol import RequestProofOfWeight, RespondProofOfWeight
|
|
@@ -41,7 +42,6 @@ from chia.server.outbound_message import Message, NodeType, make_msg
|
|
|
41
42
|
from chia.server.server import ChiaServer
|
|
42
43
|
from chia.server.ws_connection import WSChiaConnection
|
|
43
44
|
from chia.types.blockchain_format.coin import Coin
|
|
44
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
45
45
|
from chia.types.header_block import HeaderBlock
|
|
46
46
|
from chia.types.mempool_inclusion_status import MempoolInclusionStatus
|
|
47
47
|
from chia.types.weight_proof import WeightProof
|
|
@@ -50,7 +50,6 @@ from chia.util.config import lock_and_load_config, process_config_start_method,
|
|
|
50
50
|
from chia.util.db_wrapper import manage_connection
|
|
51
51
|
from chia.util.errors import KeychainIsEmpty, KeychainIsLocked, KeychainKeyNotFound, KeychainProxyConnectionFailure
|
|
52
52
|
from chia.util.hash import std_hash
|
|
53
|
-
from chia.util.ints import uint16, uint32, uint64, uint128
|
|
54
53
|
from chia.util.keychain import Keychain
|
|
55
54
|
from chia.util.path import path_from_root
|
|
56
55
|
from chia.util.profiler import mem_profile_task, profile_task
|
chia/wallet/wallet_pool_store.py
CHANGED
|
@@ -2,9 +2,10 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
4
|
|
|
5
|
+
from chia_rs.sized_ints import uint32
|
|
6
|
+
|
|
5
7
|
from chia.types.coin_spend import CoinSpend
|
|
6
8
|
from chia.util.db_wrapper import DBWrapper2
|
|
7
|
-
from chia.util.ints import uint32
|
|
8
9
|
|
|
9
10
|
log = logging.getLogger(__name__)
|
|
10
11
|
|
|
@@ -59,9 +60,7 @@ class WalletPoolStore:
|
|
|
59
60
|
else:
|
|
60
61
|
existing = list(
|
|
61
62
|
await conn.execute_fetchall(
|
|
62
|
-
"SELECT COUNT(*) "
|
|
63
|
-
"FROM pool_state_transitions "
|
|
64
|
-
"WHERE wallet_id=? AND height=? AND coin_spend=?",
|
|
63
|
+
"SELECT COUNT(*) FROM pool_state_transitions WHERE wallet_id=? AND height=? AND coin_spend=?",
|
|
65
64
|
(wallet_id, height, serialized_spend),
|
|
66
65
|
)
|
|
67
66
|
)
|
chia/wallet/wallet_protocol.py
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typing import TYPE_CHECKING, Optional, TypeVar
|
|
3
|
+
from typing import TYPE_CHECKING, Any, Optional, TypeVar
|
|
4
4
|
|
|
5
5
|
from chia_rs import G1Element
|
|
6
|
-
from
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint32, uint64, uint128
|
|
8
|
+
from typing_extensions import NotRequired, Protocol, TypedDict, Unpack
|
|
7
9
|
|
|
8
10
|
from chia.server.ws_connection import WSChiaConnection
|
|
9
11
|
from chia.types.blockchain_format.coin import Coin
|
|
10
12
|
from chia.types.blockchain_format.program import Program
|
|
11
|
-
from chia.
|
|
12
|
-
from chia.util.ints import uint32, uint64, uint128
|
|
13
|
+
from chia.wallet.conditions import Condition
|
|
13
14
|
from chia.wallet.nft_wallet.nft_info import NFTCoinInfo
|
|
14
15
|
from chia.wallet.util.wallet_types import WalletType
|
|
15
16
|
from chia.wallet.wallet_action_scope import WalletActionScope
|
|
@@ -59,6 +60,18 @@ class WalletProtocol(Protocol[T_contra]):
|
|
|
59
60
|
|
|
60
61
|
async def match_hinted_coin(self, coin: Coin, hint: bytes32) -> bool: ...
|
|
61
62
|
|
|
63
|
+
async def generate_signed_transaction(
|
|
64
|
+
self,
|
|
65
|
+
amounts: list[uint64],
|
|
66
|
+
puzzle_hashes: list[bytes32],
|
|
67
|
+
action_scope: WalletActionScope,
|
|
68
|
+
fee: uint64 = uint64(0),
|
|
69
|
+
coins: Optional[set[Coin]] = None,
|
|
70
|
+
memos: Optional[list[list[bytes]]] = None,
|
|
71
|
+
extra_conditions: tuple[Condition, ...] = tuple(),
|
|
72
|
+
**kwargs: Unpack[GSTOptionalArgs],
|
|
73
|
+
) -> None: ...
|
|
74
|
+
|
|
62
75
|
wallet_info: WalletInfo
|
|
63
76
|
wallet_state_manager: WalletStateManager
|
|
64
77
|
|
|
@@ -68,7 +81,6 @@ class GSTOptionalArgs(TypedDict):
|
|
|
68
81
|
launcher_id: NotRequired[Optional[bytes32]]
|
|
69
82
|
new_root_hash: NotRequired[Optional[bytes32]]
|
|
70
83
|
sign: NotRequired[bool]
|
|
71
|
-
add_pending_singleton: NotRequired[bool]
|
|
72
84
|
announce_new_state: NotRequired[bool]
|
|
73
85
|
# CATWallet
|
|
74
86
|
cat_discrepancy: NotRequired[Optional[tuple[int, Program, Program]]]
|
|
@@ -85,6 +97,8 @@ class GSTOptionalArgs(TypedDict):
|
|
|
85
97
|
new_proof_hash: NotRequired[Optional[bytes32]]
|
|
86
98
|
provider_inner_puzhash: NotRequired[Optional[bytes32]]
|
|
87
99
|
self_revoke: NotRequired[bool]
|
|
100
|
+
vc_id: NotRequired[Optional[bytes32]]
|
|
88
101
|
# Wallet
|
|
89
102
|
origin_id: NotRequired[Optional[bytes32]]
|
|
90
103
|
negative_change_allowed: NotRequired[bool]
|
|
104
|
+
puzzle_decorator_override: NotRequired[Optional[list[dict[str, Any]]]]
|
|
@@ -5,10 +5,10 @@ import logging
|
|
|
5
5
|
from typing import Optional
|
|
6
6
|
|
|
7
7
|
from chia_rs import G1Element
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import uint32
|
|
8
10
|
|
|
9
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
10
11
|
from chia.util.db_wrapper import DBWrapper2, execute_fetchone
|
|
11
|
-
from chia.util.ints import uint32
|
|
12
12
|
from chia.util.lru_cache import LRUCache
|
|
13
13
|
from chia.wallet.derivation_record import DerivationRecord
|
|
14
14
|
from chia.wallet.util.wallet_types import WalletIdentifier, WalletType
|
|
@@ -3,10 +3,10 @@ from __future__ import annotations
|
|
|
3
3
|
from typing import Optional
|
|
4
4
|
|
|
5
5
|
from chia_rs import CoinState
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint32
|
|
6
8
|
|
|
7
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
8
9
|
from chia.util.db_wrapper import DBWrapper2
|
|
9
|
-
from chia.util.ints import uint32
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class WalletRetryStore:
|
|
@@ -22,10 +22,7 @@ class WalletRetryStore:
|
|
|
22
22
|
self.db_wrapper = db_wrapper
|
|
23
23
|
async with self.db_wrapper.writer_maybe_transaction() as conn:
|
|
24
24
|
await conn.execute(
|
|
25
|
-
"CREATE TABLE IF NOT EXISTS retry_store("
|
|
26
|
-
" coin_state blob PRIMARY KEY,"
|
|
27
|
-
" peer blob,"
|
|
28
|
-
" fork_height int)"
|
|
25
|
+
"CREATE TABLE IF NOT EXISTS retry_store( coin_state blob PRIMARY KEY, peer blob, fork_height int)"
|
|
29
26
|
)
|
|
30
27
|
|
|
31
28
|
return self
|
|
@@ -5,16 +5,16 @@ import logging
|
|
|
5
5
|
from sqlite3 import Row
|
|
6
6
|
from typing import Optional, TypeVar, Union
|
|
7
7
|
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
8
10
|
from clvm.casts import int_from_bytes
|
|
9
11
|
|
|
10
12
|
from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
|
11
13
|
from chia.types.blockchain_format.coin import Coin
|
|
12
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
13
14
|
from chia.types.coin_spend import CoinSpend
|
|
14
15
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
15
16
|
from chia.util.condition_tools import conditions_dict_for_solution
|
|
16
17
|
from chia.util.db_wrapper import DBWrapper2, execute_fetchone
|
|
17
|
-
from chia.util.ints import uint32, uint64
|
|
18
18
|
from chia.wallet import singleton
|
|
19
19
|
from chia.wallet.lineage_proof import LineageProof
|
|
20
20
|
from chia.wallet.singleton import get_inner_puzzle_from_singleton, get_singleton_id_from_puzzle
|
|
@@ -7,21 +7,22 @@ import logging
|
|
|
7
7
|
import multiprocessing.context
|
|
8
8
|
import time
|
|
9
9
|
import traceback
|
|
10
|
-
from collections.abc import AsyncIterator
|
|
10
|
+
from collections.abc import AsyncIterator
|
|
11
11
|
from contextlib import asynccontextmanager
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
from typing import TYPE_CHECKING, Any, Callable, Optional, TypeVar, Union
|
|
14
14
|
|
|
15
15
|
import aiosqlite
|
|
16
|
-
from chia_rs import AugSchemeMPL, G1Element, G2Element, PrivateKey
|
|
16
|
+
from chia_rs import AugSchemeMPL, ConsensusConstants, G1Element, G2Element, PrivateKey
|
|
17
|
+
from chia_rs.sized_bytes import bytes32
|
|
18
|
+
from chia_rs.sized_ints import uint16, uint32, uint64, uint128
|
|
17
19
|
|
|
18
20
|
from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
|
|
19
21
|
from chia.consensus.coinbase import farmer_parent_id, pool_parent_id
|
|
20
|
-
from chia.consensus.constants import ConsensusConstants
|
|
21
22
|
from chia.data_layer.data_layer_wallet import DataLayerWallet
|
|
22
23
|
from chia.data_layer.dl_wallet_store import DataLayerStore
|
|
24
|
+
from chia.data_layer.singleton_record import SingletonRecord
|
|
23
25
|
from chia.pools.pool_puzzles import (
|
|
24
|
-
SINGLETON_LAUNCHER_HASH,
|
|
25
26
|
get_most_recent_singleton_coin_from_coin_spend,
|
|
26
27
|
solution_to_pool_state,
|
|
27
28
|
)
|
|
@@ -33,7 +34,6 @@ from chia.server.server import ChiaServer
|
|
|
33
34
|
from chia.server.ws_connection import WSChiaConnection
|
|
34
35
|
from chia.types.blockchain_format.coin import Coin
|
|
35
36
|
from chia.types.blockchain_format.program import Program
|
|
36
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
37
37
|
from chia.types.coin_record import CoinRecord
|
|
38
38
|
from chia.types.coin_spend import CoinSpend, compute_additions
|
|
39
39
|
from chia.types.mempool_inclusion_status import MempoolInclusionStatus
|
|
@@ -43,7 +43,6 @@ from chia.util.db_synchronous import db_synchronous_on
|
|
|
43
43
|
from chia.util.db_wrapper import DBWrapper2
|
|
44
44
|
from chia.util.errors import Err
|
|
45
45
|
from chia.util.hash import std_hash
|
|
46
|
-
from chia.util.ints import uint16, uint32, uint64, uint128
|
|
47
46
|
from chia.util.lru_cache import LRUCache
|
|
48
47
|
from chia.util.path import path_from_root
|
|
49
48
|
from chia.util.streamable import Streamable, UInt32Range, UInt64Range, VersionedBlob
|
|
@@ -51,23 +50,14 @@ from chia.wallet.cat_wallet.cat_constants import DEFAULT_CATS
|
|
|
51
50
|
from chia.wallet.cat_wallet.cat_info import CATCoinData, CATInfo, CRCATInfo
|
|
52
51
|
from chia.wallet.cat_wallet.cat_utils import CAT_MOD, CAT_MOD_HASH, construct_cat_puzzle, match_cat_puzzle
|
|
53
52
|
from chia.wallet.cat_wallet.cat_wallet import CATWallet
|
|
54
|
-
from chia.wallet.cat_wallet.dao_cat_wallet import DAOCATWallet
|
|
55
53
|
from chia.wallet.conditions import (
|
|
56
54
|
AssertCoinAnnouncement,
|
|
57
55
|
Condition,
|
|
58
56
|
ConditionValidTimes,
|
|
57
|
+
CreateCoin,
|
|
59
58
|
CreateCoinAnnouncement,
|
|
60
59
|
parse_timelock_info,
|
|
61
60
|
)
|
|
62
|
-
from chia.wallet.dao_wallet.dao_utils import (
|
|
63
|
-
get_p2_singleton_puzhash,
|
|
64
|
-
match_dao_cat_puzzle,
|
|
65
|
-
match_finished_puzzle,
|
|
66
|
-
match_funding_puzzle,
|
|
67
|
-
match_proposal_puzzle,
|
|
68
|
-
match_treasury_puzzle,
|
|
69
|
-
)
|
|
70
|
-
from chia.wallet.dao_wallet.dao_wallet import DAOWallet
|
|
71
61
|
from chia.wallet.db_wallet.db_wallet_puzzles import MIRROR_PUZZLE_HASH
|
|
72
62
|
from chia.wallet.derivation_record import DerivationRecord
|
|
73
63
|
from chia.wallet.derive_keys import (
|
|
@@ -83,12 +73,11 @@ from chia.wallet.did_wallet.did_info import DIDCoinData
|
|
|
83
73
|
from chia.wallet.did_wallet.did_wallet import DIDWallet
|
|
84
74
|
from chia.wallet.did_wallet.did_wallet_puzzles import DID_INNERPUZ_MOD, match_did_puzzle
|
|
85
75
|
from chia.wallet.key_val_store import KeyValStore
|
|
86
|
-
from chia.wallet.nft_wallet.
|
|
76
|
+
from chia.wallet.nft_wallet.nft_puzzle_utils import get_metadata_and_phs, get_new_owner_did
|
|
87
77
|
from chia.wallet.nft_wallet.nft_wallet import NFTWallet
|
|
88
78
|
from chia.wallet.nft_wallet.uncurry_nft import NFTCoinData, UncurriedNFT
|
|
89
79
|
from chia.wallet.notification_manager import NotificationManager
|
|
90
80
|
from chia.wallet.outer_puzzles import AssetType
|
|
91
|
-
from chia.wallet.payment import Payment
|
|
92
81
|
from chia.wallet.puzzle_drivers import PuzzleInfo
|
|
93
82
|
from chia.wallet.puzzles.clawback.drivers import generate_clawback_spend_bundle, match_clawback_puzzle
|
|
94
83
|
from chia.wallet.puzzles.clawback.metadata import ClawbackMetadata, ClawbackVersion
|
|
@@ -104,7 +93,8 @@ from chia.wallet.signer_protocol import (
|
|
|
104
93
|
TransactionInfo,
|
|
105
94
|
UnsignedTransaction,
|
|
106
95
|
)
|
|
107
|
-
from chia.wallet.singleton import
|
|
96
|
+
from chia.wallet.singleton import SINGLETON_LAUNCHER_PUZZLE_HASH as SINGLETON_LAUNCHER_HASH
|
|
97
|
+
from chia.wallet.singleton import create_singleton_puzzle, get_inner_puzzle_from_singleton
|
|
108
98
|
from chia.wallet.trade_manager import TradeManager
|
|
109
99
|
from chia.wallet.trading.offer import Offer
|
|
110
100
|
from chia.wallet.trading.trade_status import TradeStatus
|
|
@@ -325,18 +315,6 @@ class WalletStateManager:
|
|
|
325
315
|
self,
|
|
326
316
|
wallet_info,
|
|
327
317
|
)
|
|
328
|
-
elif wallet_type == WalletType.DAO: # pragma: no cover
|
|
329
|
-
wallet = await DAOWallet.create(
|
|
330
|
-
self,
|
|
331
|
-
self.main_wallet,
|
|
332
|
-
wallet_info,
|
|
333
|
-
)
|
|
334
|
-
elif wallet_type == WalletType.DAO_CAT: # pragma: no cover
|
|
335
|
-
wallet = await DAOCATWallet.create(
|
|
336
|
-
self,
|
|
337
|
-
self.main_wallet,
|
|
338
|
-
wallet_info,
|
|
339
|
-
)
|
|
340
318
|
elif wallet_type == WalletType.VC: # pragma: no cover
|
|
341
319
|
wallet = await VCWallet.create(
|
|
342
320
|
self,
|
|
@@ -795,40 +773,6 @@ class WalletStateManager:
|
|
|
795
773
|
|
|
796
774
|
uncurried = uncurry_puzzle(coin_spend.puzzle_reveal)
|
|
797
775
|
|
|
798
|
-
dao_ids = []
|
|
799
|
-
wallets = self.wallets.values()
|
|
800
|
-
for wallet in wallets:
|
|
801
|
-
if wallet.type() == WalletType.DAO.value:
|
|
802
|
-
assert isinstance(wallet, DAOWallet)
|
|
803
|
-
dao_ids.append(wallet.dao_info.treasury_id)
|
|
804
|
-
funding_puzzle_check = match_funding_puzzle(
|
|
805
|
-
uncurried, coin_spend.solution.to_program(), coin_state.coin, dao_ids
|
|
806
|
-
)
|
|
807
|
-
if funding_puzzle_check:
|
|
808
|
-
return await self.get_dao_wallet_from_coinspend_hint(coin_spend, coin_state), None
|
|
809
|
-
|
|
810
|
-
# Check if the coin is a DAO Treasury
|
|
811
|
-
dao_curried_args = match_treasury_puzzle(uncurried.mod, uncurried.args)
|
|
812
|
-
if dao_curried_args is not None:
|
|
813
|
-
return await self.handle_dao_treasury(dao_curried_args, parent_coin_state, coin_state, coin_spend), None
|
|
814
|
-
# Check if the coin is a Proposal and that it isn't the timer coin (amount == 0)
|
|
815
|
-
dao_curried_args = match_proposal_puzzle(uncurried.mod, uncurried.args)
|
|
816
|
-
if (dao_curried_args is not None) and (coin_state.coin.amount != 0):
|
|
817
|
-
return await self.handle_dao_proposal(dao_curried_args, parent_coin_state, coin_state, coin_spend), None
|
|
818
|
-
|
|
819
|
-
# Check if the coin is a finished proposal
|
|
820
|
-
dao_curried_args = match_finished_puzzle(uncurried.mod, uncurried.args)
|
|
821
|
-
if dao_curried_args is not None:
|
|
822
|
-
return (
|
|
823
|
-
await self.handle_dao_finished_proposals(dao_curried_args, parent_coin_state, coin_state, coin_spend),
|
|
824
|
-
None,
|
|
825
|
-
)
|
|
826
|
-
|
|
827
|
-
# Check if the coin is a DAO CAT
|
|
828
|
-
dao_cat_args = match_dao_cat_puzzle(uncurried)
|
|
829
|
-
if dao_cat_args:
|
|
830
|
-
return await self.handle_dao_cat(dao_cat_args, parent_coin_state, coin_state, coin_spend, fork_height), None
|
|
831
|
-
|
|
832
776
|
# Check if the coin is a CAT
|
|
833
777
|
cat_curried_args = match_cat_puzzle(uncurried)
|
|
834
778
|
if cat_curried_args is not None:
|
|
@@ -972,7 +916,7 @@ class WalletStateManager:
|
|
|
972
916
|
inner_puzzle: Program = self.main_wallet.puzzle_for_pk(derivation_record.pubkey)
|
|
973
917
|
inner_solution: Program = self.main_wallet.make_solution(
|
|
974
918
|
primaries=[
|
|
975
|
-
|
|
919
|
+
CreateCoin(
|
|
976
920
|
derivation_record.puzzle_hash,
|
|
977
921
|
uint64(coin.amount),
|
|
978
922
|
memos, # Forward memo of the first coin
|
|
@@ -1085,39 +1029,6 @@ class WalletStateManager:
|
|
|
1085
1029
|
wallet_identifier = await self.get_wallet_identifier_for_puzzle_hash(coin_state.coin.puzzle_hash)
|
|
1086
1030
|
return wallet_identifier is not None and wallet_identifier.type == WalletType.STANDARD_WALLET
|
|
1087
1031
|
|
|
1088
|
-
async def handle_dao_cat(
|
|
1089
|
-
self,
|
|
1090
|
-
curried_args: Iterator[Program],
|
|
1091
|
-
parent_coin_state: CoinState,
|
|
1092
|
-
coin_state: CoinState,
|
|
1093
|
-
coin_spend: CoinSpend,
|
|
1094
|
-
fork_height: Optional[uint32],
|
|
1095
|
-
) -> Optional[WalletIdentifier]:
|
|
1096
|
-
"""
|
|
1097
|
-
Handle the new coin when it is a DAO CAT
|
|
1098
|
-
"""
|
|
1099
|
-
_mod_hash, tail_hash, _inner_puzzle = curried_args
|
|
1100
|
-
asset_id: bytes32 = bytes32(bytes(tail_hash)[1:])
|
|
1101
|
-
for wallet in self.wallets.values():
|
|
1102
|
-
if wallet.type() == WalletType.DAO_CAT:
|
|
1103
|
-
assert isinstance(wallet, DAOCATWallet)
|
|
1104
|
-
if wallet.dao_cat_info.limitations_program_hash == asset_id:
|
|
1105
|
-
return WalletIdentifier.create(wallet)
|
|
1106
|
-
# Found a DAO_CAT, but we don't have a wallet for it. Add to unacknowledged
|
|
1107
|
-
await self.interested_store.add_unacknowledged_token(
|
|
1108
|
-
asset_id,
|
|
1109
|
-
CATWallet.default_wallet_name_for_unknown_cat(asset_id.hex()),
|
|
1110
|
-
None if parent_coin_state.spent_height is None else uint32(parent_coin_state.spent_height),
|
|
1111
|
-
parent_coin_state.coin.puzzle_hash,
|
|
1112
|
-
)
|
|
1113
|
-
await self.interested_store.add_unacknowledged_coin_state(
|
|
1114
|
-
asset_id,
|
|
1115
|
-
coin_state,
|
|
1116
|
-
fork_height,
|
|
1117
|
-
)
|
|
1118
|
-
self.state_changed("added_stray_cat")
|
|
1119
|
-
return None # pragma: no cover
|
|
1120
|
-
|
|
1121
1032
|
async def handle_cat(
|
|
1122
1033
|
self,
|
|
1123
1034
|
parent_data: CATCoinData,
|
|
@@ -1375,94 +1286,6 @@ class WalletStateManager:
|
|
|
1375
1286
|
minter_did = bytes32(bytes(singleton_struct.rest().first())[1:])
|
|
1376
1287
|
return minter_did
|
|
1377
1288
|
|
|
1378
|
-
async def handle_dao_treasury(
|
|
1379
|
-
self,
|
|
1380
|
-
uncurried_args: Iterator[Program],
|
|
1381
|
-
parent_coin_state: CoinState,
|
|
1382
|
-
coin_state: CoinState,
|
|
1383
|
-
coin_spend: CoinSpend,
|
|
1384
|
-
) -> Optional[WalletIdentifier]:
|
|
1385
|
-
self.log.info("Entering dao_treasury handling in WalletStateManager")
|
|
1386
|
-
singleton_id = get_singleton_id_from_puzzle(coin_spend.puzzle_reveal)
|
|
1387
|
-
for wallet in self.wallets.values():
|
|
1388
|
-
if wallet.type() == WalletType.DAO:
|
|
1389
|
-
assert isinstance(wallet, DAOWallet)
|
|
1390
|
-
if wallet.dao_info.treasury_id == singleton_id:
|
|
1391
|
-
return WalletIdentifier.create(wallet)
|
|
1392
|
-
|
|
1393
|
-
# TODO: If we can't find the wallet for this DAO but we've got here because we're subscribed,
|
|
1394
|
-
# then create the wallet. (see early in dao-wallet commits for how to do this)
|
|
1395
|
-
return None # pragma: no cover
|
|
1396
|
-
|
|
1397
|
-
async def handle_dao_proposal(
|
|
1398
|
-
self,
|
|
1399
|
-
uncurried_args: Iterator[Program],
|
|
1400
|
-
parent_coin_state: CoinState,
|
|
1401
|
-
coin_state: CoinState,
|
|
1402
|
-
coin_spend: CoinSpend,
|
|
1403
|
-
) -> Optional[WalletIdentifier]:
|
|
1404
|
-
(
|
|
1405
|
-
# ; second hash
|
|
1406
|
-
_SELF_HASH,
|
|
1407
|
-
_PROPOSAL_ID,
|
|
1408
|
-
_PROPOSED_PUZ_HASH,
|
|
1409
|
-
_YES_VOTES,
|
|
1410
|
-
_TOTAL_VOTES,
|
|
1411
|
-
# ; first hash
|
|
1412
|
-
_PROPOSAL_TIMER_MOD_HASH,
|
|
1413
|
-
_SINGLETON_MOD_HASH,
|
|
1414
|
-
_SINGLETON_LAUNCHER_PUZHASH,
|
|
1415
|
-
_CAT_MOD_HASH,
|
|
1416
|
-
_DAO_FINISHED_STATE_MOD_HASH,
|
|
1417
|
-
_TREASURY_MOD_HASH,
|
|
1418
|
-
_LOCKUP_SELF_HASH,
|
|
1419
|
-
_CAT_TAIL_HASH,
|
|
1420
|
-
TREASURY_ID,
|
|
1421
|
-
) = uncurried_args
|
|
1422
|
-
for wallet in self.wallets.values():
|
|
1423
|
-
if wallet.type() == WalletType.DAO:
|
|
1424
|
-
assert isinstance(wallet, DAOWallet)
|
|
1425
|
-
if wallet.dao_info.treasury_id == TREASURY_ID.as_atom():
|
|
1426
|
-
assert isinstance(coin_state.created_height, int)
|
|
1427
|
-
await wallet.add_or_update_proposal_info(coin_spend, uint32(coin_state.created_height))
|
|
1428
|
-
return WalletIdentifier.create(wallet)
|
|
1429
|
-
return None # pragma: no cover
|
|
1430
|
-
|
|
1431
|
-
async def handle_dao_finished_proposals(
|
|
1432
|
-
self,
|
|
1433
|
-
uncurried_args: Iterator[Program],
|
|
1434
|
-
parent_coin_state: CoinState,
|
|
1435
|
-
coin_state: CoinState,
|
|
1436
|
-
coin_spend: CoinSpend,
|
|
1437
|
-
) -> Optional[WalletIdentifier]:
|
|
1438
|
-
if coin_state.created_height is None: # pragma: no cover
|
|
1439
|
-
raise ValueError("coin_state argument to handle_dao_finished_proposals cannot have created_height of None")
|
|
1440
|
-
(
|
|
1441
|
-
SINGLETON_STRUCT, # (SINGLETON_MOD_HASH, (SINGLETON_ID, LAUNCHER_PUZZLE_HASH))
|
|
1442
|
-
_FINISHED_STATE_MOD_HASH,
|
|
1443
|
-
) = uncurried_args
|
|
1444
|
-
proposal_id = SINGLETON_STRUCT.rest().first().as_atom()
|
|
1445
|
-
for wallet in self.wallets.values():
|
|
1446
|
-
if wallet.type() == WalletType.DAO:
|
|
1447
|
-
assert isinstance(wallet, DAOWallet)
|
|
1448
|
-
for proposal_info in wallet.dao_info.proposals_list:
|
|
1449
|
-
if proposal_info.proposal_id == proposal_id:
|
|
1450
|
-
await wallet.add_or_update_proposal_info(coin_spend, uint32(coin_state.created_height))
|
|
1451
|
-
return WalletIdentifier.create(wallet)
|
|
1452
|
-
return None
|
|
1453
|
-
|
|
1454
|
-
async def get_dao_wallet_from_coinspend_hint(
|
|
1455
|
-
self, coin_spend: CoinSpend, coin_state: CoinState
|
|
1456
|
-
) -> Optional[WalletIdentifier]:
|
|
1457
|
-
hinted_coin = compute_spend_hints_and_additions(coin_spend)[0][coin_state.coin.name()]
|
|
1458
|
-
if hinted_coin:
|
|
1459
|
-
for wallet in self.wallets.values():
|
|
1460
|
-
if wallet.type() == WalletType.DAO.value:
|
|
1461
|
-
assert isinstance(wallet, DAOWallet)
|
|
1462
|
-
if get_p2_singleton_puzhash(wallet.dao_info.treasury_id) == hinted_coin.hint:
|
|
1463
|
-
return WalletIdentifier.create(wallet)
|
|
1464
|
-
return None
|
|
1465
|
-
|
|
1466
1289
|
async def handle_nft(
|
|
1467
1290
|
self,
|
|
1468
1291
|
nft_data: NFTCoinData,
|
|
@@ -1978,11 +1801,10 @@ class WalletStateManager:
|
|
|
1978
1801
|
unconfirmed_record.name, uint32(coin_state.spent_height)
|
|
1979
1802
|
)
|
|
1980
1803
|
|
|
1981
|
-
if record.wallet_type
|
|
1982
|
-
wallet_type_to_class = {WalletType.POOLING_WALLET: PoolWallet, WalletType.DAO: DAOWallet}
|
|
1804
|
+
if record.wallet_type is WalletType.POOLING_WALLET:
|
|
1983
1805
|
if coin_state.spent_height is not None and coin_state.coin.amount == uint64(1):
|
|
1984
|
-
singleton_wallet:
|
|
1985
|
-
id=uint32(record.wallet_id), required_type=
|
|
1806
|
+
singleton_wallet: PoolWallet = self.get_wallet(
|
|
1807
|
+
id=uint32(record.wallet_id), required_type=PoolWallet
|
|
1986
1808
|
)
|
|
1987
1809
|
curr_coin_state: CoinState = coin_state
|
|
1988
1810
|
|
|
@@ -2285,9 +2107,6 @@ class WalletStateManager:
|
|
|
2285
2107
|
|
|
2286
2108
|
await self.wallets[wallet_id].coin_added(coin, height, peer, coin_data)
|
|
2287
2109
|
|
|
2288
|
-
if wallet_type == WalletType.DAO:
|
|
2289
|
-
return
|
|
2290
|
-
|
|
2291
2110
|
await self.create_more_puzzle_hashes()
|
|
2292
2111
|
|
|
2293
2112
|
async def add_pending_transactions(
|
|
@@ -2298,6 +2117,7 @@ class WalletStateManager:
|
|
|
2298
2117
|
sign: Optional[bool] = None,
|
|
2299
2118
|
additional_signing_responses: Optional[list[SigningResponse]] = None,
|
|
2300
2119
|
extra_spends: Optional[list[WalletSpendBundle]] = None,
|
|
2120
|
+
singleton_records: list[SingletonRecord] = [],
|
|
2301
2121
|
) -> list[TransactionRecord]:
|
|
2302
2122
|
"""
|
|
2303
2123
|
Add a list of transactions to be submitted to the full node.
|
|
@@ -2344,6 +2164,9 @@ class WalletStateManager:
|
|
|
2344
2164
|
all_coins_names.extend([coin.name() for coin in tx_record.additions])
|
|
2345
2165
|
all_coins_names.extend([coin.name() for coin in tx_record.removals])
|
|
2346
2166
|
|
|
2167
|
+
for singleton_record in singleton_records:
|
|
2168
|
+
await self.dl_store.add_singleton_record(singleton_record)
|
|
2169
|
+
|
|
2347
2170
|
await self.add_interested_coin_ids(all_coins_names)
|
|
2348
2171
|
|
|
2349
2172
|
if actual_spend_involved:
|
|
@@ -2625,9 +2448,9 @@ class WalletStateManager:
|
|
|
2625
2448
|
def get_dl_wallet(self) -> DataLayerWallet:
|
|
2626
2449
|
for wallet in self.wallets.values():
|
|
2627
2450
|
if wallet.type() == WalletType.DATA_LAYER.value:
|
|
2628
|
-
assert isinstance(
|
|
2629
|
-
|
|
2630
|
-
)
|
|
2451
|
+
assert isinstance(wallet, DataLayerWallet), (
|
|
2452
|
+
f"WalletType.DATA_LAYER should be a DataLayerWallet instance got: {type(wallet).__name__}"
|
|
2453
|
+
)
|
|
2631
2454
|
return wallet
|
|
2632
2455
|
raise ValueError("DataLayerWallet not available")
|
|
2633
2456
|
|
|
@@ -6,12 +6,12 @@ import time
|
|
|
6
6
|
from typing import Optional
|
|
7
7
|
|
|
8
8
|
import aiosqlite
|
|
9
|
+
from chia_rs.sized_bytes import bytes32
|
|
10
|
+
from chia_rs.sized_ints import uint8, uint32
|
|
9
11
|
|
|
10
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
11
12
|
from chia.types.mempool_inclusion_status import MempoolInclusionStatus
|
|
12
13
|
from chia.util.db_wrapper import DBWrapper2
|
|
13
14
|
from chia.util.errors import Err
|
|
14
|
-
from chia.util.ints import uint8, uint32
|
|
15
15
|
from chia.wallet.conditions import ConditionValidTimes
|
|
16
16
|
from chia.wallet.transaction_record import (
|
|
17
17
|
LightTransactionRecord,
|