chia-blockchain 2.5.2rc2__py3-none-any.whl → 2.5.3rc1__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 +79 -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.3rc1.dist-info}/METADATA +3 -2
- chia_blockchain-2.5.3rc1.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.3rc1.dist-info}/LICENSE +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc1.dist-info}/WHEEL +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc1.dist-info}/entry_points.txt +0 -0
chia/_tests/util/setup_nodes.py
CHANGED
|
@@ -10,10 +10,12 @@ from pathlib import Path
|
|
|
10
10
|
from typing import Optional, Union
|
|
11
11
|
|
|
12
12
|
import anyio
|
|
13
|
+
from chia_rs import ConsensusConstants
|
|
14
|
+
from chia_rs.sized_bytes import bytes32
|
|
15
|
+
from chia_rs.sized_ints import uint16, uint32
|
|
13
16
|
|
|
14
17
|
from chia._tests.environments.full_node import FullNodeEnvironment
|
|
15
18
|
from chia._tests.environments.wallet import WalletEnvironment
|
|
16
|
-
from chia.consensus.constants import ConsensusConstants
|
|
17
19
|
from chia.daemon.server import WebSocketServer
|
|
18
20
|
from chia.farmer.farmer import Farmer
|
|
19
21
|
from chia.full_node.full_node_api import FullNodeAPI
|
|
@@ -39,10 +41,8 @@ from chia.simulator.setup_services import (
|
|
|
39
41
|
from chia.simulator.socket import find_available_listen_port
|
|
40
42
|
from chia.simulator.start_simulator import SimulatorFullNodeService
|
|
41
43
|
from chia.types.aliases import FarmerService, FullNodeService, HarvesterService, TimelordService, WalletService
|
|
42
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
43
44
|
from chia.types.peer_info import UnresolvedPeerInfo
|
|
44
45
|
from chia.util.hash import std_hash
|
|
45
|
-
from chia.util.ints import uint16, uint32
|
|
46
46
|
from chia.util.keychain import Keychain
|
|
47
47
|
from chia.util.timing import adjusted_timeout, backoff_times
|
|
48
48
|
from chia.wallet.wallet_node import WalletNode
|
|
@@ -390,6 +390,7 @@ async def setup_full_system_inner(
|
|
|
390
390
|
introducer_service = await async_exit_stack.enter_async_context(setup_introducer(shared_b_tools, uint16(0)))
|
|
391
391
|
introducer = introducer_service._api
|
|
392
392
|
introducer_server = introducer_service._node.server
|
|
393
|
+
introducer.introducer.dns_servers = []
|
|
393
394
|
|
|
394
395
|
# Then start the full node so we can use the port for the farmer and timelord
|
|
395
396
|
node_1 = await async_exit_stack.enter_async_context(
|
chia/_tests/util/spend_sim.py
CHANGED
|
@@ -10,11 +10,18 @@ from pathlib import Path
|
|
|
10
10
|
from typing import Any, Callable, Optional, TypeVar
|
|
11
11
|
|
|
12
12
|
import anyio
|
|
13
|
-
from chia_rs import
|
|
13
|
+
from chia_rs import (
|
|
14
|
+
DONT_VALIDATE_SIGNATURE,
|
|
15
|
+
ConsensusConstants,
|
|
16
|
+
G2Element,
|
|
17
|
+
get_flags_for_height_and_constants,
|
|
18
|
+
run_block_generator2,
|
|
19
|
+
)
|
|
20
|
+
from chia_rs.sized_bytes import bytes32
|
|
21
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
14
22
|
|
|
15
23
|
from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
|
|
16
24
|
from chia.consensus.coinbase import create_farmer_coin, create_pool_coin
|
|
17
|
-
from chia.consensus.constants import ConsensusConstants
|
|
18
25
|
from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
|
19
26
|
from chia.full_node.bundle_tools import simple_solution_generator
|
|
20
27
|
from chia.full_node.coin_store import CoinStore
|
|
@@ -24,7 +31,6 @@ from chia.full_node.mempool_check_conditions import get_puzzle_and_solution_for_
|
|
|
24
31
|
from chia.full_node.mempool_manager import MempoolManager
|
|
25
32
|
from chia.types.blockchain_format.coin import Coin
|
|
26
33
|
from chia.types.blockchain_format.program import INFINITE_COST
|
|
27
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
28
34
|
from chia.types.coin_record import CoinRecord
|
|
29
35
|
from chia.types.coin_spend import CoinSpend
|
|
30
36
|
from chia.types.generator_types import BlockGenerator
|
|
@@ -34,7 +40,6 @@ from chia.types.spend_bundle import SpendBundle, T_SpendBundle
|
|
|
34
40
|
from chia.util.db_wrapper import DBWrapper2
|
|
35
41
|
from chia.util.errors import Err, ValidationError
|
|
36
42
|
from chia.util.hash import std_hash
|
|
37
|
-
from chia.util.ints import uint32, uint64
|
|
38
43
|
from chia.util.streamable import Streamable, streamable
|
|
39
44
|
from chia.wallet.util.compute_hints import HintedCoin, compute_spend_hints_and_additions
|
|
40
45
|
|
|
@@ -271,7 +276,6 @@ class SpendSim:
|
|
|
271
276
|
if peak is not None:
|
|
272
277
|
result = await self.mempool_manager.create_bundle_from_mempool(
|
|
273
278
|
last_tb_header_hash=peak.header_hash,
|
|
274
|
-
get_unspent_lineage_info_for_puzzle_hash=self.coin_store.get_unspent_lineage_info_for_puzzle_hash,
|
|
275
279
|
item_inclusion_filter=item_inclusion_filter,
|
|
276
280
|
)
|
|
277
281
|
|
|
@@ -2,18 +2,18 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import pytest
|
|
4
4
|
from chia_rs import G1Element
|
|
5
|
+
from chia_rs.sized_bytes import bytes32
|
|
6
|
+
from chia_rs.sized_ints import uint64
|
|
5
7
|
from clvm.casts import int_to_bytes
|
|
6
8
|
|
|
7
9
|
from chia.types.blockchain_format.coin import Coin
|
|
8
10
|
from chia.types.blockchain_format.program import Program
|
|
9
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
10
11
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
11
12
|
from chia.types.condition_with_args import ConditionWithArgs
|
|
12
13
|
from chia.types.spend_bundle_conditions import SpendBundleConditions, SpendConditions
|
|
13
14
|
from chia.util.condition_tools import parse_sexp_to_conditions, pkm_pairs, pkm_pairs_for_conditions_dict
|
|
14
15
|
from chia.util.errors import ConsensusError
|
|
15
16
|
from chia.util.hash import std_hash
|
|
16
|
-
from chia.util.ints import uint64
|
|
17
17
|
|
|
18
18
|
H1 = bytes32(b"a" * 32)
|
|
19
19
|
H2 = bytes32(b"b" * 32)
|
chia/_tests/util/test_config.py
CHANGED
|
@@ -3,11 +3,12 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from typing import Any, Optional
|
|
5
5
|
|
|
6
|
+
from chia_rs.sized_ints import uint16
|
|
7
|
+
|
|
6
8
|
from chia._tests.util.misc import DataCase, Marks, datacases
|
|
7
9
|
from chia.server.outbound_message import NodeType
|
|
8
10
|
from chia.types.peer_info import UnresolvedPeerInfo
|
|
9
11
|
from chia.util.config import get_unresolved_peer_infos, set_peer_info
|
|
10
|
-
from chia.util.ints import uint16
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
@dataclass
|
chia/_tests/util/test_errors.py
CHANGED
|
@@ -5,15 +5,22 @@ from collections.abc import Generator, Iterator
|
|
|
5
5
|
from typing import Optional
|
|
6
6
|
|
|
7
7
|
import pytest
|
|
8
|
-
from chia_rs import
|
|
8
|
+
from chia_rs import (
|
|
9
|
+
Foliage,
|
|
10
|
+
FoliageBlockData,
|
|
11
|
+
FoliageTransactionBlock,
|
|
12
|
+
G1Element,
|
|
13
|
+
G2Element,
|
|
14
|
+
PoolTarget,
|
|
15
|
+
RewardChainBlock,
|
|
16
|
+
TransactionsInfo,
|
|
17
|
+
)
|
|
18
|
+
from chia_rs.sized_bytes import bytes32
|
|
19
|
+
from chia_rs.sized_ints import uint8, uint32, uint64, uint128
|
|
9
20
|
|
|
10
21
|
from chia._tests.util.benchmarks import rand_bytes, rand_g1, rand_g2, rand_hash, rand_vdf, rand_vdf_proof, rewards
|
|
11
|
-
from chia.types.blockchain_format.foliage import Foliage, FoliageBlockData, FoliageTransactionBlock, TransactionsInfo
|
|
12
|
-
from chia.types.blockchain_format.pool_target import PoolTarget
|
|
13
22
|
from chia.types.blockchain_format.proof_of_space import ProofOfSpace
|
|
14
|
-
from chia.types.blockchain_format.reward_chain_block import RewardChainBlock
|
|
15
23
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
16
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
17
24
|
from chia.types.blockchain_format.slots import (
|
|
18
25
|
ChallengeChainSubSlot,
|
|
19
26
|
InfusedChallengeChainSubSlot,
|
|
@@ -31,7 +38,6 @@ from chia.util.full_block_utils import (
|
|
|
31
38
|
header_block_from_block,
|
|
32
39
|
)
|
|
33
40
|
from chia.util.generator_tools import get_block_header
|
|
34
|
-
from chia.util.ints import uint8, uint32, uint64, uint128
|
|
35
41
|
|
|
36
42
|
test_g2s: list[G2Element] = [rand_g2() for _ in range(10)]
|
|
37
43
|
test_g1s: list[G1Element] = [rand_g1() for _ in range(10)]
|
|
@@ -261,7 +267,11 @@ async def test_parser():
|
|
|
261
267
|
assert height == block.height
|
|
262
268
|
assert is_tx_block == (block.transactions_info is not None)
|
|
263
269
|
gen = generator_from_block(block_bytes)
|
|
264
|
-
|
|
270
|
+
if gen is None:
|
|
271
|
+
assert block.transactions_generator is None
|
|
272
|
+
else:
|
|
273
|
+
assert block.transactions_generator is not None
|
|
274
|
+
assert gen == bytes(block.transactions_generator)
|
|
265
275
|
bi = block_info_from_block(block_bytes)
|
|
266
276
|
assert block.transactions_generator == bi.transactions_generator
|
|
267
277
|
assert block.prev_header_hash == bi.prev_header_hash
|
chia/_tests/util/test_misc.py
CHANGED
|
@@ -7,6 +7,7 @@ from typing import Optional, TypeVar
|
|
|
7
7
|
import aiohttp
|
|
8
8
|
import anyio
|
|
9
9
|
import pytest
|
|
10
|
+
from chia_rs.sized_ints import uint64
|
|
10
11
|
|
|
11
12
|
from chia._tests.util.misc import RecordingWebServer
|
|
12
13
|
from chia._tests.util.split_managers import SplitAsyncManager, SplitManager, split_async_manager, split_manager
|
|
@@ -16,7 +17,6 @@ from chia.types.blockchain_format.program import Program
|
|
|
16
17
|
from chia.types.transaction_queue_entry import ValuedEvent
|
|
17
18
|
from chia.util.batches import to_batches
|
|
18
19
|
from chia.util.errors import InvalidPathError
|
|
19
|
-
from chia.util.ints import uint64
|
|
20
20
|
from chia.util.timing import adjusted_timeout, backoff_times
|
|
21
21
|
|
|
22
22
|
T = TypeVar("T")
|
|
@@ -223,34 +223,34 @@ def test_missing_messages() -> None:
|
|
|
223
223
|
# if these asserts fail, make sure to add the new network protocol messages
|
|
224
224
|
# to the visitor in build_network_protocol_files.py and rerun it. Then
|
|
225
225
|
# update this test
|
|
226
|
-
assert (
|
|
227
|
-
|
|
228
|
-
)
|
|
226
|
+
assert types_in_module(wallet_protocol) == wallet_msgs, (
|
|
227
|
+
f"message types were added or removed from wallet_protocol. {STANDARD_ADVICE}"
|
|
228
|
+
)
|
|
229
229
|
|
|
230
|
-
assert (
|
|
231
|
-
|
|
232
|
-
)
|
|
230
|
+
assert types_in_module(farmer_protocol) == farmer_msgs, (
|
|
231
|
+
f"message types were added or removed from farmer_protocol. {STANDARD_ADVICE}"
|
|
232
|
+
)
|
|
233
233
|
|
|
234
|
-
assert (
|
|
235
|
-
|
|
236
|
-
)
|
|
234
|
+
assert types_in_module(full_node_protocol) == full_node_msgs, (
|
|
235
|
+
f"message types were added or removed from full_node_protocol. {STANDARD_ADVICE}"
|
|
236
|
+
)
|
|
237
237
|
|
|
238
|
-
assert (
|
|
239
|
-
|
|
240
|
-
)
|
|
238
|
+
assert types_in_module(harvester_protocol) == harvester_msgs, (
|
|
239
|
+
f"message types were added or removed from harvester_protocol. {STANDARD_ADVICE}"
|
|
240
|
+
)
|
|
241
241
|
|
|
242
|
-
assert (
|
|
243
|
-
|
|
244
|
-
)
|
|
242
|
+
assert types_in_module(introducer_protocol) == introducer_msgs, (
|
|
243
|
+
f"message types were added or removed from introducer_protocol. {STANDARD_ADVICE}"
|
|
244
|
+
)
|
|
245
245
|
|
|
246
|
-
assert (
|
|
247
|
-
|
|
248
|
-
)
|
|
246
|
+
assert types_in_module(pool_protocol) == pool_msgs, (
|
|
247
|
+
f"message types were added or removed from pool_protocol. {STANDARD_ADVICE}"
|
|
248
|
+
)
|
|
249
249
|
|
|
250
|
-
assert (
|
|
251
|
-
|
|
252
|
-
)
|
|
250
|
+
assert types_in_module(timelord_protocol) == timelord_msgs, (
|
|
251
|
+
f"message types were added or removed from timelord_protocol. {STANDARD_ADVICE}"
|
|
252
|
+
)
|
|
253
253
|
|
|
254
|
-
assert (
|
|
255
|
-
|
|
256
|
-
)
|
|
254
|
+
assert types_in_module(shared_protocol) == shared_msgs, (
|
|
255
|
+
f"message types were added or removed from shared_protocol. {STANDARD_ADVICE}"
|
|
256
|
+
)
|
|
@@ -2,11 +2,11 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import pytest
|
|
4
4
|
from chia_rs import ConsensusConstants
|
|
5
|
+
from chia_rs.sized_bytes import bytes32
|
|
6
|
+
from chia_rs.sized_ints import uint8, uint16, uint32, uint64, uint128
|
|
5
7
|
|
|
6
8
|
from chia.consensus.constants import replace_str_to_bytes
|
|
7
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
8
9
|
from chia.util.hash import std_hash
|
|
9
|
-
from chia.util.ints import uint8, uint16, uint32, uint64, uint128
|
|
10
10
|
|
|
11
11
|
AGG_SIG_DATA = bytes32.fromhex("ccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb")
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ import json
|
|
|
6
6
|
import logging
|
|
7
7
|
import pathlib
|
|
8
8
|
import time
|
|
9
|
-
from collections.abc import Iterable
|
|
9
|
+
from collections.abc import Awaitable, Iterable
|
|
10
10
|
from inspect import getframeinfo, stack
|
|
11
11
|
from pathlib import Path
|
|
12
12
|
from typing import TYPE_CHECKING, Any, Callable, ClassVar, Protocol, TypeVar, cast, final
|
|
@@ -15,6 +15,7 @@ import chia
|
|
|
15
15
|
import chia._tests
|
|
16
16
|
from chia._tests import ether
|
|
17
17
|
from chia.protocols.protocol_message_types import ProtocolMessageTypes
|
|
18
|
+
from chia.server.outbound_message import Message
|
|
18
19
|
from chia.util.timing import adjusted_timeout
|
|
19
20
|
|
|
20
21
|
log = logging.getLogger(__name__)
|
|
@@ -80,8 +81,14 @@ class TimeOutAssertData:
|
|
|
80
81
|
|
|
81
82
|
|
|
82
83
|
async def time_out_assert_custom_interval(
|
|
83
|
-
timeout: float,
|
|
84
|
-
|
|
84
|
+
timeout: float,
|
|
85
|
+
interval: float,
|
|
86
|
+
function: Callable[..., Any],
|
|
87
|
+
value: object = True,
|
|
88
|
+
*args: object,
|
|
89
|
+
stack_distance: int = 0,
|
|
90
|
+
**kwargs: object,
|
|
91
|
+
) -> None:
|
|
85
92
|
__tracebackhide__ = True
|
|
86
93
|
|
|
87
94
|
entry_file, entry_line = caller_file_and_line(
|
|
@@ -131,7 +138,9 @@ async def time_out_assert_custom_interval(
|
|
|
131
138
|
)
|
|
132
139
|
|
|
133
140
|
|
|
134
|
-
async def time_out_assert(
|
|
141
|
+
async def time_out_assert(
|
|
142
|
+
timeout: int, function: Callable[..., Any], value: object = True, *args: object, **kwargs: object
|
|
143
|
+
) -> None:
|
|
135
144
|
__tracebackhide__ = True
|
|
136
145
|
await time_out_assert_custom_interval(
|
|
137
146
|
timeout,
|
|
@@ -144,7 +153,9 @@ async def time_out_assert(timeout: int, function, value=True, *args, **kwargs):
|
|
|
144
153
|
)
|
|
145
154
|
|
|
146
155
|
|
|
147
|
-
async def time_out_assert_not_none(
|
|
156
|
+
async def time_out_assert_not_none(
|
|
157
|
+
timeout: float, function: Callable[..., Any], *args: object, **kwargs: object
|
|
158
|
+
) -> None:
|
|
148
159
|
# TODO: rework to leverage time_out_assert_custom_interval() such as by allowing
|
|
149
160
|
# value to be a callable
|
|
150
161
|
__tracebackhide__ = True
|
|
@@ -163,8 +174,10 @@ async def time_out_assert_not_none(timeout: float, function, *args, **kwargs):
|
|
|
163
174
|
assert False, "Timed assertion timed out"
|
|
164
175
|
|
|
165
176
|
|
|
166
|
-
def time_out_messages(
|
|
167
|
-
|
|
177
|
+
def time_out_messages(
|
|
178
|
+
incoming_queue: asyncio.Queue[Message], msg_name: str, count: int = 1
|
|
179
|
+
) -> Callable[[], Awaitable[bool]]:
|
|
180
|
+
async def bool_f() -> bool:
|
|
168
181
|
if incoming_queue.qsize() < count:
|
|
169
182
|
return False
|
|
170
183
|
for _ in range(count):
|
|
@@ -4,6 +4,7 @@ from typing import Optional
|
|
|
4
4
|
|
|
5
5
|
import pytest
|
|
6
6
|
from chia_rs import AugSchemeMPL, G2Element, PrivateKey
|
|
7
|
+
from chia_rs.sized_ints import uint64
|
|
7
8
|
from clvm.casts import int_to_bytes
|
|
8
9
|
|
|
9
10
|
from chia._tests.clvm.benchmark_costs import cost_of_spend_bundle
|
|
@@ -15,7 +16,6 @@ from chia.types.blockchain_format.program import Program
|
|
|
15
16
|
from chia.types.coin_spend import make_spend
|
|
16
17
|
from chia.types.mempool_inclusion_status import MempoolInclusionStatus
|
|
17
18
|
from chia.util.errors import Err
|
|
18
|
-
from chia.util.ints import uint64
|
|
19
19
|
from chia.wallet.cat_wallet.cat_utils import (
|
|
20
20
|
CAT_MOD,
|
|
21
21
|
SpendableCAT,
|
|
@@ -3,14 +3,14 @@ from __future__ import annotations
|
|
|
3
3
|
from typing import Optional
|
|
4
4
|
|
|
5
5
|
import pytest
|
|
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
12
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
11
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
12
13
|
from chia.types.coin_spend import make_spend
|
|
13
|
-
from chia.util.ints import uint64
|
|
14
14
|
from chia.wallet.cat_wallet.cat_utils import CAT_MOD, construct_cat_puzzle
|
|
15
15
|
from chia.wallet.outer_puzzles import construct_puzzle, get_inner_puzzle, get_inner_solution, match_puzzle, solve_puzzle
|
|
16
16
|
from chia.wallet.puzzle_drivers import PuzzleInfo, Solver
|
|
@@ -4,6 +4,8 @@ import tempfile
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
|
|
6
6
|
import pytest
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
8
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
7
9
|
|
|
8
10
|
from chia._tests.conftest import ConsensusMode
|
|
9
11
|
from chia._tests.environments.wallet import (
|
|
@@ -18,11 +20,9 @@ from chia.rpc.wallet_request_types import GetTransactionMemo, PushTX
|
|
|
18
20
|
from chia.simulator.simulator_protocol import ReorgProtocol
|
|
19
21
|
from chia.types.blockchain_format.coin import Coin, coin_as_list
|
|
20
22
|
from chia.types.blockchain_format.program import Program
|
|
21
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
22
23
|
from chia.types.coin_spend import make_spend
|
|
23
24
|
from chia.util.bech32m import encode_puzzle_hash
|
|
24
25
|
from chia.util.db_wrapper import DBWrapper2
|
|
25
|
-
from chia.util.ints import uint32, uint64
|
|
26
26
|
from chia.wallet.cat_wallet.cat_constants import DEFAULT_CATS
|
|
27
27
|
from chia.wallet.cat_wallet.cat_info import LegacyCATInfo
|
|
28
28
|
from chia.wallet.cat_wallet.cat_utils import CAT_MOD, construct_cat_puzzle
|
|
@@ -691,7 +691,7 @@ async def test_cat_doesnt_see_eve(wallet_environments: WalletTestFramework) -> N
|
|
|
691
691
|
|
|
692
692
|
cc2_ph = await cat_wallet_2.get_cat_puzzle_hash(new=False)
|
|
693
693
|
async with wallet.wallet_state_manager.new_action_scope(wallet_environments.tx_config, push=True) as action_scope:
|
|
694
|
-
await wallet.wallet_state_manager.main_wallet.generate_signed_transaction(uint64(10), cc2_ph, action_scope)
|
|
694
|
+
await wallet.wallet_state_manager.main_wallet.generate_signed_transaction([uint64(10)], [cc2_ph], action_scope)
|
|
695
695
|
|
|
696
696
|
await wallet_environments.process_pending_states(
|
|
697
697
|
[
|
|
@@ -1641,8 +1641,7 @@ async def test_cat_melt_balance(wallet_environments: WalletTestFramework) -> Non
|
|
|
1641
1641
|
|
|
1642
1642
|
from chia.simulator.simulator_protocol import GetAllCoinsProtocol
|
|
1643
1643
|
from chia.wallet.cat_wallet.cat_utils import SpendableCAT, unsigned_spend_bundle_for_spendable_cats
|
|
1644
|
-
from chia.wallet.conditions import UnknownCondition
|
|
1645
|
-
from chia.wallet.payment import Payment
|
|
1644
|
+
from chia.wallet.conditions import CreateCoin, UnknownCondition
|
|
1646
1645
|
|
|
1647
1646
|
await simulator.farm_blocks_to_puzzlehash(count=1, farm_to=CAT_w_ACS_HASH, guarantee_transaction_blocks=True)
|
|
1648
1647
|
await simulator.farm_blocks_to_puzzlehash(count=1)
|
|
@@ -1703,7 +1702,7 @@ async def test_cat_melt_balance(wallet_environments: WalletTestFramework) -> Non
|
|
|
1703
1702
|
limitations_program_hash=ACS_TAIL_HASH,
|
|
1704
1703
|
inner_puzzle=await cat_wallet.inner_puzzle_for_cat_puzhash(new_coin.puzzle_hash),
|
|
1705
1704
|
inner_solution=wallet.make_solution(
|
|
1706
|
-
primaries=[
|
|
1705
|
+
primaries=[CreateCoin(wallet_ph, uint64(tx_amount), [wallet_ph])],
|
|
1707
1706
|
conditions=(
|
|
1708
1707
|
UnknownCondition(
|
|
1709
1708
|
opcode=Program.to(51),
|
|
@@ -4,24 +4,23 @@ from typing import Any, Optional
|
|
|
4
4
|
|
|
5
5
|
import pytest
|
|
6
6
|
from chia_rs import G2Element
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
8
|
+
from chia_rs.sized_ints import uint64
|
|
7
9
|
|
|
8
10
|
from chia._tests.util.spend_sim import CostLogger, SimClient, SpendSim, sim_and_client
|
|
9
11
|
from chia.types.blockchain_format.coin import Coin
|
|
10
12
|
from chia.types.blockchain_format.program import Program
|
|
11
13
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
12
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
13
14
|
from chia.types.coin_spend import make_spend
|
|
14
15
|
from chia.types.mempool_inclusion_status import MempoolInclusionStatus
|
|
15
|
-
from chia.util.ints import uint64
|
|
16
16
|
from chia.wallet.cat_wallet.cat_utils import (
|
|
17
17
|
CAT_MOD,
|
|
18
18
|
SpendableCAT,
|
|
19
19
|
construct_cat_puzzle,
|
|
20
20
|
unsigned_spend_bundle_for_spendable_cats,
|
|
21
21
|
)
|
|
22
|
-
from chia.wallet.conditions import AssertPuzzleAnnouncement, ConditionValidTimes
|
|
22
|
+
from chia.wallet.conditions import AssertPuzzleAnnouncement, ConditionValidTimes, CreateCoin
|
|
23
23
|
from chia.wallet.outer_puzzles import AssetType
|
|
24
|
-
from chia.wallet.payment import Payment
|
|
25
24
|
from chia.wallet.puzzle_drivers import PuzzleInfo
|
|
26
25
|
from chia.wallet.trading.offer import OFFER_MOD, Offer
|
|
27
26
|
from chia.wallet.wallet_spend_bundle import WalletSpendBundle
|
|
@@ -60,7 +59,7 @@ async def generate_coins(
|
|
|
60
59
|
tail_hash = tail.get_tree_hash()
|
|
61
60
|
cat_puzzle = construct_cat_puzzle(CAT_MOD, tail_hash, acs)
|
|
62
61
|
cat_puzzle_hash = cat_puzzle.get_tree_hash()
|
|
63
|
-
payments.append(
|
|
62
|
+
payments.append(CreateCoin(cat_puzzle_hash, uint64(amount)))
|
|
64
63
|
cat_bundles.append(
|
|
65
64
|
unsigned_spend_bundle_for_spendable_cats(
|
|
66
65
|
CAT_MOD,
|
|
@@ -75,7 +74,7 @@ async def generate_coins(
|
|
|
75
74
|
)
|
|
76
75
|
)
|
|
77
76
|
else:
|
|
78
|
-
payments.append(
|
|
77
|
+
payments.append(CreateCoin(acs_ph, uint64(amount)))
|
|
79
78
|
|
|
80
79
|
# This bundle creates all of the initial coins
|
|
81
80
|
parent_bundle = WalletSpendBundle(
|
|
@@ -178,8 +177,11 @@ async def test_complex_offer(cost_logger: CostLogger) -> None:
|
|
|
178
177
|
driver_dict_as_infos = {key.hex(): value.info for key, value in driver_dict.items()}
|
|
179
178
|
|
|
180
179
|
# Create an XCH Offer for RED
|
|
181
|
-
chia_requested_payments: dict[Optional[bytes32], list[
|
|
182
|
-
str_to_tail_hash("red"): [
|
|
180
|
+
chia_requested_payments: dict[Optional[bytes32], list[CreateCoin]] = {
|
|
181
|
+
str_to_tail_hash("red"): [
|
|
182
|
+
CreateCoin(acs_ph, uint64(100), [b"memo"]),
|
|
183
|
+
CreateCoin(acs_ph, uint64(200), [b"memo"]),
|
|
184
|
+
]
|
|
183
185
|
}
|
|
184
186
|
chia_notarized_payments = Offer.notarize_payments(chia_requested_payments, chia_coins)
|
|
185
187
|
chia_announcements = Offer.calculate_announcements(chia_notarized_payments, driver_dict)
|
|
@@ -190,8 +192,8 @@ async def test_complex_offer(cost_logger: CostLogger) -> None:
|
|
|
190
192
|
# Create a RED Offer for XCH
|
|
191
193
|
red_coins_1 = red_coins[0:1]
|
|
192
194
|
red_coins_2 = red_coins[1:]
|
|
193
|
-
red_requested_payments: dict[Optional[bytes32], list[
|
|
194
|
-
None: [
|
|
195
|
+
red_requested_payments: dict[Optional[bytes32], list[CreateCoin]] = {
|
|
196
|
+
None: [CreateCoin(acs_ph, uint64(300), [b"red memo"]), CreateCoin(acs_ph, uint64(350), [b"red memo"])]
|
|
195
197
|
}
|
|
196
198
|
red_notarized_payments = Offer.notarize_payments(red_requested_payments, red_coins_1)
|
|
197
199
|
red_announcements = Offer.calculate_announcements(red_notarized_payments, driver_dict)
|
|
@@ -201,8 +203,8 @@ async def test_complex_offer(cost_logger: CostLogger) -> None:
|
|
|
201
203
|
red_offer = Offer(red_notarized_payments, red_secured_bundle, driver_dict)
|
|
202
204
|
assert not red_offer.is_valid()
|
|
203
205
|
|
|
204
|
-
red_requested_payments_2: dict[Optional[bytes32], list[
|
|
205
|
-
None: [
|
|
206
|
+
red_requested_payments_2: dict[Optional[bytes32], list[CreateCoin]] = {
|
|
207
|
+
None: [CreateCoin(acs_ph, uint64(50), [b"red memo"])]
|
|
206
208
|
}
|
|
207
209
|
red_notarized_payments_2 = Offer.notarize_payments(red_requested_payments_2, red_coins_2)
|
|
208
210
|
red_announcements_2 = Offer.calculate_announcements(red_notarized_payments_2, driver_dict)
|
|
@@ -219,9 +221,9 @@ async def test_complex_offer(cost_logger: CostLogger) -> None:
|
|
|
219
221
|
assert new_offer.is_valid()
|
|
220
222
|
|
|
221
223
|
# Create yet another offer of BLUE for XCH and RED
|
|
222
|
-
blue_requested_payments: dict[Optional[bytes32], list[
|
|
223
|
-
None: [
|
|
224
|
-
str_to_tail_hash("red"): [
|
|
224
|
+
blue_requested_payments: dict[Optional[bytes32], list[CreateCoin]] = {
|
|
225
|
+
None: [CreateCoin(acs_ph, uint64(200), [b"blue memo"])],
|
|
226
|
+
str_to_tail_hash("red"): [CreateCoin(acs_ph, uint64(50), [b"blue memo"])],
|
|
225
227
|
}
|
|
226
228
|
blue_notarized_payments = Offer.notarize_payments(blue_requested_payments, blue_coins)
|
|
227
229
|
blue_announcements = Offer.calculate_announcements(blue_notarized_payments, driver_dict)
|
|
@@ -5,6 +5,8 @@ from typing import Any, Union
|
|
|
5
5
|
|
|
6
6
|
import pytest
|
|
7
7
|
from chia_rs import G2Element
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
8
10
|
|
|
9
11
|
from chia._tests.conftest import SOFTFORK_HEIGHTS
|
|
10
12
|
from chia._tests.environments.wallet import WalletStateTransition, WalletTestFramework
|
|
@@ -16,11 +18,9 @@ from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
|
|
16
18
|
from chia.full_node.bundle_tools import simple_solution_generator
|
|
17
19
|
from chia.rpc.wallet_request_types import VCAddProofs, VCGetList, VCGetProofsForRoot, VCMint, VCSpend
|
|
18
20
|
from chia.types.blockchain_format.program import INFINITE_COST, Program
|
|
19
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
20
21
|
from chia.types.spend_bundle import SpendBundle
|
|
21
22
|
from chia.util.bech32m import encode_puzzle_hash
|
|
22
23
|
from chia.util.hash import std_hash
|
|
23
|
-
from chia.util.ints import uint32, uint64
|
|
24
24
|
from chia.wallet.cat_wallet.cat_wallet import CATWallet
|
|
25
25
|
from chia.wallet.conditions import CreateCoinAnnouncement, parse_conditions_non_consensus
|
|
26
26
|
from chia.wallet.did_wallet.did_wallet import DIDWallet
|
|
@@ -4,6 +4,8 @@ from typing import Optional
|
|
|
4
4
|
|
|
5
5
|
import pytest
|
|
6
6
|
from chia_rs import AugSchemeMPL, G1Element, G2Element, PrivateKey
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
8
|
+
from chia_rs.sized_ints import uint64
|
|
7
9
|
|
|
8
10
|
from chia._tests.clvm.benchmark_costs import cost_of_spend_bundle
|
|
9
11
|
from chia._tests.clvm.test_puzzles import public_key_for_index, secret_exponent_for_index
|
|
@@ -12,13 +14,11 @@ from chia._tests.util.spend_sim import CostLogger, SimClient, SpendSim, sim_and_
|
|
|
12
14
|
from chia._tests.util.time_out_assert import time_out_assert
|
|
13
15
|
from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
|
14
16
|
from chia.types.blockchain_format.program import INFINITE_COST, Program
|
|
15
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
16
17
|
from chia.types.coin_spend import CoinSpend, make_spend
|
|
17
18
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
18
19
|
from chia.types.mempool_inclusion_status import MempoolInclusionStatus
|
|
19
20
|
from chia.util.condition_tools import conditions_dict_for_solution, pkm_pairs_for_conditions_dict
|
|
20
21
|
from chia.util.errors import Err
|
|
21
|
-
from chia.util.ints import uint64
|
|
22
22
|
from chia.util.streamable import VersionedBlob
|
|
23
23
|
from chia.wallet.puzzles.clawback.drivers import (
|
|
24
24
|
create_augmented_cond_puzzle_hash,
|
|
@@ -3,13 +3,13 @@ from __future__ import annotations
|
|
|
3
3
|
import random
|
|
4
4
|
|
|
5
5
|
import pytest
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint64
|
|
6
8
|
|
|
7
9
|
from chia.server.server import ChiaServer
|
|
8
10
|
from chia.simulator.block_tools import BlockTools
|
|
9
11
|
from chia.simulator.full_node_simulator import FullNodeSimulator
|
|
10
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
11
12
|
from chia.types.peer_info import PeerInfo
|
|
12
|
-
from chia.util.ints import uint64
|
|
13
13
|
from chia.wallet.puzzles.clawback.metadata import ClawbackMetadata
|
|
14
14
|
from chia.wallet.wallet_node import WalletNode
|
|
15
15
|
|
chia/_tests/wallet/conftest.py
CHANGED
|
@@ -10,23 +10,23 @@ from typing import Any, Callable, Literal, Optional
|
|
|
10
10
|
import pytest
|
|
11
11
|
from chia_rs import (
|
|
12
12
|
DONT_VALIDATE_SIGNATURE,
|
|
13
|
+
ConsensusConstants,
|
|
13
14
|
SpendBundleConditions,
|
|
14
15
|
get_flags_for_height_and_constants,
|
|
15
16
|
run_block_generator,
|
|
16
17
|
run_block_generator2,
|
|
17
18
|
)
|
|
19
|
+
from chia_rs.sized_bytes import bytes32
|
|
20
|
+
from chia_rs.sized_ints import uint32, uint64, uint128
|
|
18
21
|
|
|
19
22
|
from chia._tests.environments.wallet import NewPuzzleHashError, WalletEnvironment, WalletState, WalletTestFramework
|
|
20
23
|
from chia._tests.util.setup_nodes import setup_simulators_and_wallets_service
|
|
21
24
|
from chia._tests.wallet.wallet_block_tools import WalletBlockTools
|
|
22
|
-
from chia.consensus.constants import ConsensusConstants
|
|
23
25
|
from chia.full_node.full_node import FullNode
|
|
24
26
|
from chia.rpc.full_node_rpc_client import FullNodeRpcClient
|
|
25
27
|
from chia.rpc.wallet_rpc_client import WalletRpcClient
|
|
26
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
27
28
|
from chia.types.full_block import FullBlock
|
|
28
29
|
from chia.types.peer_info import PeerInfo
|
|
29
|
-
from chia.util.ints import uint32, uint64, uint128
|
|
30
30
|
from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG, TXConfig
|
|
31
31
|
from chia.wallet.wallet_node import Balance
|
|
32
32
|
from chia.wallet.wallet_state_manager import WalletStateManager
|
|
@@ -2,20 +2,18 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import pytest
|
|
4
4
|
from chia_rs import G2Element
|
|
5
|
+
from chia_rs.sized_bytes import bytes32
|
|
5
6
|
|
|
6
7
|
from chia._tests.util.spend_sim import CostLogger, sim_and_client
|
|
7
8
|
from chia.types.blockchain_format.coin import Coin
|
|
8
9
|
from chia.types.blockchain_format.program import Program
|
|
9
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
10
10
|
from chia.types.coin_spend import make_spend
|
|
11
11
|
from chia.types.mempool_inclusion_status import MempoolInclusionStatus
|
|
12
12
|
from chia.util.errors import Err
|
|
13
|
-
from chia.wallet.
|
|
13
|
+
from chia.wallet.db_wallet.db_wallet_puzzles import GRAFTROOT_DL_OFFERS
|
|
14
14
|
from chia.wallet.util.merkle_utils import build_merkle_tree, build_merkle_tree_from_binary_tree, simplify_merkle_proof
|
|
15
15
|
from chia.wallet.wallet_spend_bundle import WalletSpendBundle
|
|
16
16
|
|
|
17
|
-
GRAFTROOT_MOD = load_clvm("graftroot_dl_offers.clsp", package_or_requirement="chia.data_layer.puzzles")
|
|
18
|
-
|
|
19
17
|
# Always returns the last value
|
|
20
18
|
# (mod solution
|
|
21
19
|
#
|
|
@@ -46,7 +44,7 @@ async def test_graftroot(cost_logger: CostLogger) -> None:
|
|
|
46
44
|
desired_key_values = ((bytes32.zeros, bytes32([1] * 32)), (bytes32([7] * 32), bytes32([8] * 32)))
|
|
47
45
|
desired_row_hashes: list[bytes32] = [build_merkle_tree_from_binary_tree(kv)[0] for kv in desired_key_values]
|
|
48
46
|
fake_struct: Program = Program.to((ACS_PH, NIL_PH))
|
|
49
|
-
graftroot_puzzle: Program =
|
|
47
|
+
graftroot_puzzle: Program = GRAFTROOT_DL_OFFERS.curry(
|
|
50
48
|
# Do everything twice to test depending on multiple singleton updates
|
|
51
49
|
p2_conditions,
|
|
52
50
|
[fake_struct, fake_struct],
|
|
@@ -3,11 +3,11 @@ from __future__ import annotations
|
|
|
3
3
|
from typing import Any
|
|
4
4
|
|
|
5
5
|
import pytest
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint64
|
|
6
8
|
|
|
7
9
|
from chia._tests.util.time_out_assert import time_out_assert
|
|
8
10
|
from chia.data_layer.data_layer_wallet import DataLayerWallet
|
|
9
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
10
|
-
from chia.util.ints import uint64
|
|
11
11
|
from chia.wallet.puzzle_drivers import Solver
|
|
12
12
|
from chia.wallet.trade_record import TradeRecord
|
|
13
13
|
from chia.wallet.trading.offer import Offer
|