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
chia/wallet/trading/offer.py
CHANGED
|
@@ -3,23 +3,25 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
4
|
from typing import Any, BinaryIO, Optional, Union
|
|
5
5
|
|
|
6
|
+
from chia_puzzles_py.programs import SETTLEMENT_PAYMENT, SETTLEMENT_PAYMENT_HASH
|
|
6
7
|
from chia_rs import G2Element
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import uint64
|
|
7
10
|
from clvm_tools.binutils import disassemble
|
|
8
11
|
|
|
9
12
|
from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
|
10
13
|
from chia.types.blockchain_format.coin import Coin, coin_as_list
|
|
11
14
|
from chia.types.blockchain_format.program import INFINITE_COST, Program
|
|
12
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
13
15
|
from chia.types.coin_spend import CoinSpend, make_spend
|
|
14
16
|
from chia.util.bech32m import bech32_decode, bech32_encode, convertbits
|
|
15
17
|
from chia.util.errors import Err, ValidationError
|
|
16
|
-
from chia.util.ints import uint64
|
|
17
18
|
from chia.util.streamable import parse_rust
|
|
18
19
|
from chia.wallet.conditions import (
|
|
19
20
|
AssertCoinAnnouncement,
|
|
20
21
|
AssertPuzzleAnnouncement,
|
|
21
22
|
Condition,
|
|
22
23
|
ConditionValidTimes,
|
|
24
|
+
CreateCoin,
|
|
23
25
|
parse_conditions_non_consensus,
|
|
24
26
|
parse_timelock_info,
|
|
25
27
|
)
|
|
@@ -31,9 +33,7 @@ from chia.wallet.outer_puzzles import (
|
|
|
31
33
|
match_puzzle,
|
|
32
34
|
solve_puzzle,
|
|
33
35
|
)
|
|
34
|
-
from chia.wallet.payment import Payment
|
|
35
36
|
from chia.wallet.puzzle_drivers import PuzzleInfo, Solver
|
|
36
|
-
from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile
|
|
37
37
|
from chia.wallet.uncurried_puzzle import UncurriedPuzzle, uncurry_puzzle
|
|
38
38
|
from chia.wallet.util.compute_hints import compute_spend_hints_and_additions
|
|
39
39
|
from chia.wallet.util.puzzle_compression import (
|
|
@@ -43,8 +43,8 @@ from chia.wallet.util.puzzle_compression import (
|
|
|
43
43
|
)
|
|
44
44
|
from chia.wallet.wallet_spend_bundle import WalletSpendBundle
|
|
45
45
|
|
|
46
|
-
OFFER_MOD =
|
|
47
|
-
OFFER_MOD_HASH =
|
|
46
|
+
OFFER_MOD = Program.from_bytes(SETTLEMENT_PAYMENT)
|
|
47
|
+
OFFER_MOD_HASH = bytes32(SETTLEMENT_PAYMENT_HASH)
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
def detect_dependent_coin(
|
|
@@ -61,15 +61,17 @@ def detect_dependent_coin(
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
@dataclass(frozen=True)
|
|
64
|
-
class NotarizedPayment(
|
|
64
|
+
class NotarizedPayment(CreateCoin):
|
|
65
65
|
nonce: bytes32 = bytes32.zeros
|
|
66
66
|
|
|
67
67
|
@classmethod
|
|
68
68
|
def from_condition_and_nonce(cls, condition: Program, nonce: bytes32) -> NotarizedPayment:
|
|
69
69
|
with_opcode: Program = Program.to((51, condition)) # Gotta do this because the super class is expecting it
|
|
70
|
-
p =
|
|
71
|
-
puzzle_hash, amount, memos
|
|
72
|
-
|
|
70
|
+
p = CreateCoin.from_program(with_opcode)
|
|
71
|
+
return cls(p.puzzle_hash, p.amount, p.memos, nonce)
|
|
72
|
+
|
|
73
|
+
def name(self) -> bytes32:
|
|
74
|
+
return self.to_program().get_tree_hash()
|
|
73
75
|
|
|
74
76
|
|
|
75
77
|
@dataclass(frozen=True, eq=False)
|
|
@@ -94,7 +96,7 @@ class Offer:
|
|
|
94
96
|
|
|
95
97
|
@staticmethod
|
|
96
98
|
def notarize_payments(
|
|
97
|
-
requested_payments: dict[Optional[bytes32], list[
|
|
99
|
+
requested_payments: dict[Optional[bytes32], list[CreateCoin]], # `None` means you are requesting XCH
|
|
98
100
|
coins: list[Coin],
|
|
99
101
|
) -> dict[Optional[bytes32], list[NotarizedPayment]]:
|
|
100
102
|
# This sort should be reproducible in CLVM with `>s`
|
|
@@ -106,8 +108,7 @@ class Offer:
|
|
|
106
108
|
for asset_id, payments in requested_payments.items():
|
|
107
109
|
notarized_payments[asset_id] = []
|
|
108
110
|
for p in payments:
|
|
109
|
-
puzzle_hash, amount, memos
|
|
110
|
-
notarized_payments[asset_id].append(NotarizedPayment(puzzle_hash, amount, memos, nonce))
|
|
111
|
+
notarized_payments[asset_id].append(NotarizedPayment(p.puzzle_hash, p.amount, p.memos, nonce))
|
|
111
112
|
|
|
112
113
|
return notarized_payments
|
|
113
114
|
|
|
@@ -5,12 +5,12 @@ from time import perf_counter
|
|
|
5
5
|
from typing import Optional
|
|
6
6
|
|
|
7
7
|
import aiosqlite
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import uint8, uint32
|
|
8
10
|
|
|
9
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
10
11
|
from chia.types.mempool_inclusion_status import MempoolInclusionStatus
|
|
11
12
|
from chia.util.db_wrapper import DBWrapper2
|
|
12
13
|
from chia.util.errors import Err
|
|
13
|
-
from chia.util.ints import uint8, uint32
|
|
14
14
|
from chia.wallet.conditions import ConditionValidTimes
|
|
15
15
|
from chia.wallet.trade_record import TradeRecord, TradeRecordOld
|
|
16
16
|
from chia.wallet.trading.offer import Offer
|
|
@@ -412,8 +412,7 @@ class TradeStore:
|
|
|
412
412
|
# Create an ORDER BY clause according to the desired sort type
|
|
413
413
|
if sort_key is None or sort_key == "CONFIRMED_AT_HEIGHT":
|
|
414
414
|
order_by_clause = (
|
|
415
|
-
f"ORDER BY confirmed_at_index {'ASC' if reverse else 'DESC'}, "
|
|
416
|
-
f"trade_id {'DESC' if reverse else 'ASC'} "
|
|
415
|
+
f"ORDER BY confirmed_at_index {'ASC' if reverse else 'DESC'}, trade_id {'DESC' if reverse else 'ASC'} "
|
|
417
416
|
)
|
|
418
417
|
elif sort_key == "RELEVANCE":
|
|
419
418
|
# Custom sort order for statuses to separate out pending/completed offers
|
|
@@ -5,14 +5,14 @@ from dataclasses import dataclass
|
|
|
5
5
|
from typing import Any, Generic, Optional, TypeVar
|
|
6
6
|
|
|
7
7
|
from chia_rs import SpendBundle
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import uint8, uint32, uint64
|
|
8
10
|
|
|
9
11
|
from chia.consensus.coinbase import farmer_parent_id, pool_parent_id
|
|
10
12
|
from chia.types.blockchain_format.coin import Coin
|
|
11
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
12
13
|
from chia.types.mempool_inclusion_status import MempoolInclusionStatus
|
|
13
14
|
from chia.util.bech32m import decode_puzzle_hash, encode_puzzle_hash
|
|
14
15
|
from chia.util.errors import Err
|
|
15
|
-
from chia.util.ints import uint8, uint32, uint64
|
|
16
16
|
from chia.util.streamable import Streamable, streamable
|
|
17
17
|
from chia.wallet.conditions import ConditionValidTimes
|
|
18
18
|
from chia.wallet.util.transaction_type import TransactionType
|
|
@@ -2,8 +2,9 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
from
|
|
5
|
+
from chia_rs.sized_bytes import bytes32
|
|
6
|
+
from chia_rs.sized_ints import uint64
|
|
7
|
+
|
|
7
8
|
from chia.util.streamable import Streamable
|
|
8
9
|
from chia.wallet.signer_protocol import (
|
|
9
10
|
KeyHints,
|
|
@@ -3,15 +3,16 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from typing import Optional
|
|
5
5
|
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint64
|
|
8
|
+
|
|
6
9
|
from chia.consensus.condition_costs import ConditionCost
|
|
7
10
|
from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
|
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.types.coin_spend import CoinSpend
|
|
12
14
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
13
15
|
from chia.util.errors import Err, ValidationError
|
|
14
|
-
from chia.util.ints import uint64
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
@dataclass(frozen=True)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from chia_rs.sized_bytes import bytes32
|
|
4
|
+
from chia_rs.sized_ints import uint64
|
|
3
5
|
from clvm.casts import int_from_bytes
|
|
4
6
|
|
|
5
7
|
from chia.types.blockchain_format.coin import Coin
|
|
6
8
|
from chia.types.blockchain_format.program import INFINITE_COST
|
|
7
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
8
9
|
from chia.types.coin_spend import CoinSpend
|
|
9
10
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
10
|
-
from chia.util.ints import uint64
|
|
11
11
|
from chia.wallet.wallet_spend_bundle import WalletSpendBundle
|
|
12
12
|
|
|
13
13
|
|
|
@@ -4,10 +4,9 @@ from collections.abc import Sequence
|
|
|
4
4
|
from hashlib import sha256
|
|
5
5
|
from typing import Callable
|
|
6
6
|
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
8
|
from clvm.casts import int_to_bytes
|
|
8
9
|
|
|
9
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
10
|
-
|
|
11
10
|
CurryHashFunction = Callable[..., bytes32]
|
|
12
11
|
|
|
13
12
|
|
chia/wallet/util/merkle_tree.py
CHANGED
|
@@ -4,9 +4,9 @@ import math
|
|
|
4
4
|
from enum import Enum
|
|
5
5
|
from typing import Optional
|
|
6
6
|
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
8
|
from clvm.casts import int_to_bytes
|
|
8
9
|
|
|
9
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
10
10
|
from chia.util.hash import std_hash
|
|
11
11
|
|
|
12
12
|
ONE = int_to_bytes(1)
|
chia/wallet/util/merkle_utils.py
CHANGED
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
import hashlib
|
|
4
4
|
from typing import Any
|
|
5
5
|
|
|
6
|
-
from
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
7
|
|
|
8
8
|
TupleTree = Any # Union[bytes32, tuple["TupleTree", "TupleTree"]]
|
|
9
9
|
Proof_Tree_Type = Any # Union[bytes32, tuple[bytes32, "Proof_Tree_Type"]]
|
|
@@ -5,9 +5,10 @@ import dataclasses
|
|
|
5
5
|
from enum import IntEnum
|
|
6
6
|
from typing import Any
|
|
7
7
|
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
|
|
8
10
|
from chia.protocols.wallet_protocol import CoinStateUpdate, NewPeakWallet
|
|
9
11
|
from chia.server.ws_connection import WSChiaConnection
|
|
10
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class NewPeakQueueTypes(IntEnum):
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from chia_puzzles_py.programs import NOTIFICATION
|
|
4
|
+
from chia_rs.sized_bytes import bytes32
|
|
5
|
+
from chia_rs.sized_ints import uint64
|
|
6
|
+
|
|
3
7
|
from chia.types.blockchain_format.program import Program
|
|
4
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
5
|
-
from chia.util.ints import uint64
|
|
6
|
-
from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile
|
|
7
8
|
|
|
8
|
-
NOTIFICATION_MOD =
|
|
9
|
+
NOTIFICATION_MOD = Program.from_bytes(NOTIFICATION)
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
def construct_notification(target: bytes32, amount: uint64) -> Program:
|
|
@@ -3,11 +3,12 @@ from __future__ import annotations
|
|
|
3
3
|
import asyncio
|
|
4
4
|
from typing import Any, Optional
|
|
5
5
|
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
8
|
+
|
|
6
9
|
from chia.protocols.wallet_protocol import CoinState
|
|
7
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
8
10
|
from chia.types.header_block import HeaderBlock
|
|
9
11
|
from chia.util.hash import std_hash
|
|
10
|
-
from chia.util.ints import uint32, uint64
|
|
11
12
|
from chia.util.lru_cache import LRUCache
|
|
12
13
|
|
|
13
14
|
|
|
@@ -2,6 +2,8 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import zlib
|
|
4
4
|
|
|
5
|
+
from chia_puzzles_py.programs import SETTLEMENT_PAYMENT
|
|
6
|
+
|
|
5
7
|
from chia.types.blockchain_format.program import Program
|
|
6
8
|
from chia.wallet.cat_wallet.cat_utils import CAT_MOD
|
|
7
9
|
from chia.wallet.nft_wallet.nft_puzzles import (
|
|
@@ -9,10 +11,11 @@ from chia.wallet.nft_wallet.nft_puzzles import (
|
|
|
9
11
|
NFT_OWNERSHIP_LAYER,
|
|
10
12
|
NFT_STATE_LAYER_MOD,
|
|
11
13
|
NFT_TRANSFER_PROGRAM_DEFAULT,
|
|
12
|
-
SINGLETON_TOP_LAYER_MOD,
|
|
13
14
|
)
|
|
14
15
|
from chia.wallet.puzzles import p2_delegated_puzzle_or_hidden_puzzle as standard_puzzle
|
|
15
|
-
from chia.wallet.
|
|
16
|
+
from chia.wallet.singleton import (
|
|
17
|
+
SINGLETON_TOP_LAYER_MOD,
|
|
18
|
+
)
|
|
16
19
|
|
|
17
20
|
# Need the legacy CAT mod for zlib backwards compatibility
|
|
18
21
|
LEGACY_CAT_MOD = Program.fromhex(
|
|
@@ -22,7 +25,6 @@ LEGACY_CAT_MOD = Program.fromhex(
|
|
|
22
25
|
OFFER_MOD_OLD = Program.fromhex(
|
|
23
26
|
"ff02ffff01ff02ff0affff04ff02ffff04ff03ff80808080ffff04ffff01ffff333effff02ffff03ff05ffff01ff04ffff04ff0cffff04ffff02ff1effff04ff02ffff04ff09ff80808080ff808080ffff02ff16ffff04ff02ffff04ff19ffff04ffff02ff0affff04ff02ffff04ff0dff80808080ff808080808080ff8080ff0180ffff02ffff03ff05ffff01ff04ffff04ff08ff0980ffff02ff16ffff04ff02ffff04ff0dffff04ff0bff808080808080ffff010b80ff0180ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff1effff04ff02ffff04ff09ff80808080ffff02ff1effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080"
|
|
24
27
|
)
|
|
25
|
-
OFFER_MOD = load_clvm_maybe_recompile("settlement_payments.clsp")
|
|
26
28
|
|
|
27
29
|
# For backwards compatibility to work, we must assume that these mods (already deployed) will not change
|
|
28
30
|
# In the case that they do change and we don't support the old asset then we need to keep around the legacy module
|
|
@@ -35,7 +37,7 @@ ZDICT = [
|
|
|
35
37
|
+ bytes(NFT_METADATA_UPDATER)
|
|
36
38
|
+ bytes(NFT_TRANSFER_PROGRAM_DEFAULT),
|
|
37
39
|
bytes(CAT_MOD),
|
|
38
|
-
|
|
40
|
+
SETTLEMENT_PAYMENT,
|
|
39
41
|
b"", # purposefully break compatibility with older versions
|
|
40
42
|
# more dictionaries go here
|
|
41
43
|
]
|
|
@@ -3,11 +3,11 @@ from __future__ import annotations
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import Any
|
|
5
5
|
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
6
7
|
from typing_extensions import Protocol
|
|
7
8
|
|
|
8
9
|
from chia.types.blockchain_format.program import Program
|
|
9
|
-
from chia.
|
|
10
|
-
from chia.wallet.payment import Payment
|
|
10
|
+
from chia.wallet.conditions import CreateCoin
|
|
11
11
|
from chia.wallet.puzzles.clawback.puzzle_decorator import ClawbackPuzzleDecorator
|
|
12
12
|
from chia.wallet.util.puzzle_decorator_type import PuzzleDecoratorType
|
|
13
13
|
|
|
@@ -26,7 +26,9 @@ class PuzzleDecoratorProtocol(Protocol):
|
|
|
26
26
|
self, inner_puzzle: Program, target_puzzle_hash: bytes32, memos: list[bytes]
|
|
27
27
|
) -> tuple[Program, list[bytes]]: ...
|
|
28
28
|
|
|
29
|
-
def solve(
|
|
29
|
+
def solve(
|
|
30
|
+
self, puzzle: Program, primaries: list[CreateCoin], inner_solution: Program
|
|
31
|
+
) -> tuple[Program, Program]: ...
|
|
30
32
|
|
|
31
33
|
|
|
32
34
|
class PuzzleDecoratorManager:
|
|
@@ -75,7 +77,7 @@ class PuzzleDecoratorManager:
|
|
|
75
77
|
inner_puzzle, target_puzzle_hash = decorator.decorate_target_puzzle_hash(inner_puzzle, target_puzzle_hash)
|
|
76
78
|
return target_puzzle_hash
|
|
77
79
|
|
|
78
|
-
def solve(self, inner_puzzle: Program, primaries: list[
|
|
80
|
+
def solve(self, inner_puzzle: Program, primaries: list[CreateCoin], inner_solution: Program) -> Program:
|
|
79
81
|
"""
|
|
80
82
|
Generate the solution of the puzzle
|
|
81
83
|
:param inner_puzzle: Inner puzzle
|
chia/wallet/util/query_filter.py
CHANGED
|
@@ -3,8 +3,9 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from enum import IntEnum
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint8, uint64
|
|
8
|
+
|
|
8
9
|
from chia.util.streamable import Streamable, streamable
|
|
9
10
|
from chia.wallet.util.transaction_type import TransactionType
|
|
10
11
|
|
chia/wallet/util/tx_config.py
CHANGED
|
@@ -3,13 +3,13 @@ from __future__ import annotations
|
|
|
3
3
|
import dataclasses
|
|
4
4
|
from typing import Any, Optional, TypeVar
|
|
5
5
|
|
|
6
|
+
from chia_rs import ConsensusConstants
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
8
|
+
from chia_rs.sized_ints import uint64
|
|
6
9
|
from typing_extensions import NotRequired, TypedDict, Unpack
|
|
7
10
|
|
|
8
|
-
from chia.consensus.constants import ConsensusConstants
|
|
9
11
|
from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
|
10
12
|
from chia.types.blockchain_format.coin import Coin
|
|
11
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
12
|
-
from chia.util.ints import uint64
|
|
13
13
|
from chia.util.streamable import Streamable, streamable
|
|
14
14
|
|
|
15
15
|
|
|
@@ -6,6 +6,8 @@ import random
|
|
|
6
6
|
from typing import Any, Optional, Union
|
|
7
7
|
|
|
8
8
|
from chia_rs import compute_merkle_set_root, confirm_included_already_hashed, confirm_not_included_already_hashed
|
|
9
|
+
from chia_rs.sized_bytes import bytes32
|
|
10
|
+
from chia_rs.sized_ints import uint32
|
|
9
11
|
|
|
10
12
|
from chia.full_node.full_node_api import FullNodeAPI
|
|
11
13
|
from chia.protocols.shared_protocol import Capability
|
|
@@ -32,10 +34,8 @@ from chia.protocols.wallet_protocol import (
|
|
|
32
34
|
)
|
|
33
35
|
from chia.server.ws_connection import WSChiaConnection
|
|
34
36
|
from chia.types.blockchain_format.coin import Coin, hash_coin_ids
|
|
35
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
36
37
|
from chia.types.coin_spend import CoinSpend, make_spend
|
|
37
38
|
from chia.types.header_block import HeaderBlock
|
|
38
|
-
from chia.util.ints import uint32
|
|
39
39
|
from chia.util.task_referencer import create_referenced_task
|
|
40
40
|
from chia.wallet.util.peer_request_cache import PeerRequestCache
|
|
41
41
|
|
chia/wallet/util/wallet_types.py
CHANGED
|
@@ -4,7 +4,8 @@ from dataclasses import dataclass
|
|
|
4
4
|
from enum import IntEnum
|
|
5
5
|
from typing import TYPE_CHECKING, TypeVar
|
|
6
6
|
|
|
7
|
-
from
|
|
7
|
+
from chia_rs.sized_ints import uint8, uint32
|
|
8
|
+
|
|
8
9
|
from chia.util.streamable import Streamable, streamable
|
|
9
10
|
|
|
10
11
|
if TYPE_CHECKING:
|
|
@@ -26,8 +27,6 @@ class WalletType(IntEnum):
|
|
|
26
27
|
DATA_LAYER = 11
|
|
27
28
|
DATA_LAYER_OFFER = 12
|
|
28
29
|
VC = 13
|
|
29
|
-
DAO = 14
|
|
30
|
-
DAO_CAT = 15
|
|
31
30
|
CRCAT = 57
|
|
32
31
|
|
|
33
32
|
def to_json_dict(self) -> str:
|
|
@@ -6,20 +6,28 @@ from dataclasses import dataclass, replace
|
|
|
6
6
|
from enum import IntEnum
|
|
7
7
|
from typing import Optional, TypeVar
|
|
8
8
|
|
|
9
|
+
from chia_puzzles_py.programs import (
|
|
10
|
+
CONDITIONS_W_FEE_ANNOUNCE,
|
|
11
|
+
FLAG_PROOFS_CHECKER,
|
|
12
|
+
)
|
|
13
|
+
from chia_puzzles_py.programs import (
|
|
14
|
+
CREDENTIAL_RESTRICTION as CREDENTIAL_RESTRICTION_BYTES,
|
|
15
|
+
)
|
|
16
|
+
from chia_puzzles_py.programs import (
|
|
17
|
+
CREDENTIAL_RESTRICTION_HASH as CREDENTIAL_RESTRICTION_HASH_BYTES,
|
|
18
|
+
)
|
|
19
|
+
from chia_rs.sized_bytes import bytes32
|
|
20
|
+
from chia_rs.sized_ints import uint16, uint64
|
|
9
21
|
from clvm.casts import int_to_bytes
|
|
10
22
|
|
|
11
23
|
from chia.types.blockchain_format.coin import Coin, coin_as_list
|
|
12
24
|
from chia.types.blockchain_format.program import Program
|
|
13
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
14
25
|
from chia.types.coin_spend import CoinSpend, make_spend
|
|
15
26
|
from chia.util.hash import std_hash
|
|
16
|
-
from chia.util.ints import uint16, uint64
|
|
17
27
|
from chia.util.streamable import Streamable, streamable
|
|
18
28
|
from chia.wallet.cat_wallet.cat_utils import CAT_MOD, construct_cat_puzzle
|
|
19
|
-
from chia.wallet.conditions import AssertCoinAnnouncement
|
|
29
|
+
from chia.wallet.conditions import AssertCoinAnnouncement, CreateCoin
|
|
20
30
|
from chia.wallet.lineage_proof import LineageProof, LineageProofField
|
|
21
|
-
from chia.wallet.payment import Payment
|
|
22
|
-
from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile
|
|
23
31
|
from chia.wallet.puzzles.singleton_top_layer_v1_1 import SINGLETON_LAUNCHER_HASH, SINGLETON_MOD_HASH
|
|
24
32
|
from chia.wallet.uncurried_puzzle import UncurriedPuzzle, uncurry_puzzle
|
|
25
33
|
from chia.wallet.util.curry_and_treehash import curry_and_treehash
|
|
@@ -35,22 +43,10 @@ from chia.wallet.vc_wallet.vc_drivers import (
|
|
|
35
43
|
|
|
36
44
|
# Mods
|
|
37
45
|
|
|
38
|
-
CREDENTIAL_RESTRICTION: Program =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
)
|
|
43
|
-
CREDENTIAL_RESTRICTION_HASH: bytes32 = CREDENTIAL_RESTRICTION.get_tree_hash()
|
|
44
|
-
PROOF_FLAGS_CHECKER: Program = load_clvm_maybe_recompile(
|
|
45
|
-
"flag_proofs_checker.clsp",
|
|
46
|
-
package_or_requirement="chia.wallet.vc_wallet.cr_puzzles",
|
|
47
|
-
include_standard_libraries=True,
|
|
48
|
-
)
|
|
49
|
-
PENDING_VC_ANNOUNCEMENT: Program = load_clvm_maybe_recompile(
|
|
50
|
-
"conditions_w_fee_announce.clsp",
|
|
51
|
-
package_or_requirement="chia.wallet.vc_wallet.cr_puzzles",
|
|
52
|
-
include_standard_libraries=True,
|
|
53
|
-
)
|
|
46
|
+
CREDENTIAL_RESTRICTION: Program = Program.from_bytes(CREDENTIAL_RESTRICTION_BYTES)
|
|
47
|
+
CREDENTIAL_RESTRICTION_HASH: bytes32 = bytes32(CREDENTIAL_RESTRICTION_HASH_BYTES)
|
|
48
|
+
PROOF_FLAGS_CHECKER: Program = Program.from_bytes(FLAG_PROOFS_CHECKER)
|
|
49
|
+
PENDING_VC_ANNOUNCEMENT: Program = Program.from_bytes(CONDITIONS_W_FEE_ANNOUNCE)
|
|
54
50
|
CREDENTIAL_STRUCT: Program = Program.to(
|
|
55
51
|
(
|
|
56
52
|
(
|
|
@@ -186,7 +182,7 @@ class CRCAT:
|
|
|
186
182
|
cls: type[_T_CRCAT],
|
|
187
183
|
# General CAT launching info
|
|
188
184
|
origin_coin: Coin,
|
|
189
|
-
payment:
|
|
185
|
+
payment: CreateCoin,
|
|
190
186
|
tail: Program,
|
|
191
187
|
tail_solution: Program,
|
|
192
188
|
# CR Layer params
|
|
@@ -6,16 +6,16 @@ import traceback
|
|
|
6
6
|
from typing import TYPE_CHECKING, Any, Optional
|
|
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 uint8, uint32, uint64, uint128
|
|
9
11
|
from typing_extensions import Unpack
|
|
10
12
|
|
|
11
13
|
from chia.server.ws_connection import WSChiaConnection
|
|
12
14
|
from chia.types.blockchain_format.coin import Coin, coin_as_list
|
|
13
15
|
from chia.types.blockchain_format.program import Program
|
|
14
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
15
16
|
from chia.types.coin_spend import CoinSpend
|
|
16
17
|
from chia.util.byte_types import hexstr_to_bytes
|
|
17
18
|
from chia.util.hash import std_hash
|
|
18
|
-
from chia.util.ints import uint8, uint32, uint64, uint128
|
|
19
19
|
from chia.util.streamable import VersionedBlob
|
|
20
20
|
from chia.wallet.cat_wallet.cat_info import CATCoinData, CRCATInfo
|
|
21
21
|
from chia.wallet.cat_wallet.cat_utils import CAT_MOD_HASH, CAT_MOD_HASH_HASH, construct_cat_puzzle
|
|
@@ -24,6 +24,7 @@ from chia.wallet.coin_selection import select_coins
|
|
|
24
24
|
from chia.wallet.conditions import (
|
|
25
25
|
Condition,
|
|
26
26
|
ConditionValidTimes,
|
|
27
|
+
CreateCoin,
|
|
27
28
|
CreateCoinAnnouncement,
|
|
28
29
|
CreatePuzzleAnnouncement,
|
|
29
30
|
UnknownCondition,
|
|
@@ -31,7 +32,6 @@ from chia.wallet.conditions import (
|
|
|
31
32
|
)
|
|
32
33
|
from chia.wallet.lineage_proof import LineageProof
|
|
33
34
|
from chia.wallet.outer_puzzles import AssetType
|
|
34
|
-
from chia.wallet.payment import Payment
|
|
35
35
|
from chia.wallet.puzzle_drivers import PuzzleInfo
|
|
36
36
|
from chia.wallet.trading.offer import Offer
|
|
37
37
|
from chia.wallet.transaction_record import TransactionRecord
|
|
@@ -397,7 +397,7 @@ class CRCATWallet(CATWallet):
|
|
|
397
397
|
|
|
398
398
|
async def _generate_unsigned_spendbundle(
|
|
399
399
|
self,
|
|
400
|
-
payments: list[
|
|
400
|
+
payments: list[CreateCoin],
|
|
401
401
|
action_scope: WalletActionScope,
|
|
402
402
|
fee: uint64 = uint64(0),
|
|
403
403
|
cat_discrepancy: Optional[tuple[int, Program, Program]] = None, # (extra_delta, tail_reveal, tail_solution)
|
|
@@ -438,7 +438,7 @@ class CRCATWallet(CATWallet):
|
|
|
438
438
|
|
|
439
439
|
# Calculate standard puzzle solutions
|
|
440
440
|
change = selected_cat_amount - starting_amount
|
|
441
|
-
primaries: list[
|
|
441
|
+
primaries: list[CreateCoin] = []
|
|
442
442
|
for payment in payments:
|
|
443
443
|
primaries.append(payment)
|
|
444
444
|
|
|
@@ -462,7 +462,7 @@ class CRCATWallet(CATWallet):
|
|
|
462
462
|
break
|
|
463
463
|
else:
|
|
464
464
|
change_puzhash = await self.standard_wallet.get_puzzle_hash(new=True)
|
|
465
|
-
primaries.append(
|
|
465
|
+
primaries.append(CreateCoin(change_puzhash, uint64(change), [change_puzhash]))
|
|
466
466
|
|
|
467
467
|
# Find the VC Wallet
|
|
468
468
|
vc_wallet: VCWallet
|
|
@@ -585,8 +585,10 @@ class CRCATWallet(CATWallet):
|
|
|
585
585
|
)
|
|
586
586
|
if add_authorizations_to_cr_cats:
|
|
587
587
|
await vc_wallet.generate_signed_transaction(
|
|
588
|
-
|
|
588
|
+
[uint64(1)],
|
|
589
|
+
[await self.standard_wallet.get_puzzle_hash(new=not action_scope.config.tx_config.reuse_puzhash)],
|
|
589
590
|
action_scope,
|
|
591
|
+
vc_id=vc.launcher_id,
|
|
590
592
|
extra_conditions=(
|
|
591
593
|
*expected_announcements,
|
|
592
594
|
announcement,
|
|
@@ -622,7 +624,7 @@ class CRCATWallet(CATWallet):
|
|
|
622
624
|
memos_with_hint.extend(memo_list)
|
|
623
625
|
# Force wrap the outgoing coins in the pending state if not going to us
|
|
624
626
|
payments.append(
|
|
625
|
-
|
|
627
|
+
CreateCoin(
|
|
626
628
|
(
|
|
627
629
|
construct_pending_approval_state(puzhash, amount).get_tree_hash()
|
|
628
630
|
if puzhash != Offer.ph()
|
|
@@ -667,7 +669,7 @@ class CRCATWallet(CATWallet):
|
|
|
667
669
|
sent_to=[],
|
|
668
670
|
trade_id=None,
|
|
669
671
|
type=uint32(TransactionType.OUTGOING_TX.value),
|
|
670
|
-
name=spend_bundle.name() if i == 0 else payment.
|
|
672
|
+
name=spend_bundle.name() if i == 0 else payment.to_program().get_tree_hash(),
|
|
671
673
|
memos=list(compute_memos(spend_bundle).items()),
|
|
672
674
|
valid_times=parse_timelock_info(extra_conditions),
|
|
673
675
|
)
|
|
@@ -766,8 +768,10 @@ class CRCATWallet(CATWallet):
|
|
|
766
768
|
|
|
767
769
|
# Make the VC TX
|
|
768
770
|
await vc_wallet.generate_signed_transaction(
|
|
769
|
-
|
|
771
|
+
[uint64(1)],
|
|
772
|
+
[await self.standard_wallet.get_puzzle_hash(new=not action_scope.config.tx_config.reuse_puzhash)],
|
|
770
773
|
action_scope,
|
|
774
|
+
vc_id=vc.launcher_id,
|
|
771
775
|
extra_conditions=(
|
|
772
776
|
*extra_conditions,
|
|
773
777
|
*expected_announcements,
|
|
@@ -3,12 +3,12 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from typing import Any, Callable, Optional
|
|
5
5
|
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint64
|
|
6
8
|
from clvm_tools.binutils import disassemble
|
|
7
9
|
|
|
8
10
|
from chia.types.blockchain_format.coin import Coin
|
|
9
11
|
from chia.types.blockchain_format.program import Program
|
|
10
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
11
|
-
from chia.util.ints import uint64
|
|
12
12
|
from chia.wallet.puzzle_drivers import PuzzleInfo, Solver
|
|
13
13
|
from chia.wallet.uncurried_puzzle import UncurriedPuzzle, uncurry_puzzle
|
|
14
14
|
from chia.wallet.vc_wallet.cr_cat_drivers import PROOF_FLAGS_CHECKER, construct_cr_layer, match_cr_layer, solve_cr_layer
|