chia-blockchain 2.5.0rc1__py3-none-any.whl → 2.5.1__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/_tests/README.md +1 -1
- chia/_tests/blockchain/blockchain_test_utils.py +24 -26
- chia/_tests/blockchain/test_augmented_chain.py +6 -8
- chia/_tests/blockchain/test_blockchain.py +409 -307
- chia/_tests/blockchain/test_blockchain_transactions.py +56 -75
- chia/_tests/blockchain/test_build_chains.py +11 -13
- chia/_tests/blockchain/test_get_block_generator.py +8 -8
- chia/_tests/blockchain/test_lookup_fork_chain.py +3 -4
- chia/_tests/build-init-files.py +3 -4
- chia/_tests/build-job-matrix.py +9 -9
- chia/_tests/check_sql_statements.py +2 -3
- chia/_tests/clvm/benchmark_costs.py +1 -1
- chia/_tests/clvm/coin_store.py +7 -5
- chia/_tests/clvm/test_chialisp_deserialization.py +8 -8
- chia/_tests/clvm/test_condition_codes.py +2 -2
- chia/_tests/clvm/test_curry_and_treehash.py +2 -4
- chia/_tests/clvm/test_message_conditions.py +184 -0
- chia/_tests/clvm/test_puzzle_compression.py +1 -2
- chia/_tests/clvm/test_puzzle_drivers.py +3 -3
- chia/_tests/clvm/test_puzzles.py +13 -18
- chia/_tests/clvm/test_singletons.py +17 -17
- chia/_tests/clvm/test_spend_sim.py +7 -7
- chia/_tests/cmds/cmd_test_utils.py +42 -45
- chia/_tests/cmds/conftest.py +2 -2
- chia/_tests/cmds/test_click_types.py +21 -16
- chia/_tests/cmds/test_cmd_framework.py +255 -35
- chia/_tests/cmds/test_cmds_util.py +2 -2
- chia/_tests/cmds/test_daemon.py +3 -3
- chia/_tests/cmds/test_dev_gh.py +131 -0
- chia/_tests/cmds/test_farm_cmd.py +1 -2
- chia/_tests/cmds/test_show.py +6 -6
- chia/_tests/cmds/test_tx_config_args.py +2 -1
- chia/_tests/cmds/wallet/test_dao.py +23 -23
- chia/_tests/cmds/wallet/test_did.py +29 -29
- chia/_tests/cmds/wallet/test_nft.py +24 -23
- chia/_tests/cmds/wallet/test_notifications.py +8 -8
- chia/_tests/cmds/wallet/test_tx_decorators.py +3 -3
- chia/_tests/cmds/wallet/test_vcs.py +97 -73
- chia/_tests/cmds/wallet/test_wallet.py +74 -75
- chia/_tests/cmds/wallet/test_wallet_check.py +5 -7
- chia/_tests/conftest.py +153 -38
- chia/_tests/connection_utils.py +7 -6
- chia/_tests/core/cmds/test_beta.py +3 -3
- chia/_tests/core/cmds/test_keys.py +6 -6
- chia/_tests/core/cmds/test_wallet.py +3 -3
- chia/_tests/core/consensus/test_block_creation.py +3 -5
- chia/_tests/core/custom_types/test_coin.py +1 -3
- chia/_tests/core/custom_types/test_spend_bundle.py +3 -4
- chia/_tests/core/daemon/test_daemon.py +58 -58
- chia/_tests/core/daemon/test_keychain_proxy.py +2 -1
- chia/_tests/core/data_layer/conftest.py +4 -3
- chia/_tests/core/data_layer/test_data_cli.py +1 -2
- chia/_tests/core/data_layer/test_data_layer.py +5 -5
- chia/_tests/core/data_layer/test_data_layer_util.py +8 -9
- chia/_tests/core/data_layer/test_data_rpc.py +75 -93
- chia/_tests/core/data_layer/test_data_store.py +38 -37
- chia/_tests/core/data_layer/test_data_store_schema.py +11 -11
- chia/_tests/core/data_layer/util.py +11 -10
- chia/_tests/core/farmer/test_farmer_api.py +6 -4
- chia/_tests/core/full_node/full_sync/test_full_sync.py +5 -10
- chia/_tests/core/full_node/ram_db.py +2 -2
- chia/_tests/core/full_node/stores/test_block_store.py +113 -11
- chia/_tests/core/full_node/stores/test_coin_store.py +37 -28
- chia/_tests/core/full_node/stores/test_full_node_store.py +34 -30
- chia/_tests/core/full_node/stores/test_hint_store.py +3 -4
- chia/_tests/core/full_node/test_address_manager.py +2 -2
- chia/_tests/core/full_node/test_block_height_map.py +1 -1
- chia/_tests/core/full_node/test_conditions.py +10 -12
- chia/_tests/core/full_node/test_full_node.py +2077 -1822
- chia/_tests/core/full_node/test_generator_tools.py +4 -4
- chia/_tests/core/full_node/test_hint_management.py +2 -2
- chia/_tests/core/full_node/test_performance.py +2 -5
- chia/_tests/core/full_node/test_subscriptions.py +4 -4
- chia/_tests/core/full_node/test_tx_processing_queue.py +5 -4
- chia/_tests/core/make_block_generator.py +5 -7
- chia/_tests/core/mempool/test_mempool.py +205 -208
- chia/_tests/core/mempool/test_mempool_fee_protocol.py +5 -5
- chia/_tests/core/mempool/test_mempool_item_queries.py +2 -4
- chia/_tests/core/mempool/test_mempool_manager.py +109 -80
- chia/_tests/core/mempool/test_mempool_performance.py +3 -4
- chia/_tests/core/mempool/test_singleton_fast_forward.py +12 -12
- chia/_tests/core/server/flood.py +6 -4
- chia/_tests/core/server/serve.py +10 -7
- chia/_tests/core/server/test_api_protocol.py +21 -0
- chia/_tests/core/server/test_capabilities.py +3 -5
- chia/_tests/core/server/test_dos.py +15 -16
- chia/_tests/core/server/test_loop.py +14 -10
- chia/_tests/core/server/test_node_discovery.py +1 -2
- chia/_tests/core/server/test_rate_limits.py +156 -44
- chia/_tests/core/server/test_server.py +8 -7
- chia/_tests/core/services/test_services.py +59 -37
- chia/_tests/core/ssl/test_ssl.py +5 -3
- chia/_tests/core/test_cost_calculation.py +5 -6
- chia/_tests/core/test_crawler.py +2 -2
- chia/_tests/core/test_db_conversion.py +5 -4
- chia/_tests/core/test_db_validation.py +6 -5
- chia/_tests/core/test_farmer_harvester_rpc.py +8 -7
- chia/_tests/core/test_filter.py +3 -5
- chia/_tests/core/test_full_node_rpc.py +64 -90
- chia/_tests/core/test_merkle_set.py +10 -10
- chia/_tests/core/test_program.py +2 -4
- chia/_tests/core/test_rpc_util.py +1 -2
- chia/_tests/core/test_seeder.py +124 -12
- chia/_tests/core/util/test_block_cache.py +5 -5
- chia/_tests/core/util/test_cached_bls.py +3 -3
- chia/_tests/core/util/test_config.py +13 -13
- chia/_tests/core/util/test_files.py +2 -2
- chia/_tests/core/util/test_jsonify.py +9 -9
- chia/_tests/core/util/test_keychain.py +13 -5
- chia/_tests/core/util/test_keyring_wrapper.py +6 -5
- chia/_tests/core/util/test_log_exceptions.py +3 -3
- chia/_tests/core/util/test_streamable.py +38 -38
- chia/_tests/db/test_db_wrapper.py +13 -12
- chia/_tests/environments/common.py +2 -2
- chia/_tests/environments/full_node.py +2 -2
- chia/_tests/environments/wallet.py +109 -48
- chia/_tests/farmer_harvester/test_farmer.py +35 -35
- chia/_tests/farmer_harvester/test_farmer_harvester.py +17 -17
- chia/_tests/farmer_harvester/test_filter_prefix_bits.py +6 -5
- chia/_tests/farmer_harvester/test_third_party_harvesters.py +73 -46
- chia/_tests/fee_estimation/test_fee_estimation_integration.py +8 -8
- chia/_tests/fee_estimation/test_fee_estimation_rpc.py +47 -47
- chia/_tests/fee_estimation/test_fee_estimation_unit_tests.py +6 -7
- chia/_tests/fee_estimation/test_mempoolitem_height_added.py +11 -11
- chia/_tests/generator/test_compression.py +13 -30
- chia/_tests/generator/test_generator_types.py +3 -3
- chia/_tests/generator/test_rom.py +7 -9
- chia/_tests/plot_sync/test_delta.py +2 -3
- chia/_tests/plot_sync/test_plot_sync.py +25 -24
- chia/_tests/plot_sync/test_receiver.py +9 -9
- chia/_tests/plot_sync/test_sender.py +1 -1
- chia/_tests/plot_sync/test_sync_simulated.py +27 -26
- chia/_tests/plot_sync/util.py +2 -1
- chia/_tests/plotting/test_plot_manager.py +54 -11
- chia/_tests/plotting/util.py +2 -3
- chia/_tests/pools/test_pool_cli_parsing.py +128 -0
- chia/_tests/pools/test_pool_cmdline.py +993 -15
- chia/_tests/pools/test_pool_config.py +3 -5
- chia/_tests/pools/test_pool_puzzles_lifecycle.py +10 -11
- chia/_tests/pools/test_pool_rpc.py +203 -90
- chia/_tests/pools/test_pool_wallet.py +12 -8
- chia/_tests/pools/test_wallet_pool_store.py +3 -3
- chia/_tests/process_junit.py +16 -17
- chia/_tests/rpc/test_rpc_client.py +59 -2
- chia/_tests/rpc/test_rpc_server.py +183 -0
- chia/_tests/simulation/test_simulation.py +5 -5
- chia/_tests/simulation/test_simulator.py +8 -10
- chia/_tests/simulation/test_start_simulator.py +5 -4
- chia/_tests/timelord/test_new_peak.py +19 -19
- chia/_tests/tools/test_run_block.py +1 -2
- chia/_tests/tools/test_virtual_project.py +591 -0
- chia/_tests/util/benchmark_cost.py +9 -9
- chia/_tests/util/benchmarks.py +1 -2
- chia/_tests/util/blockchain.py +12 -11
- chia/_tests/util/blockchain_mock.py +15 -15
- chia/_tests/util/build_network_protocol_files.py +12 -12
- chia/_tests/util/db_connection.py +3 -2
- chia/_tests/util/full_sync.py +14 -6
- chia/_tests/util/gen_ssl_certs.py +4 -5
- chia/_tests/util/generator_tools_testing.py +5 -7
- chia/_tests/util/get_name_puzzle_conditions.py +52 -0
- chia/_tests/util/key_tool.py +2 -3
- chia/_tests/util/misc.py +59 -106
- chia/_tests/util/network_protocol_data.py +7 -9
- chia/_tests/util/protocol_messages_json.py +112 -111
- chia/_tests/util/rpc.py +3 -0
- chia/_tests/util/run_block.py +16 -16
- chia/_tests/util/setup_nodes.py +25 -23
- chia/{clvm → _tests/util}/spend_sim.py +59 -55
- chia/_tests/util/split_managers.py +12 -9
- chia/_tests/util/temp_file.py +1 -1
- chia/_tests/util/test_action_scope.py +2 -1
- chia/_tests/util/test_async_pool.py +8 -8
- chia/_tests/util/test_build_job_matrix.py +2 -3
- chia/_tests/util/test_condition_tools.py +4 -6
- chia/_tests/util/test_config.py +5 -5
- chia/_tests/util/test_dump_keyring.py +1 -1
- chia/_tests/util/test_full_block_utils.py +19 -11
- chia/_tests/util/test_limited_semaphore.py +4 -3
- chia/_tests/util/test_logging_filter.py +2 -3
- chia/_tests/util/test_misc.py +29 -28
- chia/_tests/util/test_network.py +32 -31
- chia/_tests/util/test_network_protocol_files.py +2 -3
- chia/_tests/util/test_network_protocol_json.py +1 -0
- chia/_tests/util/test_network_protocol_test.py +18 -19
- chia/_tests/util/test_paginator.py +3 -4
- chia/_tests/util/test_pprint.py +1 -1
- chia/_tests/util/test_priority_mutex.py +18 -17
- chia/_tests/util/test_recursive_replace.py +2 -2
- chia/_tests/util/test_testnet_overrides.py +3 -3
- chia/_tests/util/test_timing.py +1 -1
- chia/_tests/util/test_trusted_peer.py +2 -2
- chia/_tests/util/time_out_assert.py +43 -6
- chia/_tests/wallet/cat_wallet/test_cat_lifecycle.py +13 -13
- chia/_tests/wallet/cat_wallet/test_cat_outer_puzzle.py +1 -1
- chia/_tests/wallet/cat_wallet/test_cat_wallet.py +117 -29
- chia/_tests/wallet/cat_wallet/test_offer_lifecycle.py +15 -15
- chia/_tests/wallet/cat_wallet/test_trades.py +50 -28
- chia/_tests/wallet/clawback/test_clawback_decorator.py +3 -5
- chia/_tests/wallet/clawback/test_clawback_lifecycle.py +6 -6
- chia/_tests/wallet/clawback/test_clawback_metadata.py +1 -2
- chia/_tests/wallet/conftest.py +135 -74
- chia/_tests/wallet/dao_wallet/test_dao_clvm.py +25 -17
- chia/_tests/wallet/dao_wallet/test_dao_wallets.py +75 -75
- chia/_tests/wallet/db_wallet/test_db_graftroot.py +10 -12
- chia/_tests/wallet/db_wallet/test_dl_offers.py +6 -6
- chia/_tests/wallet/db_wallet/test_dl_wallet.py +18 -18
- chia/_tests/wallet/did_wallet/test_did.py +1277 -474
- chia/_tests/wallet/nft_wallet/test_nft_1_offers.py +12 -11
- chia/_tests/wallet/nft_wallet/test_nft_bulk_mint.py +115 -105
- chia/_tests/wallet/nft_wallet/test_nft_lifecycle.py +6 -7
- chia/_tests/wallet/nft_wallet/test_nft_offers.py +16 -16
- chia/_tests/wallet/nft_wallet/test_nft_puzzles.py +3 -3
- chia/_tests/wallet/nft_wallet/test_nft_wallet.py +38 -12
- chia/_tests/wallet/nft_wallet/test_ownership_outer_puzzle.py +1 -1
- chia/_tests/wallet/rpc/test_dl_wallet_rpc.py +31 -33
- chia/_tests/wallet/rpc/test_wallet_rpc.py +218 -171
- chia/_tests/wallet/simple_sync/test_simple_sync_protocol.py +36 -37
- chia/_tests/wallet/sync/test_wallet_sync.py +241 -78
- chia/_tests/wallet/test_address_type.py +20 -20
- chia/_tests/wallet/test_clvm_streamable.py +5 -5
- chia/_tests/wallet/test_coin_management.py +354 -0
- chia/_tests/wallet/test_coin_selection.py +34 -35
- chia/_tests/wallet/test_conditions.py +28 -16
- chia/_tests/wallet/test_debug_spend_bundle.py +156 -14
- chia/_tests/wallet/test_new_wallet_protocol.py +29 -31
- chia/_tests/wallet/test_nft_store.py +1 -2
- chia/_tests/wallet/test_notifications.py +2 -2
- chia/_tests/wallet/test_offer_parsing_performance.py +1 -1
- chia/_tests/wallet/test_puzzle_store.py +2 -3
- chia/_tests/wallet/test_sign_coin_spends.py +3 -3
- chia/_tests/wallet/test_signer_protocol.py +33 -34
- chia/_tests/wallet/test_singleton_lifecycle_fast.py +29 -29
- chia/_tests/wallet/test_taproot.py +1 -1
- chia/_tests/wallet/test_transaction_store.py +23 -19
- chia/_tests/wallet/test_util.py +36 -32
- chia/_tests/wallet/test_wallet.py +37 -37
- chia/_tests/wallet/test_wallet_action_scope.py +8 -8
- chia/_tests/wallet/test_wallet_blockchain.py +4 -6
- chia/_tests/wallet/test_wallet_coin_store.py +34 -34
- chia/_tests/wallet/test_wallet_node.py +69 -72
- chia/_tests/wallet/test_wallet_retry.py +3 -3
- chia/_tests/wallet/test_wallet_state_manager.py +12 -5
- chia/_tests/wallet/test_wallet_trade_store.py +2 -2
- chia/_tests/wallet/test_wallet_utils.py +5 -4
- chia/_tests/wallet/vc_wallet/test_cr_outer_puzzle.py +3 -3
- chia/_tests/wallet/vc_wallet/test_vc_lifecycle.py +18 -18
- chia/_tests/wallet/vc_wallet/test_vc_wallet.py +69 -40
- chia/_tests/wallet/wallet_block_tools.py +27 -27
- chia/_tests/weight_proof/test_weight_proof.py +30 -30
- chia/apis.py +19 -0
- chia/cmds/beta.py +8 -7
- chia/cmds/beta_funcs.py +15 -11
- chia/cmds/check_wallet_db.py +29 -27
- chia/cmds/chia.py +17 -9
- chia/cmds/cmd_classes.py +87 -79
- chia/cmds/cmd_helpers.py +242 -0
- chia/cmds/cmds_util.py +56 -66
- chia/cmds/coin_funcs.py +168 -153
- chia/cmds/coins.py +156 -194
- chia/cmds/configure.py +4 -3
- chia/cmds/dao.py +89 -33
- chia/cmds/dao_funcs.py +55 -33
- chia/cmds/data.py +7 -6
- chia/cmds/data_funcs.py +26 -21
- chia/cmds/db.py +4 -3
- chia/cmds/db_backup_func.py +2 -2
- chia/cmds/db_upgrade_func.py +3 -3
- chia/cmds/db_validate_func.py +2 -2
- chia/cmds/dev.py +2 -0
- chia/cmds/farm.py +18 -5
- chia/cmds/farm_funcs.py +17 -24
- chia/cmds/gh.py +275 -0
- chia/cmds/init.py +4 -11
- chia/cmds/init_funcs.py +9 -9
- chia/cmds/installers.py +5 -3
- chia/cmds/keys.py +56 -39
- chia/cmds/keys_funcs.py +30 -31
- chia/cmds/netspace.py +6 -3
- chia/cmds/netspace_funcs.py +3 -2
- chia/cmds/param_types.py +16 -6
- chia/cmds/passphrase.py +8 -7
- chia/cmds/passphrase_funcs.py +7 -61
- chia/cmds/peer.py +2 -1
- chia/cmds/peer_funcs.py +5 -5
- chia/cmds/plotnft.py +207 -153
- chia/cmds/plotnft_funcs.py +205 -174
- chia/cmds/plots.py +14 -6
- chia/cmds/plotters.py +2 -1
- chia/cmds/rpc.py +48 -28
- chia/cmds/show.py +2 -1
- chia/cmds/show_funcs.py +7 -6
- chia/cmds/signer.py +50 -58
- chia/cmds/sim.py +22 -14
- chia/cmds/sim_funcs.py +11 -11
- chia/cmds/start.py +3 -3
- chia/cmds/start_funcs.py +9 -12
- chia/cmds/stop.py +4 -3
- chia/cmds/units.py +1 -3
- chia/cmds/wallet.py +252 -96
- chia/cmds/wallet_funcs.py +217 -143
- chia/consensus/block_body_validation.py +133 -86
- chia/consensus/block_creation.py +42 -21
- chia/consensus/block_header_validation.py +32 -37
- chia/consensus/block_record.py +1 -2
- chia/consensus/blockchain.py +167 -180
- chia/consensus/blockchain_interface.py +10 -10
- chia/consensus/constants.py +2 -2
- chia/consensus/default_constants.py +3 -4
- chia/consensus/difficulty_adjustment.py +5 -5
- chia/consensus/find_fork_point.py +5 -5
- chia/consensus/full_block_to_block_record.py +4 -4
- chia/consensus/get_block_challenge.py +2 -2
- chia/consensus/get_block_generator.py +4 -3
- chia/consensus/multiprocess_validation.py +207 -304
- chia/consensus/vdf_info_computation.py +3 -3
- chia/daemon/client.py +46 -27
- chia/daemon/keychain_proxy.py +10 -9
- chia/daemon/keychain_server.py +18 -18
- chia/daemon/server.py +103 -113
- chia/daemon/windows_signal.py +2 -2
- chia/data_layer/data_layer.py +64 -76
- chia/data_layer/data_layer_api.py +8 -0
- chia/data_layer/data_layer_errors.py +3 -3
- chia/data_layer/data_layer_server.py +2 -2
- chia/data_layer/data_layer_util.py +71 -71
- chia/data_layer/data_layer_wallet.py +63 -67
- chia/data_layer/data_store.py +72 -72
- chia/data_layer/dl_wallet_store.py +10 -10
- chia/data_layer/download_data.py +5 -5
- chia/data_layer/s3_plugin_service.py +9 -9
- chia/data_layer/util/benchmark.py +0 -1
- chia/data_layer/util/plugin.py +2 -3
- chia/farmer/farmer.py +46 -43
- chia/farmer/farmer_api.py +27 -21
- chia/full_node/block_height_map.py +6 -6
- chia/full_node/block_store.py +41 -35
- chia/full_node/coin_store.py +42 -41
- chia/full_node/fee_estimate.py +2 -2
- chia/full_node/fee_estimation.py +1 -2
- chia/full_node/fee_history.py +5 -6
- chia/full_node/fee_tracker.py +24 -24
- chia/full_node/full_node.py +574 -300
- chia/full_node/full_node_api.py +181 -130
- chia/full_node/full_node_store.py +43 -43
- chia/full_node/hint_management.py +4 -4
- chia/full_node/hint_store.py +9 -10
- chia/full_node/mempool.py +25 -19
- chia/full_node/mempool_check_conditions.py +11 -42
- chia/full_node/mempool_manager.py +48 -53
- chia/full_node/pending_tx_cache.py +9 -9
- chia/full_node/subscriptions.py +23 -24
- chia/full_node/sync_store.py +8 -7
- chia/full_node/tx_processing_queue.py +3 -3
- chia/full_node/util/__init__.py +0 -0
- chia/full_node/weight_proof.py +79 -78
- chia/harvester/harvester.py +9 -8
- chia/harvester/harvester_api.py +19 -13
- chia/introducer/introducer.py +7 -5
- chia/introducer/introducer_api.py +9 -3
- chia/legacy/keyring.py +6 -5
- chia/plot_sync/delta.py +8 -8
- chia/plot_sync/receiver.py +12 -11
- chia/plot_sync/sender.py +15 -12
- chia/plotters/bladebit.py +12 -12
- chia/plotters/chiapos.py +2 -2
- chia/plotters/madmax.py +8 -8
- chia/plotters/plotters.py +6 -6
- chia/plotters/plotters_util.py +6 -4
- chia/plotting/cache.py +8 -7
- chia/plotting/check_plots.py +8 -8
- chia/plotting/create_plots.py +6 -6
- chia/plotting/manager.py +22 -22
- chia/plotting/util.py +31 -19
- chia/pools/pool_config.py +7 -7
- chia/pools/pool_puzzles.py +16 -16
- chia/pools/pool_wallet.py +64 -57
- chia/pools/pool_wallet_info.py +3 -3
- chia/protocols/full_node_protocol.py +3 -3
- chia/protocols/harvester_protocol.py +12 -12
- chia/protocols/introducer_protocol.py +1 -2
- chia/protocols/protocol_message_types.py +4 -4
- chia/protocols/protocol_state_machine.py +2 -2
- chia/protocols/protocol_timing.py +1 -0
- chia/protocols/shared_protocol.py +3 -3
- chia/protocols/timelord_protocol.py +2 -2
- chia/protocols/wallet_protocol.py +33 -33
- chia/rpc/crawler_rpc_api.py +12 -7
- chia/rpc/data_layer_rpc_api.py +49 -44
- chia/rpc/data_layer_rpc_client.py +41 -41
- chia/rpc/data_layer_rpc_util.py +7 -11
- chia/rpc/farmer_rpc_api.py +32 -27
- chia/rpc/farmer_rpc_client.py +14 -14
- chia/rpc/full_node_rpc_api.py +53 -48
- chia/rpc/full_node_rpc_client.py +30 -30
- chia/rpc/harvester_rpc_api.py +16 -11
- chia/rpc/harvester_rpc_client.py +6 -6
- chia/rpc/rpc_client.py +34 -14
- chia/rpc/rpc_server.py +117 -43
- chia/rpc/timelord_rpc_api.py +9 -4
- chia/rpc/util.py +11 -211
- chia/rpc/wallet_request_types.py +276 -60
- chia/rpc/wallet_rpc_api.py +563 -399
- chia/rpc/wallet_rpc_client.py +220 -250
- chia/seeder/crawl_store.py +6 -8
- chia/seeder/crawler.py +23 -36
- chia/seeder/crawler_api.py +28 -22
- chia/seeder/dns_server.py +99 -50
- chia/seeder/start_crawler.py +13 -9
- chia/server/address_manager.py +19 -19
- chia/server/address_manager_store.py +17 -17
- chia/server/api_protocol.py +106 -1
- chia/server/capabilities.py +3 -3
- chia/server/chia_policy.py +17 -16
- chia/server/introducer_peers.py +3 -3
- chia/server/node_discovery.py +34 -38
- chia/server/rate_limit_numbers.py +26 -16
- chia/server/rate_limits.py +67 -27
- chia/server/server.py +52 -31
- chia/server/signal_handlers.py +6 -3
- chia/server/ssl_context.py +5 -5
- chia/server/start_data_layer.py +37 -23
- chia/server/start_farmer.py +28 -16
- chia/server/start_full_node.py +29 -23
- chia/server/start_harvester.py +28 -15
- chia/server/start_introducer.py +27 -15
- chia/server/start_service.py +17 -29
- chia/server/start_timelord.py +25 -18
- chia/server/start_wallet.py +22 -18
- chia/server/upnp.py +4 -3
- chia/server/ws_connection.py +68 -54
- chia/simulator/add_blocks_in_batches.py +54 -0
- chia/simulator/block_tools.py +65 -64
- chia/simulator/full_node_simulator.py +66 -74
- chia/simulator/setup_services.py +10 -9
- chia/simulator/simulator_full_node_rpc_api.py +12 -14
- chia/simulator/simulator_full_node_rpc_client.py +3 -5
- chia/simulator/simulator_test_tools.py +8 -7
- chia/simulator/socket.py +1 -4
- chia/simulator/ssl_certs.py +5 -5
- chia/simulator/ssl_certs_1.py +2 -4
- chia/simulator/ssl_certs_10.py +2 -4
- chia/simulator/ssl_certs_2.py +2 -4
- chia/simulator/ssl_certs_3.py +2 -4
- chia/simulator/ssl_certs_4.py +2 -4
- chia/simulator/ssl_certs_5.py +2 -4
- chia/simulator/ssl_certs_6.py +2 -4
- chia/simulator/ssl_certs_7.py +2 -4
- chia/simulator/ssl_certs_8.py +2 -4
- chia/simulator/ssl_certs_9.py +2 -4
- chia/simulator/start_simulator.py +14 -6
- chia/simulator/wallet_tools.py +21 -20
- chia/ssl/create_ssl.py +11 -11
- chia/timelord/iters_from_block.py +2 -2
- chia/timelord/timelord.py +57 -33
- chia/timelord/timelord_api.py +12 -6
- chia/timelord/timelord_launcher.py +10 -8
- chia/timelord/timelord_state.py +5 -5
- chia/types/block_protocol.py +2 -2
- chia/types/blockchain_format/coin.py +3 -3
- chia/types/blockchain_format/program.py +17 -18
- chia/types/blockchain_format/tree_hash.py +9 -9
- chia/types/coin_spend.py +8 -8
- chia/types/condition_with_args.py +1 -2
- chia/types/eligible_coin_spends.py +16 -15
- chia/types/generator_types.py +1 -2
- chia/types/internal_mempool_item.py +1 -2
- chia/types/mempool_item.py +7 -7
- chia/types/mempool_submission_status.py +2 -2
- chia/types/peer_info.py +1 -1
- chia/types/spend_bundle.py +1 -2
- chia/types/transaction_queue_entry.py +2 -2
- chia/types/unfinished_header_block.py +2 -2
- chia/types/validation_state.py +14 -0
- chia/types/weight_proof.py +5 -6
- chia/util/action_scope.py +8 -8
- chia/util/async_pool.py +6 -4
- chia/util/augmented_chain.py +13 -9
- chia/util/batches.py +5 -2
- chia/util/bech32m.py +14 -11
- chia/util/beta_metrics.py +5 -4
- chia/util/block_cache.py +5 -5
- chia/util/byte_types.py +2 -0
- chia/util/check_fork_next_block.py +3 -2
- chia/util/chia_logging.py +41 -21
- chia/util/collection.py +3 -3
- chia/util/condition_tools.py +18 -18
- chia/util/config.py +26 -25
- chia/util/cpu.py +2 -0
- chia/util/db_synchronous.py +2 -0
- chia/util/db_version.py +2 -0
- chia/util/db_wrapper.py +13 -10
- chia/util/default_root.py +17 -0
- chia/util/dump_keyring.py +6 -6
- chia/util/errors.py +5 -3
- chia/util/file_keyring.py +22 -33
- chia/util/files.py +2 -0
- chia/util/full_block_utils.py +31 -7
- chia/util/generator_tools.py +18 -8
- chia/util/hash.py +3 -1
- chia/util/initial-config.yaml +19 -0
- chia/util/inline_executor.py +2 -0
- chia/util/ip_address.py +39 -0
- chia/util/json_util.py +0 -4
- chia/util/keychain.py +27 -24
- chia/util/keyring_wrapper.py +65 -4
- chia/util/limited_semaphore.py +3 -1
- chia/util/lock.py +4 -2
- chia/util/log_exceptions.py +5 -2
- chia/util/logging.py +3 -1
- chia/util/lru_cache.py +2 -0
- chia/util/math.py +4 -4
- chia/util/network.py +15 -73
- chia/util/paginator.py +3 -1
- chia/util/path.py +2 -0
- chia/util/permissions.py +3 -2
- chia/util/prev_transaction_block.py +1 -3
- chia/util/priority_mutex.py +6 -3
- chia/util/profiler.py +7 -4
- chia/util/recursive_replace.py +2 -0
- chia/util/safe_cancel_task.py +2 -0
- chia/util/service_groups.py +2 -2
- chia/util/setproctitle.py +2 -0
- chia/util/significant_bits.py +2 -0
- chia/util/ssl_check.py +11 -11
- chia/util/streamable.py +44 -56
- chia/util/task_referencer.py +59 -0
- chia/util/task_timing.py +22 -18
- chia/util/timing.py +4 -1
- chia/util/vdf_prover.py +2 -3
- chia/util/virtual_project_analysis.py +540 -0
- chia/util/ws_message.py +6 -6
- chia/wallet/cat_wallet/cat_info.py +3 -3
- chia/wallet/cat_wallet/cat_outer_puzzle.py +3 -3
- chia/wallet/cat_wallet/cat_utils.py +5 -4
- chia/wallet/cat_wallet/cat_wallet.py +56 -70
- chia/wallet/cat_wallet/dao_cat_info.py +3 -3
- chia/wallet/cat_wallet/dao_cat_wallet.py +18 -18
- chia/wallet/cat_wallet/lineage_store.py +2 -2
- chia/wallet/coin_selection.py +15 -15
- chia/wallet/conditions.py +257 -71
- chia/wallet/dao_wallet/dao_info.py +4 -4
- chia/wallet/dao_wallet/dao_utils.py +43 -42
- chia/wallet/dao_wallet/dao_wallet.py +66 -68
- chia/wallet/db_wallet/db_wallet_puzzles.py +12 -8
- chia/wallet/derive_keys.py +11 -11
- chia/wallet/did_wallet/did_info.py +3 -3
- chia/wallet/did_wallet/did_wallet.py +56 -47
- chia/wallet/did_wallet/did_wallet_puzzles.py +7 -6
- chia/wallet/lineage_proof.py +4 -4
- chia/wallet/nft_wallet/metadata_outer_puzzle.py +2 -2
- chia/wallet/nft_wallet/nft_info.py +4 -4
- chia/wallet/nft_wallet/nft_puzzles.py +16 -16
- chia/wallet/nft_wallet/nft_wallet.py +90 -89
- chia/wallet/nft_wallet/ownership_outer_puzzle.py +2 -2
- chia/wallet/nft_wallet/singleton_outer_puzzle.py +2 -2
- chia/wallet/nft_wallet/transfer_program_puzzle.py +2 -2
- chia/wallet/nft_wallet/uncurry_nft.py +2 -2
- chia/wallet/notification_manager.py +5 -5
- chia/wallet/notification_store.py +6 -6
- chia/wallet/outer_puzzles.py +2 -2
- chia/wallet/payment.py +4 -5
- chia/wallet/puzzle_drivers.py +4 -4
- chia/wallet/puzzles/clawback/drivers.py +5 -5
- chia/wallet/puzzles/clawback/puzzle_decorator.py +7 -7
- chia/wallet/puzzles/load_clvm.py +2 -3
- chia/wallet/puzzles/p2_conditions.py +1 -2
- chia/wallet/puzzles/p2_delegated_conditions.py +1 -2
- chia/wallet/puzzles/p2_delegated_puzzle.py +2 -3
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py +3 -4
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.py +1 -2
- chia/wallet/puzzles/p2_puzzle_hash.py +1 -2
- chia/wallet/puzzles/puzzle_utils.py +7 -7
- chia/wallet/puzzles/singleton_top_layer.py +6 -5
- chia/wallet/puzzles/singleton_top_layer_v1_1.py +6 -5
- chia/wallet/puzzles/tails.py +34 -30
- chia/wallet/signer_protocol.py +7 -8
- chia/wallet/singleton.py +4 -4
- chia/wallet/trade_manager.py +155 -141
- chia/wallet/trade_record.py +5 -5
- chia/wallet/trading/offer.py +100 -101
- chia/wallet/trading/trade_store.py +14 -14
- chia/wallet/transaction_record.py +31 -16
- chia/wallet/util/address_type.py +4 -4
- chia/wallet/util/blind_signer_tl.py +8 -12
- chia/wallet/util/clvm_streamable.py +15 -15
- chia/wallet/util/compute_hints.py +5 -5
- chia/wallet/util/compute_memos.py +4 -6
- chia/wallet/util/curry_and_treehash.py +3 -2
- chia/wallet/util/debug_spend_bundle.py +6 -8
- chia/wallet/util/merkle_tree.py +10 -10
- chia/wallet/util/merkle_utils.py +10 -10
- chia/wallet/util/new_peak_queue.py +3 -3
- chia/wallet/util/peer_request_cache.py +8 -8
- chia/{util → wallet/util}/pprint.py +2 -3
- chia/wallet/util/puzzle_compression.py +3 -4
- chia/wallet/util/puzzle_decorator.py +10 -10
- chia/wallet/util/query_filter.py +9 -10
- chia/wallet/util/tx_config.py +12 -12
- chia/wallet/util/wallet_sync_utils.py +24 -21
- chia/wallet/util/wallet_types.py +9 -2
- chia/wallet/vc_wallet/cr_cat_drivers.py +28 -27
- chia/wallet/vc_wallet/cr_cat_wallet.py +42 -40
- chia/wallet/vc_wallet/cr_outer_puzzle.py +4 -4
- chia/wallet/vc_wallet/vc_drivers.py +16 -16
- chia/wallet/vc_wallet/vc_store.py +9 -9
- chia/wallet/vc_wallet/vc_wallet.py +35 -35
- chia/wallet/wallet.py +54 -54
- chia/wallet/wallet_action_scope.py +14 -13
- chia/wallet/wallet_blockchain.py +10 -10
- chia/wallet/wallet_coin_record.py +2 -2
- chia/wallet/wallet_coin_store.py +10 -10
- chia/wallet/wallet_info.py +1 -2
- chia/wallet/wallet_interested_store.py +5 -5
- chia/wallet/wallet_nft_store.py +6 -6
- chia/wallet/wallet_node.py +72 -76
- chia/wallet/wallet_node_api.py +33 -27
- chia/wallet/wallet_pool_store.py +1 -2
- chia/wallet/wallet_protocol.py +15 -15
- chia/wallet/wallet_puzzle_store.py +35 -4
- chia/wallet/wallet_retry_store.py +2 -2
- chia/wallet/wallet_singleton_store.py +10 -9
- chia/wallet/wallet_spend_bundle.py +4 -20
- chia/wallet/wallet_state_manager.py +223 -224
- chia/wallet/wallet_transaction_store.py +44 -18
- chia/wallet/wallet_user_store.py +2 -2
- chia/wallet/wallet_weight_proof_handler.py +2 -2
- {chia_blockchain-2.5.0rc1.dist-info → chia_blockchain-2.5.1.dist-info}/LICENSE +1 -1
- {chia_blockchain-2.5.0rc1.dist-info → chia_blockchain-2.5.1.dist-info}/METADATA +67 -72
- chia_blockchain-2.5.1.dist-info/RECORD +1042 -0
- {chia_blockchain-2.5.0rc1.dist-info → chia_blockchain-2.5.1.dist-info}/WHEEL +1 -1
- mozilla-ca/cacert.pem +32 -87
- chia/_tests/cmds/wallet/test_coins.py +0 -195
- chia/consensus/block_root_validation.py +0 -46
- chia/util/api_decorators.py +0 -89
- chia_blockchain-2.5.0rc1.dist-info/RECORD +0 -1028
- {chia_blockchain-2.5.0rc1.dist-info → chia_blockchain-2.5.1.dist-info}/entry_points.txt +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
|
+
import contextlib
|
|
4
5
|
import time
|
|
5
|
-
from typing import Any, Callable,
|
|
6
|
+
from typing import Any, Callable, Optional, Union
|
|
6
7
|
|
|
7
8
|
import pytest
|
|
8
9
|
|
|
@@ -32,17 +33,17 @@ from chia.wallet.transaction_record import TransactionRecord
|
|
|
32
33
|
from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG
|
|
33
34
|
|
|
34
35
|
|
|
35
|
-
async def get_proposal_state(wallet: DAOWallet, index: int) ->
|
|
36
|
+
async def get_proposal_state(wallet: DAOWallet, index: int) -> tuple[Optional[bool], Optional[bool]]:
|
|
36
37
|
return wallet.dao_info.proposals_list[index].passed, wallet.dao_info.proposals_list[index].closed
|
|
37
38
|
|
|
38
39
|
|
|
39
40
|
async def rpc_state(
|
|
40
41
|
timeout: float,
|
|
41
42
|
async_function: Callable[[Any], Any],
|
|
42
|
-
params:
|
|
43
|
-
condition_func: Callable[[
|
|
43
|
+
params: list[Union[int, dict[str, Any]]],
|
|
44
|
+
condition_func: Callable[[dict[str, Any]], Any],
|
|
44
45
|
result: Optional[Any] = None,
|
|
45
|
-
) -> Union[bool,
|
|
46
|
+
) -> Union[bool, dict[str, Any]]: # pragma: no cover
|
|
46
47
|
__tracebackhide__ = True
|
|
47
48
|
|
|
48
49
|
timeout = adjusted_timeout(timeout=timeout)
|
|
@@ -221,7 +222,7 @@ async def test_dao_creation(self_hostname: str, two_wallet_nodes: OldSimulatorsA
|
|
|
221
222
|
coins = await dao_cat_wallet_0.advanced_select_coins(1, fake_proposal_id)
|
|
222
223
|
assert len(coins) > 0
|
|
223
224
|
# check that we have selected the coin from dao_cat_wallet
|
|
224
|
-
assert
|
|
225
|
+
assert coins[0].coin.amount == dao_cat_amt
|
|
225
226
|
|
|
226
227
|
# send some cats from wallet_0 to wallet_1 so we can test voting
|
|
227
228
|
async with cat_wallet_0.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
@@ -1031,7 +1032,7 @@ async def test_dao_proposal_partial_vote(
|
|
|
1031
1032
|
await full_node_api.wait_for_wallets_synced(wallet_nodes=[wallet_node_0, wallet_node_1], timeout=30)
|
|
1032
1033
|
|
|
1033
1034
|
# Create a mint proposal
|
|
1034
|
-
recipient_puzzle_hash = await cat_wallet_1.
|
|
1035
|
+
recipient_puzzle_hash = await cat_wallet_1.standard_wallet.get_puzzle_hash(new=False)
|
|
1035
1036
|
new_mint_amount = uint64(500)
|
|
1036
1037
|
mint_proposal_inner = await generate_mint_proposal_innerpuz(
|
|
1037
1038
|
treasury_id,
|
|
@@ -1103,7 +1104,7 @@ async def test_dao_proposal_partial_vote(
|
|
|
1103
1104
|
await time_out_assert(20, cat_wallet_1.get_spendable_balance, balance + new_mint_amount)
|
|
1104
1105
|
# Can we spend the newly minted CATs?
|
|
1105
1106
|
old_balance = await cat_wallet_0.get_spendable_balance()
|
|
1106
|
-
ph_0 = await cat_wallet_0.
|
|
1107
|
+
ph_0 = await cat_wallet_0.standard_wallet.get_puzzle_hash(new=False)
|
|
1107
1108
|
async with cat_wallet_1.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
1108
1109
|
await cat_wallet_1.generate_signed_transaction([balance + new_mint_amount], [ph_0], action_scope)
|
|
1109
1110
|
await full_node_api.process_transaction_records(records=action_scope.side_effects.transactions)
|
|
@@ -1626,7 +1627,7 @@ async def test_dao_rpc_api(self_hostname: str, two_wallet_nodes: Any, trusted: A
|
|
|
1626
1627
|
async def test_dao_rpc_client(
|
|
1627
1628
|
two_wallet_nodes_services: SimulatorsAndWalletsServices, trusted: bool, self_hostname: str
|
|
1628
1629
|
) -> None:
|
|
1629
|
-
[full_node_service], wallet_services,
|
|
1630
|
+
[full_node_service], wallet_services, _bt = two_wallet_nodes_services
|
|
1630
1631
|
full_node_api = full_node_service._api
|
|
1631
1632
|
full_node_server = full_node_api.full_node.server
|
|
1632
1633
|
wallet_node_0 = wallet_services[0]._node
|
|
@@ -1661,22 +1662,26 @@ async def test_dao_rpc_client(
|
|
|
1661
1662
|
assert wallet_services[0].rpc_server is not None
|
|
1662
1663
|
assert wallet_services[1].rpc_server is not None
|
|
1663
1664
|
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
wallet_services[
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1665
|
+
async with contextlib.AsyncExitStack() as exit_stack:
|
|
1666
|
+
client_0 = await exit_stack.enter_async_context(
|
|
1667
|
+
WalletRpcClient.create_as_context(
|
|
1668
|
+
self_hostname,
|
|
1669
|
+
wallet_services[0].rpc_server.listen_port,
|
|
1670
|
+
wallet_services[0].root_path,
|
|
1671
|
+
wallet_services[0].config,
|
|
1672
|
+
)
|
|
1673
|
+
)
|
|
1674
|
+
await validate_get_routes(client_0, wallet_services[0].rpc_server.rpc_api)
|
|
1675
|
+
client_1 = await exit_stack.enter_async_context(
|
|
1676
|
+
WalletRpcClient.create_as_context(
|
|
1677
|
+
self_hostname,
|
|
1678
|
+
wallet_services[1].rpc_server.listen_port,
|
|
1679
|
+
wallet_services[1].root_path,
|
|
1680
|
+
wallet_services[1].config,
|
|
1681
|
+
)
|
|
1682
|
+
)
|
|
1683
|
+
await validate_get_routes(client_1, wallet_services[1].rpc_server.rpc_api)
|
|
1678
1684
|
|
|
1679
|
-
try:
|
|
1680
1685
|
cat_amt = uint64(150000)
|
|
1681
1686
|
amount_of_cats = uint64(cat_amt * 2)
|
|
1682
1687
|
dao_rules = DAORules(
|
|
@@ -2000,12 +2005,6 @@ async def test_dao_rpc_client(
|
|
|
2000
2005
|
filter_amount_resp = await client_0.dao_adjust_filter_level(wallet_id=dao_id_0, filter_level=30)
|
|
2001
2006
|
assert filter_amount_resp["dao_info"]["filter_below_vote_amount"] == 30
|
|
2002
2007
|
|
|
2003
|
-
finally:
|
|
2004
|
-
client_0.close()
|
|
2005
|
-
client_1.close()
|
|
2006
|
-
await client_0.await_closed()
|
|
2007
|
-
await client_1.await_closed()
|
|
2008
|
-
|
|
2009
2008
|
|
|
2010
2009
|
@pytest.mark.limit_consensus_modes(reason="does not depend on consensus rules")
|
|
2011
2010
|
@pytest.mark.parametrize(
|
|
@@ -2016,7 +2015,7 @@ async def test_dao_rpc_client(
|
|
|
2016
2015
|
async def test_dao_complex_spends(
|
|
2017
2016
|
two_wallet_nodes_services: SimulatorsAndWalletsServices, trusted: bool, self_hostname: str
|
|
2018
2017
|
) -> None:
|
|
2019
|
-
[full_node_service], wallet_services,
|
|
2018
|
+
[full_node_service], wallet_services, _bt = two_wallet_nodes_services
|
|
2020
2019
|
full_node_api = full_node_service._api
|
|
2021
2020
|
full_node_server = full_node_api.full_node.server
|
|
2022
2021
|
wallet_node_0 = wallet_services[0]._node
|
|
@@ -2051,22 +2050,26 @@ async def test_dao_complex_spends(
|
|
|
2051
2050
|
assert wallet_services[0].rpc_server is not None
|
|
2052
2051
|
assert wallet_services[1].rpc_server is not None
|
|
2053
2052
|
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
wallet_services[
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2053
|
+
async with contextlib.AsyncExitStack() as exit_stack:
|
|
2054
|
+
client_0 = await exit_stack.enter_async_context(
|
|
2055
|
+
WalletRpcClient.create_as_context(
|
|
2056
|
+
self_hostname,
|
|
2057
|
+
wallet_services[0].rpc_server.listen_port,
|
|
2058
|
+
wallet_services[0].root_path,
|
|
2059
|
+
wallet_services[0].config,
|
|
2060
|
+
)
|
|
2061
|
+
)
|
|
2062
|
+
await validate_get_routes(client_0, wallet_services[0].rpc_server.rpc_api)
|
|
2063
|
+
client_1 = await exit_stack.enter_async_context(
|
|
2064
|
+
WalletRpcClient.create_as_context(
|
|
2065
|
+
self_hostname,
|
|
2066
|
+
wallet_services[1].rpc_server.listen_port,
|
|
2067
|
+
wallet_services[1].root_path,
|
|
2068
|
+
wallet_services[1].config,
|
|
2069
|
+
)
|
|
2070
|
+
)
|
|
2071
|
+
await validate_get_routes(client_1, wallet_services[1].rpc_server.rpc_api)
|
|
2068
2072
|
|
|
2069
|
-
try:
|
|
2070
2073
|
cat_amt = uint64(300000)
|
|
2071
2074
|
dao_rules = DAORules(
|
|
2072
2075
|
proposal_timelock=uint64(2),
|
|
@@ -2380,12 +2383,6 @@ async def test_dao_complex_spends(
|
|
|
2380
2383
|
1,
|
|
2381
2384
|
)
|
|
2382
2385
|
|
|
2383
|
-
finally:
|
|
2384
|
-
client_0.close()
|
|
2385
|
-
client_1.close()
|
|
2386
|
-
await client_0.await_closed()
|
|
2387
|
-
await client_1.await_closed()
|
|
2388
|
-
|
|
2389
2386
|
|
|
2390
2387
|
@pytest.mark.limit_consensus_modes(reason="does not depend on consensus rules")
|
|
2391
2388
|
@pytest.mark.parametrize(
|
|
@@ -2617,7 +2614,7 @@ async def test_dao_concurrency(self_hostname: str, three_wallet_nodes: OldSimula
|
|
|
2617
2614
|
async def test_dao_cat_exits(
|
|
2618
2615
|
two_wallet_nodes_services: SimulatorsAndWalletsServices, trusted: bool, self_hostname: str
|
|
2619
2616
|
) -> None:
|
|
2620
|
-
[full_node_service], wallet_services,
|
|
2617
|
+
[full_node_service], wallet_services, _bt = two_wallet_nodes_services
|
|
2621
2618
|
full_node_api = full_node_service._api
|
|
2622
2619
|
full_node_server = full_node_api.full_node.server
|
|
2623
2620
|
wallet_node_0 = wallet_services[0]._node
|
|
@@ -2651,22 +2648,26 @@ async def test_dao_cat_exits(
|
|
|
2651
2648
|
assert wallet_services[0].rpc_server is not None
|
|
2652
2649
|
assert wallet_services[1].rpc_server is not None
|
|
2653
2650
|
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
wallet_services[
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2651
|
+
async with contextlib.AsyncExitStack() as exit_stack:
|
|
2652
|
+
client_0 = await exit_stack.enter_async_context(
|
|
2653
|
+
WalletRpcClient.create_as_context(
|
|
2654
|
+
self_hostname,
|
|
2655
|
+
wallet_services[0].rpc_server.listen_port,
|
|
2656
|
+
wallet_services[0].root_path,
|
|
2657
|
+
wallet_services[0].config,
|
|
2658
|
+
)
|
|
2659
|
+
)
|
|
2660
|
+
await validate_get_routes(client_0, wallet_services[0].rpc_server.rpc_api)
|
|
2661
|
+
client_1 = await exit_stack.enter_async_context(
|
|
2662
|
+
WalletRpcClient.create_as_context(
|
|
2663
|
+
self_hostname,
|
|
2664
|
+
wallet_services[1].rpc_server.listen_port,
|
|
2665
|
+
wallet_services[1].root_path,
|
|
2666
|
+
wallet_services[1].config,
|
|
2667
|
+
)
|
|
2668
|
+
)
|
|
2669
|
+
await validate_get_routes(client_1, wallet_services[1].rpc_server.rpc_api)
|
|
2668
2670
|
|
|
2669
|
-
try:
|
|
2670
2671
|
cat_amt = uint64(150000)
|
|
2671
2672
|
dao_rules = DAORules(
|
|
2672
2673
|
proposal_timelock=uint64(8),
|
|
@@ -2693,7 +2694,12 @@ async def test_dao_cat_exits(
|
|
|
2693
2694
|
dao_id_0 = dao_wallet_res_0.wallet_id
|
|
2694
2695
|
cat_wallet_0 = wallet_node_0.wallet_state_manager.wallets[dao_wallet_res_0.cat_wallet_id]
|
|
2695
2696
|
dao_cat_wallet_0 = wallet_node_0.wallet_state_manager.wallets[dao_wallet_res_0.dao_cat_wallet_id]
|
|
2696
|
-
|
|
2697
|
+
ltxs = await wallet_0.wallet_state_manager.tx_store.get_all_unconfirmed()
|
|
2698
|
+
txs: list[TransactionRecord] = []
|
|
2699
|
+
for ltx in ltxs:
|
|
2700
|
+
tx = await wallet_0.wallet_state_manager.tx_store.get_transaction_record(ltx.name)
|
|
2701
|
+
assert tx is not None
|
|
2702
|
+
txs.append(tx)
|
|
2697
2703
|
await full_node_api.wait_transaction_records_entered_mempool(records=txs, timeout=60)
|
|
2698
2704
|
await full_node_api.process_transaction_records(records=txs, timeout=60)
|
|
2699
2705
|
await full_node_api.process_all_wallet_transactions(wallet_0, 60)
|
|
@@ -2786,12 +2792,6 @@ async def test_dao_cat_exits(
|
|
|
2786
2792
|
await time_out_assert(20, dao_cat_wallet_0.get_confirmed_balance, 0)
|
|
2787
2793
|
await time_out_assert(20, cat_wallet_0.get_confirmed_balance, cat_amt)
|
|
2788
2794
|
|
|
2789
|
-
finally:
|
|
2790
|
-
client_0.close()
|
|
2791
|
-
client_1.close()
|
|
2792
|
-
await client_0.await_closed()
|
|
2793
|
-
await client_1.await_closed()
|
|
2794
|
-
|
|
2795
2795
|
|
|
2796
2796
|
@pytest.mark.limit_consensus_modes(reason="does not depend on consensus rules")
|
|
2797
2797
|
@pytest.mark.parametrize(
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typing import Dict, List, Tuple
|
|
4
|
-
|
|
5
3
|
import pytest
|
|
6
4
|
from chia_rs import G2Element
|
|
7
5
|
|
|
8
|
-
from chia.
|
|
6
|
+
from chia._tests.util.spend_sim import CostLogger, sim_and_client
|
|
9
7
|
from chia.types.blockchain_format.coin import Coin
|
|
10
8
|
from chia.types.blockchain_format.program import Program
|
|
11
9
|
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
@@ -31,7 +29,7 @@ GRAFTROOT_MOD = load_clvm("graftroot_dl_offers.clsp", package_or_requirement="ch
|
|
|
31
29
|
# (recurse solution ())
|
|
32
30
|
# )
|
|
33
31
|
ACS = Program.fromhex(
|
|
34
|
-
"ff02ffff01ff02ff02ffff04ff02ffff04ff03ffff01ff8080808080ffff04ffff01ff02ffff03ff05ffff01ff02ff02ffff04ff02ffff04ff0dffff04ff09ff8080808080ffff010b80ff0180ff018080"
|
|
32
|
+
"ff02ffff01ff02ff02ffff04ff02ffff04ff03ffff01ff8080808080ffff04ffff01ff02ffff03ff05ffff01ff02ff02ffff04ff02ffff04ff0dffff04ff09ff8080808080ffff010b80ff0180ff018080"
|
|
35
33
|
)
|
|
36
34
|
ACS_PH = ACS.get_tree_hash()
|
|
37
35
|
|
|
@@ -42,11 +40,11 @@ NIL_PH = Program.to(None).get_tree_hash()
|
|
|
42
40
|
async def test_graftroot(cost_logger: CostLogger) -> None:
|
|
43
41
|
async with sim_and_client() as (sim, sim_client):
|
|
44
42
|
# Create the coin we're testing
|
|
45
|
-
all_values:
|
|
43
|
+
all_values: list[bytes32] = [bytes32([x] * 32) for x in range(0, 100)]
|
|
46
44
|
root, proofs = build_merkle_tree(all_values)
|
|
47
45
|
p2_conditions = Program.to((1, [[51, ACS_PH, 0]])) # An coin to create to make sure this hits the blockchain
|
|
48
|
-
desired_key_values = ((bytes32
|
|
49
|
-
desired_row_hashes:
|
|
46
|
+
desired_key_values = ((bytes32.zeros, bytes32([1] * 32)), (bytes32([7] * 32), bytes32([8] * 32)))
|
|
47
|
+
desired_row_hashes: list[bytes32] = [build_merkle_tree_from_binary_tree(kv)[0] for kv in desired_key_values]
|
|
50
48
|
fake_struct: Program = Program.to((ACS_PH, NIL_PH))
|
|
51
49
|
graftroot_puzzle: Program = GRAFTROOT_MOD.curry(
|
|
52
50
|
# Do everything twice to test depending on multiple singleton updates
|
|
@@ -61,21 +59,21 @@ async def test_graftroot(cost_logger: CostLogger) -> None:
|
|
|
61
59
|
].coin
|
|
62
60
|
|
|
63
61
|
# Build some merkle trees that won't satidy the requirements
|
|
64
|
-
def filter_all(values:
|
|
62
|
+
def filter_all(values: list[bytes32]) -> list[bytes32]:
|
|
65
63
|
return [h for i, h in enumerate(values) if (h, values[min(i, i + 1)]) not in desired_key_values]
|
|
66
64
|
|
|
67
|
-
def filter_to_only_one(values:
|
|
65
|
+
def filter_to_only_one(values: list[bytes32]) -> list[bytes32]:
|
|
68
66
|
return [h for i, h in enumerate(values) if (h, values[min(i, i + 1)]) not in desired_key_values[1:]]
|
|
69
67
|
|
|
70
68
|
# And one that will
|
|
71
|
-
def filter_none(values:
|
|
69
|
+
def filter_none(values: list[bytes32]) -> list[bytes32]:
|
|
72
70
|
return values
|
|
73
71
|
|
|
74
72
|
for list_filter in (filter_all, filter_to_only_one, filter_none):
|
|
75
73
|
# Create the "singleton"
|
|
76
74
|
filtered_values = list_filter(all_values)
|
|
77
75
|
root, proofs = build_merkle_tree(filtered_values)
|
|
78
|
-
filtered_row_hashes:
|
|
76
|
+
filtered_row_hashes: dict[bytes32, tuple[int, list[bytes32]]] = {
|
|
79
77
|
simplify_merkle_proof(v, (proofs[v][0], [proofs[v][1][0]])): (proofs[v][0] >> 1, proofs[v][1][1:])
|
|
80
78
|
for v in filtered_values
|
|
81
79
|
}
|
|
@@ -131,7 +129,7 @@ async def test_graftroot(cost_logger: CostLogger) -> None:
|
|
|
131
129
|
# try with a bad merkle root announcement
|
|
132
130
|
new_fake_spend = make_spend(
|
|
133
131
|
fake_coin,
|
|
134
|
-
ACS.curry(fake_struct, ACS.curry(ACS_PH, (bytes32
|
|
132
|
+
ACS.curry(fake_struct, ACS.curry(ACS_PH, (bytes32.zeros, None), None, None)),
|
|
135
133
|
Program.to([[[62, "$"]]]),
|
|
136
134
|
)
|
|
137
135
|
new_final_bundle = WalletSpendBundle([new_fake_spend, graftroot_spend], G2Element())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typing import Any
|
|
3
|
+
from typing import Any
|
|
4
4
|
|
|
5
5
|
import pytest
|
|
6
6
|
|
|
@@ -31,9 +31,9 @@ async def get_trade_and_status(trade_manager: Any, trade: TradeRecord) -> TradeS
|
|
|
31
31
|
return TradeStatus(trade_rec.status)
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
def get_parent_branch(value: bytes32, proof:
|
|
34
|
+
def get_parent_branch(value: bytes32, proof: tuple[int, list[bytes32]]) -> tuple[bytes32, tuple[int, list[bytes32]]]:
|
|
35
35
|
branch: bytes32 = simplify_merkle_proof(value, (proof[0], [proof[1][0]]))
|
|
36
|
-
new_proof:
|
|
36
|
+
new_proof: tuple[int, list[bytes32]] = (proof[0] >> 1, proof[1][1:])
|
|
37
37
|
return branch, new_proof
|
|
38
38
|
|
|
39
39
|
|
|
@@ -136,7 +136,7 @@ async def test_dl_offers(wallets_prefarm: Any, trusted: bool) -> None:
|
|
|
136
136
|
]
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
[
|
|
139
|
+
[_maker_offer], signing_response = await wallet_node_maker.wallet_state_manager.sign_offers(
|
|
140
140
|
[Offer.from_bytes(offer_maker.offer)]
|
|
141
141
|
)
|
|
142
142
|
async with trade_manager_taker.wallet_state_manager.new_action_scope(
|
|
@@ -263,7 +263,7 @@ async def test_dl_offer_cancellation(wallets_prefarm: Any, trusted: bool) -> Non
|
|
|
263
263
|
|
|
264
264
|
addition = bytes32([101] * 32)
|
|
265
265
|
ROWS.append(addition)
|
|
266
|
-
root,
|
|
266
|
+
root, _proofs = build_merkle_tree(ROWS)
|
|
267
267
|
|
|
268
268
|
async with trade_manager.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=False) as action_scope:
|
|
269
269
|
success, offer, error = await trade_manager.create_offer_for_ids(
|
|
@@ -414,7 +414,7 @@ async def test_multiple_dl_offers(wallets_prefarm: Any, trusted: bool) -> None:
|
|
|
414
414
|
assert success is True
|
|
415
415
|
assert offer_maker is not None
|
|
416
416
|
|
|
417
|
-
[
|
|
417
|
+
[_maker_offer], signing_response = await wallet_node_maker.wallet_state_manager.sign_offers(
|
|
418
418
|
[Offer.from_bytes(offer_maker.offer)]
|
|
419
419
|
)
|
|
420
420
|
async with trade_manager_taker.wallet_state_manager.new_action_scope(
|
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
4
|
import dataclasses
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import Any
|
|
6
6
|
|
|
7
7
|
import pytest
|
|
8
8
|
|
|
@@ -426,7 +426,7 @@ class TestDLWallet:
|
|
|
426
426
|
assert current_record != record_1
|
|
427
427
|
async with dl_wallet_0.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
428
428
|
await dl_wallet_0.create_update_state_spend(
|
|
429
|
-
launcher_id, bytes32
|
|
429
|
+
launcher_id, bytes32.zeros, action_scope, fee=uint64(2000000000000)
|
|
430
430
|
)
|
|
431
431
|
update_txs = action_scope.side_effects.transactions
|
|
432
432
|
record_0 = await dl_wallet_0.get_latest_singleton(launcher_id)
|
|
@@ -569,35 +569,35 @@ async def test_mirrors(wallets_prefarm: Any, trusted: bool) -> None:
|
|
|
569
569
|
dl_wallet_2 = await DataLayerWallet.create_new_dl_wallet(wsm_2)
|
|
570
570
|
|
|
571
571
|
async with dl_wallet_1.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
572
|
-
launcher_id_1 = await dl_wallet_1.generate_new_reporter(bytes32
|
|
572
|
+
launcher_id_1 = await dl_wallet_1.generate_new_reporter(bytes32.zeros, action_scope)
|
|
573
573
|
assert await dl_wallet_1.get_latest_singleton(launcher_id_1) is not None
|
|
574
574
|
await full_node_api.process_transaction_records(records=action_scope.side_effects.transactions)
|
|
575
|
-
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet_1, launcher_id_1, bytes32
|
|
575
|
+
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet_1, launcher_id_1, bytes32.zeros)
|
|
576
576
|
|
|
577
577
|
async with dl_wallet_2.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
578
|
-
launcher_id_2 = await dl_wallet_2.generate_new_reporter(bytes32
|
|
578
|
+
launcher_id_2 = await dl_wallet_2.generate_new_reporter(bytes32.zeros, action_scope)
|
|
579
579
|
assert await dl_wallet_2.get_latest_singleton(launcher_id_2) is not None
|
|
580
580
|
await full_node_api.process_transaction_records(records=action_scope.side_effects.transactions)
|
|
581
|
-
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet_2, launcher_id_2, bytes32
|
|
581
|
+
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet_2, launcher_id_2, bytes32.zeros)
|
|
582
582
|
|
|
583
583
|
peer_1 = wallet_node_1.get_full_node_peer()
|
|
584
584
|
await dl_wallet_1.track_new_launcher_id(launcher_id_2, peer_1)
|
|
585
585
|
peer_2 = wallet_node_2.get_full_node_peer()
|
|
586
586
|
await dl_wallet_2.track_new_launcher_id(launcher_id_1, peer_2)
|
|
587
|
-
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet_1, launcher_id_2, bytes32
|
|
588
|
-
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet_2, launcher_id_1, bytes32
|
|
587
|
+
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet_1, launcher_id_2, bytes32.zeros)
|
|
588
|
+
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet_2, launcher_id_1, bytes32.zeros)
|
|
589
589
|
|
|
590
590
|
async with dl_wallet_1.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
591
591
|
await dl_wallet_1.create_new_mirror(
|
|
592
592
|
launcher_id_2, uint64(3), [b"foo", b"bar"], action_scope, fee=uint64(1_999_999_999_999)
|
|
593
593
|
)
|
|
594
|
-
additions:
|
|
594
|
+
additions: list[Coin] = []
|
|
595
595
|
for tx in action_scope.side_effects.transactions:
|
|
596
596
|
if tx.spend_bundle is not None:
|
|
597
597
|
additions.extend(tx.spend_bundle.additions())
|
|
598
598
|
await full_node_api.process_transaction_records(records=action_scope.side_effects.transactions)
|
|
599
599
|
|
|
600
|
-
mirror_coin: Coin =
|
|
600
|
+
mirror_coin: Coin = next(c for c in additions if c.puzzle_hash == create_mirror_puzzle().get_tree_hash())
|
|
601
601
|
mirror = Mirror(
|
|
602
602
|
bytes32(mirror_coin.name()),
|
|
603
603
|
bytes32(launcher_id_2),
|
|
@@ -648,7 +648,7 @@ async def test_datalayer_reorgs(wallet_environments: WalletTestFramework) -> Non
|
|
|
648
648
|
dl_wallet = await DataLayerWallet.create_new_dl_wallet(env.wallet_state_manager)
|
|
649
649
|
|
|
650
650
|
async with dl_wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
651
|
-
launcher_id = await dl_wallet.generate_new_reporter(bytes32
|
|
651
|
+
launcher_id = await dl_wallet.generate_new_reporter(bytes32.zeros, action_scope)
|
|
652
652
|
|
|
653
653
|
await wallet_environments.process_pending_states(
|
|
654
654
|
[
|
|
@@ -676,16 +676,16 @@ async def test_datalayer_reorgs(wallet_environments: WalletTestFramework) -> Non
|
|
|
676
676
|
)
|
|
677
677
|
]
|
|
678
678
|
)
|
|
679
|
-
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet, launcher_id, bytes32
|
|
679
|
+
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet, launcher_id, bytes32.zeros)
|
|
680
680
|
|
|
681
681
|
height = full_node_api.full_node.blockchain.get_peak_height()
|
|
682
682
|
assert height is not None
|
|
683
683
|
await full_node_api.reorg_from_index_to_new_index(
|
|
684
|
-
ReorgProtocol(uint32(height - 1), uint32(height + 1), bytes32
|
|
684
|
+
ReorgProtocol(uint32(height - 1), uint32(height + 1), bytes32.zeros, None)
|
|
685
685
|
)
|
|
686
686
|
await full_node_api.wait_for_wallet_synced(wallet_node=wallet_node, timeout=5)
|
|
687
687
|
|
|
688
|
-
await time_out_assert(15, is_singleton_confirmed_and_root, False, dl_wallet, launcher_id, bytes32
|
|
688
|
+
await time_out_assert(15, is_singleton_confirmed_and_root, False, dl_wallet, launcher_id, bytes32.zeros)
|
|
689
689
|
|
|
690
690
|
await wallet_environments.process_pending_states(
|
|
691
691
|
[
|
|
@@ -713,7 +713,7 @@ async def test_datalayer_reorgs(wallet_environments: WalletTestFramework) -> Non
|
|
|
713
713
|
)
|
|
714
714
|
]
|
|
715
715
|
)
|
|
716
|
-
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet, launcher_id, bytes32
|
|
716
|
+
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet, launcher_id, bytes32.zeros)
|
|
717
717
|
|
|
718
718
|
async with dl_wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
719
719
|
await dl_wallet.create_update_state_spend(launcher_id, bytes32([2] * 32), action_scope)
|
|
@@ -737,11 +737,11 @@ async def test_datalayer_reorgs(wallet_environments: WalletTestFramework) -> Non
|
|
|
737
737
|
height = full_node_api.full_node.blockchain.get_peak_height()
|
|
738
738
|
assert height is not None
|
|
739
739
|
await full_node_api.reorg_from_index_to_new_index(
|
|
740
|
-
ReorgProtocol(uint32(height - 1), uint32(height + 1), bytes32
|
|
740
|
+
ReorgProtocol(uint32(height - 1), uint32(height + 1), bytes32.zeros, None)
|
|
741
741
|
)
|
|
742
742
|
await full_node_api.wait_for_wallet_synced(wallet_node=wallet_node, timeout=5)
|
|
743
743
|
|
|
744
|
-
await time_out_assert(15, is_singleton_confirmed_and_root, False, dl_wallet, launcher_id, bytes32
|
|
744
|
+
await time_out_assert(15, is_singleton_confirmed_and_root, False, dl_wallet, launcher_id, bytes32.zeros)
|
|
745
745
|
|
|
746
746
|
await wallet_environments.process_pending_states(
|
|
747
747
|
[
|
|
@@ -790,7 +790,7 @@ async def test_datalayer_reorgs(wallet_environments: WalletTestFramework) -> Non
|
|
|
790
790
|
height = full_node_api.full_node.blockchain.get_peak_height()
|
|
791
791
|
assert height is not None
|
|
792
792
|
await full_node_api.reorg_from_index_to_new_index(
|
|
793
|
-
ReorgProtocol(uint32(height - 1), uint32(height + 1), bytes32
|
|
793
|
+
ReorgProtocol(uint32(height - 1), uint32(height + 1), bytes32.zeros, None)
|
|
794
794
|
)
|
|
795
795
|
await full_node_api.wait_for_wallet_synced(wallet_node=wallet_node, timeout=5)
|
|
796
796
|
|