chia-blockchain 2.5.2rc1__py3-none-any.whl → 2.5.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chia/__init__.py +7 -0
- chia/_tests/blockchain/blockchain_test_utils.py +1 -1
- chia/_tests/blockchain/test_augmented_chain.py +54 -5
- chia/_tests/blockchain/test_blockchain.py +5 -12
- chia/_tests/blockchain/test_blockchain_transactions.py +3 -5
- chia/_tests/blockchain/test_get_block_generator.py +2 -2
- chia/_tests/blockchain/test_lookup_fork_chain.py +2 -2
- chia/_tests/clvm/benchmark_costs.py +2 -1
- chia/_tests/clvm/coin_store.py +4 -3
- chia/_tests/clvm/test_chialisp_deserialization.py +2 -2
- chia/_tests/clvm/test_curry_and_treehash.py +1 -1
- chia/_tests/clvm/test_puzzle_compression.py +2 -2
- chia/_tests/clvm/test_puzzles.py +2 -2
- chia/_tests/clvm/test_singletons.py +2 -2
- chia/_tests/clvm/test_spend_sim.py +1 -1
- chia/_tests/cmds/cmd_test_utils.py +2 -2
- chia/_tests/cmds/test_click_types.py +2 -2
- chia/_tests/cmds/test_cmd_framework.py +6 -6
- chia/_tests/cmds/test_show.py +4 -3
- chia/_tests/cmds/test_tx_config_args.py +1 -1
- chia/_tests/cmds/testing_classes.py +2 -2
- chia/_tests/cmds/wallet/test_consts.py +2 -2
- chia/_tests/cmds/wallet/test_did.py +2 -2
- chia/_tests/cmds/wallet/test_nft.py +2 -2
- chia/_tests/cmds/wallet/test_notifications.py +3 -2
- chia/_tests/cmds/wallet/test_vcs.py +2 -2
- chia/_tests/cmds/wallet/test_wallet.py +4 -8
- chia/_tests/conftest.py +4 -3
- chia/_tests/connection_utils.py +2 -2
- chia/_tests/core/cmds/test_keys.py +1 -2
- chia/_tests/core/cmds/test_wallet.py +2 -2
- chia/_tests/core/consensus/test_block_creation.py +2 -2
- chia/_tests/core/consensus/test_pot_iterations.py +1 -1
- chia/_tests/core/custom_types/test_coin.py +2 -2
- chia/_tests/core/custom_types/test_proof_of_space.py +2 -2
- chia/_tests/core/custom_types/test_spend_bundle.py +2 -2
- chia/_tests/core/data_layer/conftest.py +1 -1
- chia/_tests/core/data_layer/test_data_layer.py +1 -1
- chia/_tests/core/data_layer/test_data_layer_util.py +1 -1
- chia/_tests/core/data_layer/test_data_rpc.py +2 -2
- chia/_tests/core/data_layer/test_data_store.py +1 -1
- chia/_tests/core/data_layer/test_data_store_schema.py +1 -1
- chia/_tests/core/data_layer/util.py +2 -1
- chia/_tests/core/farmer/test_farmer_api.py +1 -1
- chia/_tests/core/full_node/full_sync/test_full_sync.py +1 -7
- chia/_tests/core/full_node/ram_db.py +2 -1
- chia/_tests/core/full_node/stores/test_block_store.py +2 -2
- chia/_tests/core/full_node/stores/test_coin_store.py +2 -2
- chia/_tests/core/full_node/stores/test_full_node_store.py +3 -3
- chia/_tests/core/full_node/stores/test_hint_store.py +2 -2
- chia/_tests/core/full_node/stores/test_sync_store.py +1 -1
- chia/_tests/core/full_node/test_address_manager.py +1 -1
- chia/_tests/core/full_node/test_block_height_map.py +2 -2
- chia/_tests/core/full_node/test_conditions.py +1 -1
- chia/_tests/core/full_node/test_full_node.py +346 -164
- chia/_tests/core/full_node/test_generator_tools.py +3 -2
- chia/_tests/core/full_node/test_hint_management.py +2 -2
- chia/_tests/core/full_node/test_performance.py +2 -15
- chia/_tests/core/full_node/test_subscriptions.py +1 -1
- chia/_tests/core/full_node/test_transactions.py +186 -185
- chia/_tests/core/full_node/test_tx_processing_queue.py +1 -1
- chia/_tests/core/make_block_generator.py +2 -2
- chia/_tests/core/mempool/test_mempool.py +165 -22
- chia/_tests/core/mempool/test_mempool_fee_estimator.py +1 -1
- chia/_tests/core/mempool/test_mempool_fee_protocol.py +1 -1
- chia/_tests/core/mempool/test_mempool_manager.py +476 -66
- chia/_tests/core/mempool/test_mempool_performance.py +2 -2
- chia/_tests/core/mempool/test_singleton_fast_forward.py +19 -25
- chia/_tests/core/node_height.py +2 -1
- chia/_tests/core/server/test_capabilities.py +1 -1
- chia/_tests/core/server/test_dos.py +36 -28
- chia/_tests/core/server/test_loop.py +3 -3
- chia/_tests/core/server/test_rate_limits.py +1 -1
- chia/_tests/core/server/test_server.py +2 -2
- chia/_tests/core/services/test_services.py +1 -1
- chia/_tests/core/ssl/test_ssl.py +1 -1
- chia/_tests/core/test_coins.py +2 -1
- chia/_tests/core/test_cost_calculation.py +2 -2
- chia/_tests/core/test_crawler.py +2 -2
- chia/_tests/core/test_db_conversion.py +2 -2
- chia/_tests/core/test_db_validation.py +26 -13
- chia/_tests/core/test_farmer_harvester_rpc.py +2 -2
- chia/_tests/core/test_full_node_rpc.py +2 -2
- chia/_tests/core/test_merkle_set.py +2 -2
- chia/_tests/core/test_program.py +2 -2
- chia/_tests/core/test_rpc_util.py +1 -1
- chia/_tests/core/test_seeder.py +1 -1
- chia/_tests/core/util/test_block_cache.py +3 -3
- chia/_tests/core/util/test_jsonify.py +3 -2
- chia/_tests/core/util/test_keychain.py +3 -3
- chia/_tests/core/util/test_streamable.py +3 -4
- chia/_tests/environments/wallet.py +3 -2
- chia/_tests/farmer_harvester/test_farmer.py +3 -4
- chia/_tests/farmer_harvester/test_farmer_harvester.py +2 -2
- chia/_tests/farmer_harvester/test_filter_prefix_bits.py +2 -2
- chia/_tests/farmer_harvester/test_third_party_harvesters.py +3 -4
- chia/_tests/fee_estimation/test_fee_estimation_integration.py +1 -1
- chia/_tests/fee_estimation/test_fee_estimation_rpc.py +2 -2
- chia/_tests/fee_estimation/test_fee_estimation_unit_tests.py +1 -1
- chia/_tests/fee_estimation/test_mempoolitem_height_added.py +3 -4
- chia/_tests/generator/test_compression.py +20 -10
- chia/_tests/generator/test_rom.py +7 -9
- chia/_tests/plot_sync/test_delta.py +2 -2
- chia/_tests/plot_sync/test_plot_sync.py +2 -2
- chia/_tests/plot_sync/test_receiver.py +2 -2
- chia/_tests/plot_sync/test_sender.py +2 -2
- chia/_tests/plot_sync/test_sync_simulated.py +2 -2
- chia/_tests/plot_sync/util.py +3 -2
- chia/_tests/plotting/test_plot_manager.py +1 -1
- chia/_tests/pools/test_pool_cli_parsing.py +3 -2
- chia/_tests/pools/test_pool_cmdline.py +2 -2
- chia/_tests/pools/test_pool_puzzles_lifecycle.py +3 -3
- chia/_tests/pools/test_pool_rpc.py +4 -5
- chia/_tests/pools/test_pool_wallet.py +1 -1
- chia/_tests/pools/test_wallet_pool_store.py +2 -2
- chia/_tests/rpc/test_rpc_client.py +1 -1
- chia/_tests/rpc/test_rpc_server.py +1 -1
- chia/_tests/simulation/test_simulation.py +36 -8
- chia/_tests/simulation/test_simulator.py +5 -5
- chia/_tests/simulation/test_start_simulator.py +2 -2
- chia/_tests/timelord/test_new_peak.py +2 -2
- chia/_tests/tools/test_run_block.py +3 -2
- chia/_tests/util/benchmark_cost.py +2 -2
- chia/_tests/util/benchmarks.py +17 -6
- chia/_tests/util/blockchain.py +2 -1
- chia/_tests/util/blockchain_mock.py +9 -5
- chia/_tests/util/build_network_protocol_files.py +2 -1
- chia/_tests/util/constants.py +2 -1
- chia/_tests/util/full_sync.py +6 -3
- chia/_tests/util/gen_ssl_certs.py +2 -2
- chia/_tests/util/generator_tools_testing.py +4 -3
- chia/_tests/util/get_name_puzzle_conditions.py +2 -2
- chia/_tests/util/misc.py +16 -2
- chia/_tests/util/network_protocol_data.py +17 -7
- chia/_tests/util/run_block.py +6 -8
- chia/_tests/util/setup_nodes.py +4 -3
- chia/_tests/util/spend_sim.py +9 -5
- chia/_tests/util/test_condition_tools.py +2 -2
- chia/_tests/util/test_config.py +2 -1
- chia/_tests/util/test_errors.py +2 -1
- chia/_tests/util/test_full_block_utils.py +17 -7
- chia/_tests/util/test_misc.py +1 -1
- chia/_tests/util/test_network_protocol_test.py +24 -24
- chia/_tests/util/test_replace_str_to_bytes.py +2 -2
- chia/_tests/util/test_trusted_peer.py +1 -1
- chia/_tests/util/time_out_assert.py +20 -7
- chia/_tests/wallet/cat_wallet/test_cat_lifecycle.py +1 -1
- chia/_tests/wallet/cat_wallet/test_cat_outer_puzzle.py +2 -2
- chia/_tests/wallet/cat_wallet/test_cat_wallet.py +5 -6
- chia/_tests/wallet/cat_wallet/test_offer_lifecycle.py +17 -15
- chia/_tests/wallet/cat_wallet/test_trades.py +2 -2
- chia/_tests/wallet/clawback/test_clawback_lifecycle.py +2 -2
- chia/_tests/wallet/clawback/test_clawback_metadata.py +2 -2
- chia/_tests/wallet/conftest.py +3 -3
- chia/_tests/wallet/db_wallet/test_db_graftroot.py +3 -5
- chia/_tests/wallet/db_wallet/test_dl_offers.py +2 -2
- chia/_tests/wallet/db_wallet/test_dl_wallet.py +433 -384
- chia/_tests/wallet/did_wallet/test_did.py +3 -3
- chia/_tests/wallet/nft_wallet/test_nft_1_offers.py +2 -2
- chia/_tests/wallet/nft_wallet/test_nft_bulk_mint.py +2 -2
- chia/_tests/wallet/nft_wallet/test_nft_lifecycle.py +3 -4
- chia/_tests/wallet/nft_wallet/test_nft_offers.py +1293 -703
- chia/_tests/wallet/nft_wallet/test_nft_puzzles.py +28 -30
- chia/_tests/wallet/nft_wallet/test_nft_wallet.py +2 -2
- chia/_tests/wallet/nft_wallet/test_ownership_outer_puzzle.py +2 -2
- chia/_tests/wallet/rpc/config.py +1 -1
- chia/_tests/wallet/rpc/test_dl_wallet_rpc.py +2 -2
- chia/_tests/wallet/rpc/test_wallet_rpc.py +20 -77
- chia/_tests/wallet/simple_sync/test_simple_sync_protocol.py +9 -7
- chia/_tests/wallet/sync/test_wallet_sync.py +79 -31
- chia/_tests/wallet/test_clvm_streamable.py +2 -2
- chia/_tests/wallet/test_coin_management.py +7 -7
- chia/_tests/wallet/test_coin_selection.py +20 -2
- chia/_tests/wallet/test_conditions.py +2 -2
- chia/_tests/wallet/test_debug_spend_bundle.py +2 -2
- chia/_tests/wallet/test_new_wallet_protocol.py +2 -2
- chia/_tests/wallet/test_nft_store.py +2 -2
- chia/_tests/wallet/test_notifications.py +2 -2
- chia/_tests/wallet/test_puzzle_store.py +2 -2
- chia/_tests/wallet/test_sign_coin_spends.py +2 -2
- chia/_tests/wallet/test_signer_protocol.py +3 -3
- chia/_tests/wallet/test_singleton.py +3 -11
- chia/_tests/wallet/test_singleton_lifecycle_fast.py +12 -13
- chia/_tests/wallet/test_singleton_store.py +2 -4
- chia/_tests/wallet/test_transaction_store.py +2 -2
- chia/_tests/wallet/test_util.py +2 -2
- chia/_tests/wallet/test_wallet.py +53 -49
- chia/_tests/wallet/test_wallet_action_scope.py +24 -6
- chia/_tests/wallet/test_wallet_blockchain.py +1 -1
- chia/_tests/wallet/test_wallet_coin_store.py +2 -2
- chia/_tests/wallet/test_wallet_interested_store.py +2 -2
- chia/_tests/wallet/test_wallet_node.py +3 -3
- chia/_tests/wallet/test_wallet_retry.py +3 -3
- chia/_tests/wallet/test_wallet_state_manager.py +8 -8
- chia/_tests/wallet/test_wallet_test_framework.py +1 -1
- chia/_tests/wallet/test_wallet_trade_store.py +2 -2
- chia/_tests/wallet/test_wallet_utils.py +2 -2
- chia/_tests/wallet/vc_wallet/test_cr_outer_puzzle.py +3 -2
- chia/_tests/wallet/vc_wallet/test_vc_lifecycle.py +15 -15
- chia/_tests/wallet/vc_wallet/test_vc_wallet.py +5 -3
- chia/_tests/wallet/wallet_block_tools.py +15 -7
- chia/_tests/weight_proof/test_weight_proof.py +3 -3
- chia/cmds/chia.py +0 -2
- chia/cmds/cmd_classes.py +3 -3
- chia/cmds/cmd_helpers.py +4 -4
- chia/cmds/cmds_util.py +2 -2
- chia/cmds/coin_funcs.py +3 -2
- chia/cmds/coins.py +1 -1
- chia/cmds/data.py +2 -2
- chia/cmds/data_funcs.py +3 -2
- chia/cmds/db_upgrade_func.py +2 -2
- chia/cmds/db_validate_func.py +15 -8
- chia/cmds/farm.py +2 -4
- chia/cmds/keys.py +0 -2
- chia/cmds/keys_funcs.py +1 -1
- chia/cmds/netspace_funcs.py +2 -1
- chia/cmds/param_types.py +2 -2
- chia/cmds/plotnft.py +2 -2
- chia/cmds/plotnft_funcs.py +2 -2
- chia/cmds/rpc.py +1 -1
- chia/cmds/show.py +1 -2
- chia/cmds/show_funcs.py +6 -3
- chia/cmds/signer.py +1 -2
- chia/cmds/sim.py +1 -2
- chia/cmds/sim_funcs.py +2 -2
- chia/cmds/wallet.py +2 -2
- chia/cmds/wallet_funcs.py +4 -11
- chia/consensus/block_body_validation.py +3 -4
- chia/consensus/block_creation.py +10 -6
- chia/consensus/block_header_validation.py +3 -4
- chia/consensus/block_record.py +2 -3
- chia/consensus/block_rewards.py +1 -1
- chia/consensus/blockchain.py +20 -17
- chia/consensus/blockchain_interface.py +5 -4
- chia/consensus/coinbase.py +2 -2
- chia/consensus/constants.py +1 -1
- chia/consensus/cost_calculator.py +2 -1
- chia/consensus/default_constants.py +4 -3
- chia/consensus/deficit.py +3 -2
- chia/consensus/difficulty_adjustment.py +8 -9
- chia/consensus/find_fork_point.py +4 -3
- chia/consensus/full_block_to_block_record.py +4 -3
- chia/consensus/get_block_challenge.py +4 -3
- chia/consensus/get_block_generator.py +3 -2
- chia/consensus/make_sub_epoch_summary.py +3 -2
- chia/consensus/multiprocess_validation.py +9 -4
- chia/consensus/pos_quality.py +1 -1
- chia/consensus/pot_iterations.py +4 -3
- chia/consensus/vdf_info_computation.py +4 -3
- chia/daemon/client.py +1 -1
- chia/daemon/keychain_server.py +1 -1
- chia/daemon/server.py +1 -1
- chia/daemon/windows_signal.py +1 -1
- chia/data_layer/data_layer.py +4 -3
- chia/data_layer/data_layer_errors.py +1 -1
- chia/data_layer/data_layer_util.py +2 -2
- chia/data_layer/data_layer_wallet.py +47 -69
- chia/data_layer/data_store.py +1 -1
- chia/data_layer/dl_wallet_store.py +5 -6
- chia/data_layer/download_data.py +1 -1
- chia/data_layer/s3_plugin_service.py +4 -4
- chia/data_layer/singleton_record.py +23 -0
- chia/data_layer/util/benchmark.py +2 -1
- chia/farmer/farmer.py +4 -6
- chia/farmer/farmer_api.py +4 -6
- chia/full_node/bitcoin_fee_estimator.py +2 -1
- chia/full_node/block_height_map.py +2 -2
- chia/full_node/block_store.py +8 -9
- chia/{util → full_node}/check_fork_next_block.py +2 -1
- chia/full_node/coin_store.py +10 -10
- chia/full_node/fee_estimate.py +2 -1
- chia/full_node/fee_estimation.py +2 -1
- chia/full_node/fee_estimator.py +2 -1
- chia/full_node/fee_estimator_interface.py +1 -1
- chia/full_node/fee_history.py +2 -1
- chia/full_node/fee_tracker.py +2 -1
- chia/full_node/full_node.py +25 -15
- chia/full_node/full_node_api.py +12 -32
- chia/full_node/full_node_store.py +4 -3
- chia/full_node/hint_management.py +2 -1
- chia/full_node/hint_store.py +3 -3
- chia/full_node/mempool.py +80 -12
- chia/full_node/mempool_check_conditions.py +6 -7
- chia/full_node/mempool_manager.py +168 -21
- chia/full_node/pending_tx_cache.py +2 -2
- chia/full_node/subscriptions.py +2 -2
- chia/full_node/sync_store.py +2 -3
- chia/full_node/tx_processing_queue.py +2 -1
- chia/full_node/weight_proof.py +5 -8
- chia/harvester/harvester.py +5 -3
- chia/harvester/harvester_api.py +2 -2
- chia/introducer/introducer.py +30 -2
- chia/introducer/introducer_api.py +9 -1
- chia/legacy/keyring.py +1 -2
- chia/plot_sync/exceptions.py +2 -1
- chia/plot_sync/receiver.py +2 -2
- chia/plot_sync/sender.py +1 -1
- chia/plotting/cache.py +2 -2
- chia/plotting/check_plots.py +4 -2
- chia/plotting/create_plots.py +1 -1
- chia/plotting/manager.py +3 -3
- chia/plotting/util.py +2 -2
- chia/pools/pool_config.py +1 -1
- chia/pools/pool_puzzles.py +23 -17
- chia/pools/pool_wallet.py +22 -9
- chia/pools/pool_wallet_info.py +2 -2
- chia/protocols/farmer_protocol.py +3 -6
- chia/protocols/full_node_protocol.py +3 -2
- chia/protocols/harvester_protocol.py +3 -4
- chia/protocols/pool_protocol.py +2 -2
- chia/protocols/shared_protocol.py +2 -1
- chia/protocols/timelord_protocol.py +4 -4
- chia/protocols/wallet_protocol.py +2 -2
- chia/rpc/data_layer_rpc_api.py +3 -4
- chia/rpc/data_layer_rpc_client.py +3 -2
- chia/rpc/farmer_rpc_api.py +2 -2
- chia/rpc/farmer_rpc_client.py +2 -1
- chia/rpc/full_node_rpc_api.py +3 -2
- chia/rpc/full_node_rpc_client.py +3 -2
- chia/rpc/harvester_rpc_api.py +2 -1
- chia/rpc/rpc_client.py +2 -2
- chia/rpc/rpc_server.py +1 -1
- chia/rpc/wallet_request_types.py +2 -62
- chia/rpc/wallet_rpc_api.py +98 -628
- chia/rpc/wallet_rpc_client.py +5 -253
- chia/seeder/crawl_store.py +1 -1
- chia/seeder/crawler.py +2 -2
- chia/seeder/peer_record.py +2 -1
- chia/seeder/start_crawler.py +3 -1
- chia/server/address_manager.py +2 -1
- chia/server/address_manager_store.py +1 -1
- chia/server/capabilities.py +2 -1
- chia/server/introducer_peers.py +2 -1
- chia/server/node_discovery.py +1 -1
- chia/server/outbound_message.py +2 -1
- chia/server/server.py +2 -2
- chia/server/start_data_layer.py +2 -1
- chia/server/start_farmer.py +3 -1
- chia/server/start_full_node.py +4 -2
- chia/server/start_harvester.py +3 -1
- chia/server/start_introducer.py +12 -1
- chia/server/start_service.py +2 -1
- chia/server/start_timelord.py +3 -1
- chia/server/start_wallet.py +3 -1
- chia/server/upnp.py +1 -2
- chia/server/ws_connection.py +3 -4
- chia/simulator/add_blocks_in_batches.py +5 -3
- chia/simulator/block_tools.py +16 -12
- chia/simulator/full_node_simulator.py +9 -14
- chia/simulator/setup_services.py +5 -3
- chia/simulator/simulator_full_node_rpc_api.py +3 -2
- chia/simulator/simulator_full_node_rpc_client.py +3 -2
- chia/simulator/simulator_protocol.py +3 -2
- chia/simulator/simulator_test_tools.py +2 -2
- chia/simulator/start_simulator.py +3 -2
- chia/simulator/wallet_tools.py +3 -4
- chia/timelord/iters_from_block.py +4 -4
- chia/timelord/timelord.py +7 -12
- chia/timelord/timelord_api.py +3 -3
- chia/timelord/timelord_state.py +4 -3
- chia/types/block_protocol.py +2 -2
- chia/types/blockchain_format/coin.py +2 -2
- chia/types/blockchain_format/program.py +1 -1
- chia/types/blockchain_format/proof_of_space.py +3 -4
- chia/types/blockchain_format/tree_hash.py +1 -1
- chia/types/blockchain_format/vdf.py +3 -4
- chia/types/clvm_cost.py +1 -1
- chia/types/coin_record.py +4 -3
- chia/types/coin_spend.py +1 -1
- chia/types/eligible_coin_spends.py +9 -5
- chia/types/fee_rate.py +1 -1
- chia/types/generator_types.py +3 -3
- chia/types/internal_mempool_item.py +3 -2
- chia/types/mempool_item.py +10 -3
- chia/types/mempool_submission_status.py +2 -1
- chia/types/mojos.py +1 -1
- chia/types/peer_info.py +2 -1
- chia/types/transaction_queue_entry.py +2 -1
- chia/types/unfinished_header_block.py +4 -4
- chia/types/validation_state.py +2 -1
- chia/types/weight_proof.py +1 -9
- chia/util/augmented_chain.py +20 -9
- chia/util/block_cache.py +8 -4
- chia/util/condition_tools.py +2 -2
- chia/util/full_block_utils.py +3 -4
- chia/util/generator_tools.py +2 -2
- chia/util/initial-config.yaml +2 -11
- chia/util/network.py +2 -2
- chia/util/prev_transaction_block.py +2 -1
- chia/util/task_timing.py +1 -1
- chia/util/vdf_prover.py +3 -3
- chia/util/ws_message.py +1 -1
- chia/wallet/cat_wallet/cat_info.py +3 -2
- chia/wallet/cat_wallet/cat_outer_puzzle.py +3 -2
- chia/wallet/cat_wallet/cat_utils.py +6 -4
- chia/wallet/cat_wallet/cat_wallet.py +16 -18
- chia/wallet/cat_wallet/lineage_store.py +2 -1
- chia/wallet/coin_selection.py +5 -5
- chia/wallet/conditions.py +22 -16
- chia/wallet/db_wallet/db_wallet_puzzles.py +15 -15
- chia/wallet/derivation_record.py +2 -2
- chia/wallet/derive_keys.py +2 -2
- chia/wallet/did_wallet/did_info.py +3 -2
- chia/wallet/did_wallet/did_wallet.py +41 -19
- chia/wallet/did_wallet/did_wallet_puzzles.py +18 -12
- chia/wallet/driver_protocol.py +1 -1
- chia/wallet/lineage_proof.py +3 -2
- chia/wallet/nft_wallet/metadata_outer_puzzle.py +6 -7
- chia/wallet/nft_wallet/nft_info.py +5 -5
- chia/wallet/nft_wallet/nft_puzzle_utils.py +293 -0
- chia/wallet/nft_wallet/nft_puzzles.py +21 -298
- chia/wallet/nft_wallet/nft_wallet.py +47 -62
- chia/wallet/nft_wallet/ownership_outer_puzzle.py +4 -8
- chia/wallet/nft_wallet/singleton_outer_puzzle.py +3 -2
- chia/wallet/nft_wallet/transfer_program_puzzle.py +6 -10
- chia/wallet/nft_wallet/uncurry_nft.py +6 -8
- chia/wallet/notification_manager.py +5 -5
- chia/wallet/notification_store.py +3 -2
- chia/wallet/outer_puzzles.py +2 -1
- chia/wallet/puzzles/clawback/drivers.py +21 -8
- chia/wallet/puzzles/clawback/metadata.py +3 -2
- chia/wallet/puzzles/clawback/puzzle_decorator.py +5 -4
- chia/wallet/puzzles/deployed_puzzle_hashes.json +0 -10
- chia/wallet/puzzles/p2_conditions.py +3 -2
- chia/wallet/puzzles/p2_delegated_conditions.py +3 -2
- chia/wallet/puzzles/p2_delegated_puzzle.py +3 -2
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py +3 -3
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.py +3 -2
- chia/wallet/puzzles/p2_puzzle_hash.py +4 -3
- chia/wallet/puzzles/puzzle_utils.py +3 -2
- chia/wallet/puzzles/singleton_top_layer.py +26 -10
- chia/wallet/puzzles/singleton_top_layer_v1_1.py +21 -9
- chia/wallet/puzzles/tails.py +21 -129
- chia/wallet/signer_protocol.py +3 -2
- chia/wallet/singleton.py +12 -6
- chia/wallet/singleton_record.py +3 -2
- chia/wallet/trade_manager.py +31 -55
- chia/wallet/trade_record.py +3 -2
- chia/wallet/trading/offer.py +14 -13
- chia/wallet/trading/trade_store.py +3 -4
- chia/wallet/transaction_record.py +2 -2
- chia/wallet/util/blind_signer_tl.py +3 -2
- chia/wallet/util/compute_hints.py +3 -2
- chia/wallet/util/compute_memos.py +2 -2
- chia/wallet/util/curry_and_treehash.py +1 -2
- chia/wallet/util/merkle_tree.py +1 -1
- chia/wallet/util/merkle_utils.py +1 -1
- chia/wallet/util/new_peak_queue.py +2 -1
- chia/wallet/util/notifications.py +5 -4
- chia/wallet/util/peer_request_cache.py +3 -2
- chia/wallet/util/puzzle_compression.py +6 -4
- chia/wallet/util/puzzle_decorator.py +6 -4
- chia/wallet/util/query_filter.py +3 -2
- chia/wallet/util/tx_config.py +3 -3
- chia/wallet/util/wallet_sync_utils.py +2 -2
- chia/wallet/util/wallet_types.py +2 -3
- chia/wallet/vc_wallet/cr_cat_drivers.py +18 -22
- chia/wallet/vc_wallet/cr_cat_wallet.py +14 -10
- chia/wallet/vc_wallet/cr_outer_puzzle.py +2 -2
- chia/wallet/vc_wallet/vc_drivers.py +50 -68
- chia/wallet/vc_wallet/vc_store.py +2 -2
- chia/wallet/vc_wallet/vc_wallet.py +47 -15
- chia/wallet/wallet.py +51 -46
- chia/wallet/wallet_action_scope.py +4 -0
- chia/wallet/wallet_blockchain.py +12 -7
- chia/wallet/wallet_coin_record.py +3 -2
- chia/wallet/wallet_coin_store.py +3 -2
- chia/wallet/wallet_info.py +2 -1
- chia/wallet/wallet_interested_store.py +3 -2
- chia/wallet/wallet_nft_store.py +4 -4
- chia/wallet/wallet_node.py +3 -4
- chia/wallet/wallet_pool_store.py +3 -4
- chia/wallet/wallet_protocol.py +19 -5
- chia/wallet/wallet_puzzle_store.py +2 -2
- chia/wallet/wallet_retry_store.py +3 -6
- chia/wallet/wallet_singleton_store.py +2 -2
- chia/wallet/wallet_state_manager.py +20 -197
- chia/wallet/wallet_transaction_store.py +2 -2
- chia/wallet/wallet_user_store.py +2 -1
- chia/wallet/wallet_weight_proof_handler.py +3 -2
- {chia_blockchain-2.5.2rc1.dist-info → chia_blockchain-2.5.3.dist-info}/METADATA +3 -2
- chia_blockchain-2.5.3.dist-info/RECORD +891 -0
- mozilla-ca/cacert.pem +64 -33
- chia/_tests/clvm/test_condition_codes.py +0 -13
- chia/_tests/cmds/wallet/test_dao.py +0 -565
- chia/_tests/wallet/dao_wallet/__init__.py +0 -0
- chia/_tests/wallet/dao_wallet/config.py +0 -3
- chia/_tests/wallet/dao_wallet/test_dao_clvm.py +0 -1330
- chia/_tests/wallet/dao_wallet/test_dao_wallets.py +0 -3488
- chia/cmds/dao.py +0 -1064
- chia/cmds/dao_funcs.py +0 -598
- chia/consensus/puzzles/__init__.py +0 -0
- chia/consensus/puzzles/chialisp_deserialisation.clsp +0 -69
- chia/consensus/puzzles/chialisp_deserialisation.clsp.hex +0 -1
- chia/consensus/puzzles/rom_bootstrap_generator.clsp +0 -37
- chia/consensus/puzzles/rom_bootstrap_generator.clsp.hex +0 -1
- chia/full_node/puzzles/__init__.py +0 -0
- chia/full_node/puzzles/block_program_zero.clsp +0 -14
- chia/full_node/puzzles/block_program_zero.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_coin_spend_entry.clsp +0 -5
- chia/full_node/puzzles/decompress_coin_spend_entry.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp +0 -7
- chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_puzzle.clsp +0 -6
- chia/full_node/puzzles/decompress_puzzle.clsp.hex +0 -1
- chia/pools/puzzles/__init__.py +0 -0
- chia/pools/puzzles/pool_member_innerpuz.clsp +0 -70
- chia/pools/puzzles/pool_member_innerpuz.clsp.hex +0 -1
- chia/pools/puzzles/pool_waitingroom_innerpuz.clsp +0 -69
- chia/pools/puzzles/pool_waitingroom_innerpuz.clsp.hex +0 -1
- chia/simulator/simulator_constants.py +0 -13
- chia/types/blockchain_format/foliage.py +0 -8
- chia/types/blockchain_format/pool_target.py +0 -5
- chia/types/blockchain_format/reward_chain_block.py +0 -6
- chia/types/blockchain_format/sized_bytes.py +0 -11
- chia/util/ints.py +0 -19
- chia/wallet/cat_wallet/dao_cat_info.py +0 -28
- chia/wallet/cat_wallet/dao_cat_wallet.py +0 -669
- chia/wallet/cat_wallet/puzzles/__init__.py +0 -0
- chia/wallet/cat_wallet/puzzles/cat_truths.clib +0 -31
- chia/wallet/cat_wallet/puzzles/cat_v2.clsp +0 -397
- chia/wallet/cat_wallet/puzzles/cat_v2.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/delegated_tail.clsp +0 -25
- chia/wallet/cat_wallet/puzzles/delegated_tail.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp +0 -15
- chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp +0 -26
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp +0 -42
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp +0 -24
- chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp.hex +0 -1
- chia/wallet/dao_wallet/__init__.py +0 -0
- chia/wallet/dao_wallet/dao_info.py +0 -61
- chia/wallet/dao_wallet/dao_utils.py +0 -811
- chia/wallet/dao_wallet/dao_wallet.py +0 -2119
- chia/wallet/did_wallet/puzzles/__init__.py +0 -0
- chia/wallet/did_wallet/puzzles/did_innerpuz.clsp +0 -135
- chia/wallet/did_wallet/puzzles/did_innerpuz.clsp.hex +0 -1
- chia/wallet/payment.py +0 -33
- chia/wallet/puzzles/augmented_condition.clsp +0 -13
- chia/wallet/puzzles/augmented_condition.clsp.hex +0 -1
- chia/wallet/puzzles/condition_codes.clib +0 -77
- chia/wallet/puzzles/curry-and-treehash.clib +0 -102
- chia/wallet/puzzles/curry.clib +0 -135
- chia/wallet/puzzles/curry_by_index.clib +0 -16
- chia/wallet/puzzles/dao_cat_eve.clsp +0 -17
- chia/wallet/puzzles/dao_cat_eve.clsp.hex +0 -1
- chia/wallet/puzzles/dao_cat_launcher.clsp +0 -36
- chia/wallet/puzzles/dao_cat_launcher.clsp.hex +0 -1
- chia/wallet/puzzles/dao_finished_state.clsp +0 -35
- chia/wallet/puzzles/dao_finished_state.clsp.hex +0 -1
- chia/wallet/puzzles/dao_finished_state.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_lockup.clsp +0 -288
- chia/wallet/puzzles/dao_lockup.clsp.hex +0 -1
- chia/wallet/puzzles/dao_lockup.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal.clsp +0 -377
- chia/wallet/puzzles/dao_proposal.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal_timer.clsp +0 -78
- chia/wallet/puzzles/dao_proposal_timer.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal_timer.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal_validator.clsp +0 -87
- chia/wallet/puzzles/dao_proposal_validator.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal_validator.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp +0 -240
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex +0 -1
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_treasury.clsp +0 -115
- chia/wallet/puzzles/dao_treasury.clsp.hex +0 -1
- chia/wallet/puzzles/dao_update_proposal.clsp +0 -44
- chia/wallet/puzzles/dao_update_proposal.clsp.hex +0 -1
- chia/wallet/puzzles/json.clib +0 -25
- chia/wallet/puzzles/merkle_utils.clib +0 -18
- chia/wallet/puzzles/notification.clsp +0 -7
- chia/wallet/puzzles/notification.clsp.hex +0 -1
- chia/wallet/puzzles/p2_1_of_n.clsp +0 -22
- chia/wallet/puzzles/p2_1_of_n.clsp.hex +0 -1
- chia/wallet/puzzles/p2_conditions.clsp +0 -3
- chia/wallet/puzzles/p2_conditions.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_conditions.clsp +0 -18
- chia/wallet/puzzles/p2_delegated_conditions.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_puzzle.clsp +0 -19
- chia/wallet/puzzles/p2_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp +0 -91
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp +0 -108
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp.hex +0 -1
- chia/wallet/puzzles/p2_parent.clsp +0 -19
- chia/wallet/puzzles/p2_parent.clsp.hex +0 -1
- chia/wallet/puzzles/p2_puzzle_hash.clsp +0 -18
- chia/wallet/puzzles/p2_puzzle_hash.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton.clsp +0 -30
- chia/wallet/puzzles/p2_singleton.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_aggregator.clsp +0 -81
- chia/wallet/puzzles/p2_singleton_aggregator.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp +0 -50
- chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp +0 -47
- chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/settlement_payments.clsp +0 -49
- chia/wallet/puzzles/settlement_payments.clsp.hex +0 -1
- chia/wallet/puzzles/sha256tree.clib +0 -11
- chia/wallet/puzzles/singleton_launcher.clsp +0 -16
- chia/wallet/puzzles/singleton_launcher.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_top_layer.clsp +0 -177
- chia/wallet/puzzles/singleton_top_layer.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_top_layer_v1_1.clsp +0 -107
- chia/wallet/puzzles/singleton_top_layer_v1_1.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_truths.clib +0 -21
- chia/wallet/vc_wallet/cr_puzzles/__init__.py +0 -0
- chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp +0 -3
- chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp.hex +0 -1
- chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp +0 -304
- chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp.hex +0 -1
- chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp +0 -45
- chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/__init__.py +0 -0
- chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp +0 -30
- chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp +0 -75
- chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp +0 -32
- chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp +0 -80
- chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp +0 -163
- chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp +0 -16
- chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp +0 -74
- chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp +0 -23
- chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp +0 -64
- chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp.hex +0 -1
- chia_blockchain-2.5.2rc1.dist-info/RECORD +0 -1042
- {chia_blockchain-2.5.2rc1.dist-info → chia_blockchain-2.5.3.dist-info}/LICENSE +0 -0
- {chia_blockchain-2.5.2rc1.dist-info → chia_blockchain-2.5.3.dist-info}/WHEEL +0 -0
- {chia_blockchain-2.5.2rc1.dist-info → chia_blockchain-2.5.3.dist-info}/entry_points.txt +0 -0
|
@@ -11,7 +11,9 @@ from unittest.mock import MagicMock
|
|
|
11
11
|
|
|
12
12
|
import pytest
|
|
13
13
|
from aiosqlite import Error as AIOSqliteError
|
|
14
|
-
from chia_rs import G2Element, confirm_not_included_already_hashed
|
|
14
|
+
from chia_rs import ConsensusConstants, G2Element, confirm_not_included_already_hashed
|
|
15
|
+
from chia_rs.sized_bytes import bytes32
|
|
16
|
+
from chia_rs.sized_ints import uint32, uint64, uint128
|
|
15
17
|
from chiabip158 import PyBIP158
|
|
16
18
|
from colorlog import getLogger
|
|
17
19
|
|
|
@@ -24,7 +26,6 @@ from chia._tests.weight_proof.test_weight_proof import load_blocks_dont_validate
|
|
|
24
26
|
from chia.consensus.block_body_validation import ForkInfo
|
|
25
27
|
from chia.consensus.block_record import BlockRecord
|
|
26
28
|
from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
|
|
27
|
-
from chia.consensus.constants import ConsensusConstants
|
|
28
29
|
from chia.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty
|
|
29
30
|
from chia.full_node.full_node_api import FullNodeAPI
|
|
30
31
|
from chia.full_node.weight_proof import WeightProofHandler
|
|
@@ -48,17 +49,16 @@ from chia.simulator.full_node_simulator import FullNodeSimulator
|
|
|
48
49
|
from chia.simulator.simulator_protocol import FarmNewBlockProtocol
|
|
49
50
|
from chia.types.blockchain_format.program import Program
|
|
50
51
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
51
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
52
52
|
from chia.types.coin_spend import make_spend
|
|
53
53
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
54
54
|
from chia.types.full_block import FullBlock
|
|
55
55
|
from chia.types.peer_info import PeerInfo
|
|
56
56
|
from chia.types.spend_bundle import SpendBundle
|
|
57
57
|
from chia.types.validation_state import ValidationState
|
|
58
|
+
from chia.util.augmented_chain import AugmentedBlockchain
|
|
58
59
|
from chia.util.hash import std_hash
|
|
59
|
-
from chia.
|
|
60
|
+
from chia.wallet.conditions import CreateCoin
|
|
60
61
|
from chia.wallet.nft_wallet.nft_wallet import NFTWallet
|
|
61
|
-
from chia.wallet.payment import Payment
|
|
62
62
|
from chia.wallet.util.compute_memos import compute_memos
|
|
63
63
|
from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG
|
|
64
64
|
from chia.wallet.util.wallet_sync_utils import PeerRequestException
|
|
@@ -444,11 +444,13 @@ async def test_long_sync_wallet(
|
|
|
444
444
|
full_node.constants, True, block_record, full_node.blockchain
|
|
445
445
|
)
|
|
446
446
|
fork_height = blocks_reorg[-num_blocks - 10].height - 1
|
|
447
|
+
blockchain = AugmentedBlockchain(full_node.blockchain)
|
|
447
448
|
await full_node.add_block_batch(
|
|
448
449
|
blocks_reorg[-num_blocks - 10 : -1],
|
|
449
450
|
PeerInfo("0.0.0.0", 0),
|
|
450
451
|
ForkInfo(fork_height, fork_height, blocks_reorg[-num_blocks - 10].prev_header_hash),
|
|
451
452
|
ValidationState(sub_slot_iters, difficulty, None),
|
|
453
|
+
blockchain,
|
|
452
454
|
)
|
|
453
455
|
await full_node.add_block(blocks_reorg[-1])
|
|
454
456
|
|
|
@@ -572,11 +574,13 @@ async def test_wallet_reorg_get_coinbase(
|
|
|
572
574
|
sub_slot_iters, difficulty = get_next_sub_slot_iters_and_difficulty(
|
|
573
575
|
full_node.constants, True, block_record, full_node.blockchain
|
|
574
576
|
)
|
|
577
|
+
blockchain = AugmentedBlockchain(full_node.blockchain)
|
|
575
578
|
await full_node.add_block_batch(
|
|
576
579
|
blocks_reorg_2[-44:],
|
|
577
580
|
PeerInfo("0.0.0.0", 0),
|
|
578
581
|
ForkInfo(blocks_reorg_2[-45].height, blocks_reorg_2[-45].height, blocks_reorg_2[-45].header_hash),
|
|
579
582
|
ValidationState(sub_slot_iters, difficulty, None),
|
|
583
|
+
blockchain,
|
|
580
584
|
)
|
|
581
585
|
|
|
582
586
|
for wallet_node, wallet_server in wallets:
|
|
@@ -665,14 +669,18 @@ async def test_request_additions_success(simulator_and_wallet: OldSimulatorsAndW
|
|
|
665
669
|
|
|
666
670
|
await full_node_api.wait_for_wallet_synced(wallet_node=wallet_node, timeout=20)
|
|
667
671
|
|
|
668
|
-
payees: list[
|
|
672
|
+
payees: list[CreateCoin] = []
|
|
669
673
|
for i in range(10):
|
|
670
674
|
payee_ph = await wallet.get_new_puzzlehash()
|
|
671
|
-
payees.append(
|
|
672
|
-
payees.append(
|
|
675
|
+
payees.append(CreateCoin(payee_ph, uint64(i + 100)))
|
|
676
|
+
payees.append(CreateCoin(payee_ph, uint64(i + 200)))
|
|
673
677
|
|
|
674
678
|
async with wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
675
|
-
await wallet.generate_signed_transaction(
|
|
679
|
+
await wallet.generate_signed_transaction(
|
|
680
|
+
[uint64(0), *(payee.amount for payee in payees)],
|
|
681
|
+
[ph, *(payee.puzzle_hash for payee in payees)],
|
|
682
|
+
action_scope,
|
|
683
|
+
)
|
|
676
684
|
[tx] = action_scope.side_effects.transactions
|
|
677
685
|
assert tx.spend_bundle is not None
|
|
678
686
|
await full_node_api.send_transaction(SendTransaction(tx.spend_bundle))
|
|
@@ -880,13 +888,17 @@ async def test_dusted_wallet(
|
|
|
880
888
|
await full_node_api.wait_for_wallets_synced(wallet_nodes=[farm_wallet_node, dust_wallet_node], timeout=20)
|
|
881
889
|
|
|
882
890
|
# Part 1: create a single dust coin
|
|
883
|
-
payees: list[
|
|
891
|
+
payees: list[CreateCoin] = []
|
|
884
892
|
payee_ph = await dust_wallet.get_new_puzzlehash()
|
|
885
|
-
payees.append(
|
|
893
|
+
payees.append(CreateCoin(payee_ph, uint64(dust_value)))
|
|
886
894
|
|
|
887
895
|
# construct and send tx
|
|
888
896
|
async with farm_wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
889
|
-
await farm_wallet.generate_signed_transaction(
|
|
897
|
+
await farm_wallet.generate_signed_transaction(
|
|
898
|
+
[uint64(0), *(payee.amount for payee in payees)],
|
|
899
|
+
[ph, *(payee.puzzle_hash for payee in payees)],
|
|
900
|
+
action_scope,
|
|
901
|
+
)
|
|
890
902
|
[tx] = action_scope.side_effects.transactions
|
|
891
903
|
assert tx.spend_bundle is not None
|
|
892
904
|
await full_node_api.send_transaction(SendTransaction(tx.spend_bundle))
|
|
@@ -939,14 +951,18 @@ async def test_dusted_wallet(
|
|
|
939
951
|
|
|
940
952
|
while dust_remaining > 0:
|
|
941
953
|
payee_ph = await dust_wallet.get_new_puzzlehash()
|
|
942
|
-
payees.append(
|
|
954
|
+
payees.append(CreateCoin(payee_ph, uint64(dust_value)))
|
|
943
955
|
|
|
944
956
|
# After every 100 (at most) coins added, push the tx and advance the chain
|
|
945
957
|
# This greatly speeds up the overall process
|
|
946
958
|
if dust_remaining % 100 == 0 and dust_remaining != new_dust:
|
|
947
959
|
# construct and send tx
|
|
948
960
|
async with farm_wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
949
|
-
await farm_wallet.generate_signed_transaction(
|
|
961
|
+
await farm_wallet.generate_signed_transaction(
|
|
962
|
+
[uint64(0), *(payee.amount for payee in payees)],
|
|
963
|
+
[ph, *(payee.puzzle_hash for payee in payees)],
|
|
964
|
+
action_scope,
|
|
965
|
+
)
|
|
950
966
|
[tx] = action_scope.side_effects.transactions
|
|
951
967
|
assert tx.spend_bundle is not None
|
|
952
968
|
await full_node_api.send_transaction(SendTransaction(tx.spend_bundle))
|
|
@@ -965,7 +981,11 @@ async def test_dusted_wallet(
|
|
|
965
981
|
if new_dust >= 1:
|
|
966
982
|
# construct and send tx
|
|
967
983
|
async with farm_wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
968
|
-
await farm_wallet.generate_signed_transaction(
|
|
984
|
+
await farm_wallet.generate_signed_transaction(
|
|
985
|
+
[uint64(0), *(payee.amount for payee in payees)],
|
|
986
|
+
[ph, *(payee.puzzle_hash for payee in payees)],
|
|
987
|
+
action_scope,
|
|
988
|
+
)
|
|
969
989
|
[tx] = action_scope.side_effects.transactions
|
|
970
990
|
assert tx.spend_bundle is not None
|
|
971
991
|
await full_node_api.send_transaction(SendTransaction(tx.spend_bundle))
|
|
@@ -1007,11 +1027,15 @@ async def test_dusted_wallet(
|
|
|
1007
1027
|
|
|
1008
1028
|
for _ in range(large_coins):
|
|
1009
1029
|
payee_ph = await dust_wallet.get_new_puzzlehash()
|
|
1010
|
-
payees.append(
|
|
1030
|
+
payees.append(CreateCoin(payee_ph, uint64(xch_spam_amount)))
|
|
1011
1031
|
|
|
1012
1032
|
# construct and send tx
|
|
1013
1033
|
async with farm_wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
1014
|
-
await farm_wallet.generate_signed_transaction(
|
|
1034
|
+
await farm_wallet.generate_signed_transaction(
|
|
1035
|
+
[uint64(0), *(payee.amount for payee in payees)],
|
|
1036
|
+
[ph, *(payee.puzzle_hash for payee in payees)],
|
|
1037
|
+
action_scope,
|
|
1038
|
+
)
|
|
1015
1039
|
[tx] = action_scope.side_effects.transactions
|
|
1016
1040
|
assert tx.spend_bundle is not None
|
|
1017
1041
|
await full_node_api.send_transaction(SendTransaction(tx.spend_bundle))
|
|
@@ -1046,11 +1070,15 @@ async def test_dusted_wallet(
|
|
|
1046
1070
|
payees = []
|
|
1047
1071
|
|
|
1048
1072
|
payee_ph = await dust_wallet.get_new_puzzlehash()
|
|
1049
|
-
payees.append(
|
|
1073
|
+
payees.append(CreateCoin(payee_ph, uint64(dust_value)))
|
|
1050
1074
|
|
|
1051
1075
|
# construct and send tx
|
|
1052
1076
|
async with farm_wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
1053
|
-
await farm_wallet.generate_signed_transaction(
|
|
1077
|
+
await farm_wallet.generate_signed_transaction(
|
|
1078
|
+
[uint64(0), *(payee.amount for payee in payees)],
|
|
1079
|
+
[ph, *(payee.puzzle_hash for payee in payees)],
|
|
1080
|
+
action_scope,
|
|
1081
|
+
)
|
|
1054
1082
|
[tx] = action_scope.side_effects.transactions
|
|
1055
1083
|
assert tx.spend_bundle is not None
|
|
1056
1084
|
await full_node_api.send_transaction(SendTransaction(tx.spend_bundle))
|
|
@@ -1090,7 +1118,7 @@ async def test_dusted_wallet(
|
|
|
1090
1118
|
payee_ph = await dust_wallet.get_new_puzzlehash()
|
|
1091
1119
|
|
|
1092
1120
|
# Create a large coin and add on the appropriate balance.
|
|
1093
|
-
payees.append(
|
|
1121
|
+
payees.append(CreateCoin(payee_ph, uint64(xch_spam_amount + i)))
|
|
1094
1122
|
large_coins += 1
|
|
1095
1123
|
large_coin_balance += xch_spam_amount + i
|
|
1096
1124
|
|
|
@@ -1098,9 +1126,9 @@ async def test_dusted_wallet(
|
|
|
1098
1126
|
|
|
1099
1127
|
# Make sure we are always creating coins with a positive value.
|
|
1100
1128
|
if xch_spam_amount - dust_value - i > 0:
|
|
1101
|
-
payees.append(
|
|
1129
|
+
payees.append(CreateCoin(payee_ph, uint64(xch_spam_amount - dust_value - i)))
|
|
1102
1130
|
else:
|
|
1103
|
-
payees.append(
|
|
1131
|
+
payees.append(CreateCoin(payee_ph, uint64(dust_value)))
|
|
1104
1132
|
# In cases where xch_spam_amount is sufficiently low,
|
|
1105
1133
|
# the new dust should be considered a large coina and not be filtered.
|
|
1106
1134
|
if xch_spam_amount <= dust_value:
|
|
@@ -1109,7 +1137,11 @@ async def test_dusted_wallet(
|
|
|
1109
1137
|
|
|
1110
1138
|
# construct and send tx
|
|
1111
1139
|
async with farm_wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
1112
|
-
await farm_wallet.generate_signed_transaction(
|
|
1140
|
+
await farm_wallet.generate_signed_transaction(
|
|
1141
|
+
[uint64(0), *(payee.amount for payee in payees)],
|
|
1142
|
+
[ph, *(payee.puzzle_hash for payee in payees)],
|
|
1143
|
+
action_scope,
|
|
1144
|
+
)
|
|
1113
1145
|
[tx] = action_scope.side_effects.transactions
|
|
1114
1146
|
assert tx.spend_bundle is not None
|
|
1115
1147
|
await full_node_api.send_transaction(SendTransaction(tx.spend_bundle))
|
|
@@ -1141,11 +1173,15 @@ async def test_dusted_wallet(
|
|
|
1141
1173
|
# Send 1 mojo from the dust wallet. The dust wallet should receive a change coin valued at "xch_spam_amount-1".
|
|
1142
1174
|
|
|
1143
1175
|
payee_ph = await farm_wallet.get_new_puzzlehash()
|
|
1144
|
-
payees = [
|
|
1176
|
+
payees = [CreateCoin(payee_ph, uint64(balance))]
|
|
1145
1177
|
|
|
1146
1178
|
# construct and send tx
|
|
1147
1179
|
async with dust_wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
1148
|
-
await dust_wallet.generate_signed_transaction(
|
|
1180
|
+
await dust_wallet.generate_signed_transaction(
|
|
1181
|
+
[uint64(0), *(payee.amount for payee in payees)],
|
|
1182
|
+
[ph, *(payee.puzzle_hash for payee in payees)],
|
|
1183
|
+
action_scope,
|
|
1184
|
+
)
|
|
1149
1185
|
[tx] = action_scope.side_effects.transactions
|
|
1150
1186
|
assert tx.spend_bundle is not None
|
|
1151
1187
|
await full_node_api.send_transaction(SendTransaction(tx.spend_bundle))
|
|
@@ -1182,14 +1218,18 @@ async def test_dusted_wallet(
|
|
|
1182
1218
|
|
|
1183
1219
|
while coins_remaining > 0:
|
|
1184
1220
|
payee_ph = await dust_wallet.get_new_puzzlehash()
|
|
1185
|
-
payees.append(
|
|
1221
|
+
payees.append(CreateCoin(payee_ph, uint64(coin_value)))
|
|
1186
1222
|
|
|
1187
1223
|
# After every 100 (at most) coins added, push the tx and advance the chain
|
|
1188
1224
|
# This greatly speeds up the overall process
|
|
1189
1225
|
if coins_remaining % 100 == 0 and coins_remaining != spam_filter_after_n_txs:
|
|
1190
1226
|
# construct and send tx
|
|
1191
1227
|
async with farm_wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
1192
|
-
await farm_wallet.generate_signed_transaction(
|
|
1228
|
+
await farm_wallet.generate_signed_transaction(
|
|
1229
|
+
[uint64(0), *(payee.amount for payee in payees)],
|
|
1230
|
+
[ph, *(payee.puzzle_hash for payee in payees)],
|
|
1231
|
+
action_scope,
|
|
1232
|
+
)
|
|
1193
1233
|
[tx] = action_scope.side_effects.transactions
|
|
1194
1234
|
assert tx.spend_bundle is not None
|
|
1195
1235
|
await full_node_api.send_transaction(SendTransaction(tx.spend_bundle))
|
|
@@ -1204,7 +1244,11 @@ async def test_dusted_wallet(
|
|
|
1204
1244
|
|
|
1205
1245
|
# construct and send tx
|
|
1206
1246
|
async with farm_wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
1207
|
-
await farm_wallet.generate_signed_transaction(
|
|
1247
|
+
await farm_wallet.generate_signed_transaction(
|
|
1248
|
+
[uint64(0), *(payee.amount for payee in payees)],
|
|
1249
|
+
[ph, *(payee.puzzle_hash for payee in payees)],
|
|
1250
|
+
action_scope,
|
|
1251
|
+
)
|
|
1208
1252
|
[tx] = action_scope.side_effects.transactions
|
|
1209
1253
|
assert tx.spend_bundle is not None
|
|
1210
1254
|
await full_node_api.send_transaction(SendTransaction(tx.spend_bundle))
|
|
@@ -1230,11 +1274,15 @@ async def test_dusted_wallet(
|
|
|
1230
1274
|
|
|
1231
1275
|
# Send a 1 mojo coin from the dust wallet to the farm wallet
|
|
1232
1276
|
payee_ph = await farm_wallet.get_new_puzzlehash()
|
|
1233
|
-
payees = [
|
|
1277
|
+
payees = [CreateCoin(payee_ph, uint64(1))]
|
|
1234
1278
|
|
|
1235
1279
|
# construct and send tx
|
|
1236
1280
|
async with dust_wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
1237
|
-
await dust_wallet.generate_signed_transaction(
|
|
1281
|
+
await dust_wallet.generate_signed_transaction(
|
|
1282
|
+
[uint64(0), *(payee.amount for payee in payees)],
|
|
1283
|
+
[ph, *(payee.puzzle_hash for payee in payees)],
|
|
1284
|
+
action_scope,
|
|
1285
|
+
)
|
|
1238
1286
|
[tx] = action_scope.side_effects.transactions
|
|
1239
1287
|
assert tx.spend_bundle is not None
|
|
1240
1288
|
await full_node_api.send_transaction(SendTransaction(tx.spend_bundle))
|
|
@@ -1473,7 +1521,7 @@ async def test_retry_store(
|
|
|
1473
1521
|
|
|
1474
1522
|
async with wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
1475
1523
|
await wallet.generate_signed_transaction(
|
|
1476
|
-
uint64(1_000_000_000_000), bytes32.zeros, action_scope, memos=[ph]
|
|
1524
|
+
[uint64(1_000_000_000_000)], [bytes32.zeros], action_scope, memos=[[ph]]
|
|
1477
1525
|
)
|
|
1478
1526
|
[tx] = action_scope.side_effects.transactions
|
|
1479
1527
|
await time_out_assert(30, wallet.get_confirmed_balance, 2_000_000_000_000)
|
|
@@ -4,10 +4,10 @@ import dataclasses
|
|
|
4
4
|
from typing import Optional
|
|
5
5
|
|
|
6
6
|
import pytest
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
8
|
+
from chia_rs.sized_ints import uint64
|
|
7
9
|
|
|
8
10
|
from chia.types.blockchain_format.program import Program
|
|
9
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
10
|
-
from chia.util.ints import uint64
|
|
11
11
|
from chia.util.streamable import Streamable, streamable
|
|
12
12
|
from chia.wallet.signer_protocol import Coin, Spend
|
|
13
13
|
from chia.wallet.util.clvm_streamable import (
|
|
@@ -8,6 +8,8 @@ from typing import Any
|
|
|
8
8
|
from unittest.mock import patch
|
|
9
9
|
|
|
10
10
|
import pytest
|
|
11
|
+
from chia_rs.sized_bytes import bytes32
|
|
12
|
+
from chia_rs.sized_ints import uint64
|
|
11
13
|
|
|
12
14
|
from chia._tests.cmds.test_cmd_framework import check_click_parsing
|
|
13
15
|
from chia._tests.environments.wallet import STANDARD_TX_ENDPOINT_ARGS, WalletStateTransition, WalletTestFramework
|
|
@@ -15,8 +17,6 @@ from chia.cmds.cmd_helpers import NeedsCoinSelectionConfig, NeedsWalletRPC, Wall
|
|
|
15
17
|
from chia.cmds.coins import CombineCMD, ListCMD, SplitCMD
|
|
16
18
|
from chia.cmds.param_types import CliAmount, cli_amount_none
|
|
17
19
|
from chia.rpc.wallet_request_types import GetSyncStatusResponse
|
|
18
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
19
|
-
from chia.util.ints import uint64
|
|
20
20
|
from chia.wallet.cat_wallet.cat_wallet import CATWallet
|
|
21
21
|
|
|
22
22
|
ONE_TRILLION = 1_000_000_000_000
|
|
@@ -113,7 +113,7 @@ async def test_list(wallet_environments: WalletTestFramework, capsys: pytest.Cap
|
|
|
113
113
|
assert (
|
|
114
114
|
textwrap.dedent(
|
|
115
115
|
f"""\
|
|
116
|
-
There are a total of {len(wallet_coins)} coins in wallet {env.wallet_aliases[
|
|
116
|
+
There are a total of {len(wallet_coins)} coins in wallet {env.wallet_aliases["xch"]}.
|
|
117
117
|
{len(wallet_coins)} confirmed coins.
|
|
118
118
|
0 unconfirmed additions.
|
|
119
119
|
0 unconfirmed removals.
|
|
@@ -134,7 +134,7 @@ async def test_list(wallet_environments: WalletTestFramework, capsys: pytest.Cap
|
|
|
134
134
|
assert (
|
|
135
135
|
textwrap.dedent(
|
|
136
136
|
f"""\
|
|
137
|
-
There are a total of {len(wallet_coins)} coins in wallet {env.wallet_aliases[
|
|
137
|
+
There are a total of {len(wallet_coins)} coins in wallet {env.wallet_aliases["xch"]}.
|
|
138
138
|
{len(wallet_coins)} confirmed coins.
|
|
139
139
|
0 unconfirmed additions.
|
|
140
140
|
0 unconfirmed removals.
|
|
@@ -153,7 +153,7 @@ async def test_list(wallet_environments: WalletTestFramework, capsys: pytest.Cap
|
|
|
153
153
|
assert (
|
|
154
154
|
textwrap.dedent(
|
|
155
155
|
f"""\
|
|
156
|
-
There are a total of {len(wallet_coins)} coins in wallet {env.wallet_aliases[
|
|
156
|
+
There are a total of {len(wallet_coins)} coins in wallet {env.wallet_aliases["xch"]}.
|
|
157
157
|
{len(wallet_coins)} confirmed coins.
|
|
158
158
|
0 unconfirmed additions.
|
|
159
159
|
0 unconfirmed removals.
|
|
@@ -197,7 +197,7 @@ async def test_list(wallet_environments: WalletTestFramework, capsys: pytest.Cap
|
|
|
197
197
|
assert (
|
|
198
198
|
textwrap.dedent(
|
|
199
199
|
f"""\
|
|
200
|
-
There are a total of {len(wallet_coins)} coins in wallet {env.wallet_aliases[
|
|
200
|
+
There are a total of {len(wallet_coins)} coins in wallet {env.wallet_aliases["xch"]}.
|
|
201
201
|
{len(wallet_coins) - 1} confirmed coins.
|
|
202
202
|
1 unconfirmed additions.
|
|
203
203
|
1 unconfirmed removals.
|
|
@@ -240,7 +240,7 @@ async def test_list(wallet_environments: WalletTestFramework, capsys: pytest.Cap
|
|
|
240
240
|
assert (
|
|
241
241
|
textwrap.dedent(
|
|
242
242
|
f"""\
|
|
243
|
-
There are a total of 1 coins in wallet {env.wallet_aliases[
|
|
243
|
+
There are a total of 1 coins in wallet {env.wallet_aliases["cat"]}.
|
|
244
244
|
1 confirmed coins.
|
|
245
245
|
0 unconfirmed additions.
|
|
246
246
|
0 unconfirmed removals.
|
|
@@ -5,12 +5,12 @@ import time
|
|
|
5
5
|
from random import randrange
|
|
6
6
|
|
|
7
7
|
import pytest
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import uint32, uint64, uint128
|
|
8
10
|
|
|
9
11
|
from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
|
10
12
|
from chia.types.blockchain_format.coin import Coin
|
|
11
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
12
13
|
from chia.util.hash import std_hash
|
|
13
|
-
from chia.util.ints import uint32, uint64, uint128
|
|
14
14
|
from chia.wallet.coin_selection import (
|
|
15
15
|
check_for_exact_match,
|
|
16
16
|
knapsack_coin_algorithm,
|
|
@@ -97,6 +97,24 @@ class TestCoinSelection:
|
|
|
97
97
|
assert sum(coin.amount for coin in result) >= target_amount
|
|
98
98
|
assert len(result) <= 500
|
|
99
99
|
|
|
100
|
+
@pytest.mark.anyio
|
|
101
|
+
async def test_coin_selection_zero_coins(self, a_hash: bytes32) -> None:
|
|
102
|
+
coin_list: list[WalletCoinRecord] = [
|
|
103
|
+
WalletCoinRecord(Coin(a_hash, a_hash, uint64(0)), uint32(1), uint32(1), False, True, WalletType(0), 1)
|
|
104
|
+
for _ in range(0, 100)
|
|
105
|
+
]
|
|
106
|
+
|
|
107
|
+
result: set[Coin] = await select_coins(
|
|
108
|
+
uint128(0),
|
|
109
|
+
DEFAULT_COIN_SELECTION_CONFIG,
|
|
110
|
+
coin_list,
|
|
111
|
+
{},
|
|
112
|
+
logging.getLogger("test"),
|
|
113
|
+
uint128(0),
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
assert len(result) > 0
|
|
117
|
+
|
|
100
118
|
@pytest.mark.anyio
|
|
101
119
|
async def test_coin_selection_with_dust(self, a_hash: bytes32) -> None:
|
|
102
120
|
spendable_amount = uint128(5000000000000 + 10000)
|
|
@@ -4,13 +4,13 @@ from dataclasses import dataclass
|
|
|
4
4
|
from typing import Any, Optional, Union
|
|
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
|
from clvm.casts import int_from_bytes
|
|
8
10
|
from clvm.EvalError import EvalError
|
|
9
11
|
|
|
10
12
|
from chia.types.blockchain_format.program import Program
|
|
11
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
12
13
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
13
|
-
from chia.util.ints import uint32, uint64
|
|
14
14
|
from chia.wallet.conditions import (
|
|
15
15
|
CONDITION_DRIVERS,
|
|
16
16
|
CONDITION_DRIVERS_W_ABSTRACTIONS,
|
|
@@ -2,14 +2,14 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import pytest
|
|
4
4
|
from chia_rs import AugSchemeMPL, PrivateKey
|
|
5
|
+
from chia_rs.sized_bytes import bytes32
|
|
6
|
+
from chia_rs.sized_ints import uint64
|
|
5
7
|
|
|
6
8
|
from chia.types.blockchain_format.coin import Coin
|
|
7
9
|
from chia.types.blockchain_format.program import Program
|
|
8
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
9
10
|
from chia.types.coin_spend import make_spend
|
|
10
11
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
11
12
|
from chia.util.hash import std_hash
|
|
12
|
-
from chia.util.ints import uint64
|
|
13
13
|
from chia.wallet.util.debug_spend_bundle import debug_spend_bundle
|
|
14
14
|
from chia.wallet.wallet_spend_bundle import WalletSpendBundle
|
|
15
15
|
|
|
@@ -9,6 +9,8 @@ from typing import Optional
|
|
|
9
9
|
|
|
10
10
|
import pytest
|
|
11
11
|
from chia_rs import AugSchemeMPL, Coin, CoinSpend, CoinState, Program
|
|
12
|
+
from chia_rs.sized_bytes import bytes32
|
|
13
|
+
from chia_rs.sized_ints import uint8, uint16, uint32, uint64
|
|
12
14
|
|
|
13
15
|
from chia._tests.connection_utils import add_dummy_connection
|
|
14
16
|
from chia.full_node.coin_store import CoinStore
|
|
@@ -24,12 +26,10 @@ from chia.simulator.block_tools import BlockTools
|
|
|
24
26
|
from chia.simulator.full_node_simulator import FullNodeSimulator
|
|
25
27
|
from chia.simulator.start_simulator import SimulatorFullNodeService
|
|
26
28
|
from chia.types.aliases import WalletService
|
|
27
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
28
29
|
from chia.types.coin_record import CoinRecord
|
|
29
30
|
from chia.types.mempool_inclusion_status import MempoolInclusionStatus
|
|
30
31
|
from chia.types.spend_bundle import SpendBundle
|
|
31
32
|
from chia.util.hash import std_hash
|
|
32
|
-
from chia.util.ints import uint8, uint16, uint32, uint64
|
|
33
33
|
|
|
34
34
|
IDENTITY_PUZZLE = Program.to(1)
|
|
35
35
|
IDENTITY_PUZZLE_HASH = IDENTITY_PUZZLE.get_tree_hash()
|
|
@@ -4,12 +4,12 @@ import random
|
|
|
4
4
|
from dataclasses import dataclass, field
|
|
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.util.db_connection import DBConnection
|
|
9
11
|
from chia.types.blockchain_format.coin import Coin
|
|
10
12
|
from chia.types.blockchain_format.program import Program
|
|
11
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
12
|
-
from chia.util.ints import uint32, uint64
|
|
13
13
|
from chia.wallet.lineage_proof import LineageProof
|
|
14
14
|
from chia.wallet.nft_wallet.nft_info import NFTCoinInfo
|
|
15
15
|
from chia.wallet.wallet_nft_store import WalletNftStore
|
|
@@ -6,15 +6,15 @@ from pathlib import Path
|
|
|
6
6
|
from typing import Any, Optional
|
|
7
7
|
|
|
8
8
|
import pytest
|
|
9
|
+
from chia_rs.sized_bytes import bytes32
|
|
10
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
9
11
|
|
|
10
12
|
from chia._tests.util.time_out_assert import time_out_assert, time_out_assert_not_none
|
|
11
13
|
from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
|
|
12
14
|
from chia.simulator.full_node_simulator import FullNodeSimulator
|
|
13
15
|
from chia.simulator.simulator_protocol import FarmNewBlockProtocol
|
|
14
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
15
16
|
from chia.types.peer_info import PeerInfo
|
|
16
17
|
from chia.util.db_wrapper import DBWrapper2
|
|
17
|
-
from chia.util.ints import uint32, uint64
|
|
18
18
|
from chia.wallet.notification_store import NotificationStore
|
|
19
19
|
from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG
|
|
20
20
|
|
|
@@ -5,10 +5,10 @@ from dataclasses import dataclass, field
|
|
|
5
5
|
|
|
6
6
|
import pytest
|
|
7
7
|
from chia_rs import AugSchemeMPL
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import uint32
|
|
8
10
|
|
|
9
11
|
from chia._tests.util.db_connection import DBConnection
|
|
10
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
11
|
-
from chia.util.ints import uint32
|
|
12
12
|
from chia.wallet.derivation_record import DerivationRecord
|
|
13
13
|
from chia.wallet.util.wallet_types import WalletIdentifier, WalletType
|
|
14
14
|
from chia.wallet.wallet_puzzle_store import WalletPuzzleStore
|
|
@@ -4,16 +4,16 @@ import re
|
|
|
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 uint32, uint64
|
|
7
9
|
|
|
8
10
|
from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
|
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 CoinSpend, make_spend
|
|
14
15
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
15
16
|
from chia.util.db_wrapper import DBWrapper2, manage_connection
|
|
16
|
-
from chia.util.ints import uint32, uint64
|
|
17
17
|
from chia.wallet.derivation_record import DerivationRecord
|
|
18
18
|
from chia.wallet.derive_keys import master_sk_to_wallet_sk, master_sk_to_wallet_sk_unhardened
|
|
19
19
|
from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import (
|
|
@@ -6,6 +6,8 @@ from typing import Optional
|
|
|
6
6
|
import click
|
|
7
7
|
import pytest
|
|
8
8
|
from chia_rs import AugSchemeMPL, G1Element, G2Element, PrivateKey
|
|
9
|
+
from chia_rs.sized_bytes import bytes32
|
|
10
|
+
from chia_rs.sized_ints import uint64
|
|
9
11
|
from click.testing import CliRunner
|
|
10
12
|
|
|
11
13
|
from chia._tests.cmds.test_cmd_framework import check_click_parsing
|
|
@@ -34,10 +36,8 @@ from chia.rpc.wallet_request_types import (
|
|
|
34
36
|
from chia.rpc.wallet_rpc_client import WalletRpcClient
|
|
35
37
|
from chia.types.blockchain_format.coin import Coin as ConsensusCoin
|
|
36
38
|
from chia.types.blockchain_format.program import Program
|
|
37
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
38
39
|
from chia.types.coin_spend import CoinSpend, make_spend
|
|
39
40
|
from chia.util.hash import std_hash
|
|
40
|
-
from chia.util.ints import uint64
|
|
41
41
|
from chia.util.streamable import Streamable
|
|
42
42
|
from chia.wallet.conditions import AggSigMe
|
|
43
43
|
from chia.wallet.derivation_record import DerivationRecord
|
|
@@ -615,7 +615,7 @@ async def test_signer_commands(wallet_environments: WalletTestFramework) -> None
|
|
|
615
615
|
|
|
616
616
|
AMOUNT = uint64(1)
|
|
617
617
|
async with wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, sign=False, push=False) as action_scope:
|
|
618
|
-
await wallet.generate_signed_transaction(AMOUNT, bytes32.zeros, action_scope)
|
|
618
|
+
await wallet.generate_signed_transaction([AMOUNT], [bytes32.zeros], action_scope)
|
|
619
619
|
[tx] = action_scope.side_effects.transactions
|
|
620
620
|
|
|
621
621
|
runner = CliRunner()
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import pytest
|
|
4
|
+
from chia_rs.sized_bytes import bytes32
|
|
4
5
|
from clvm_tools import binutils
|
|
5
6
|
|
|
6
7
|
from chia.types.blockchain_format.program import INFINITE_COST, Program
|
|
7
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
8
8
|
from chia.util.condition_tools import parse_sexp_to_conditions
|
|
9
9
|
from chia.wallet.conditions import AssertPuzzleAnnouncement
|
|
10
|
-
from chia.wallet.puzzles.
|
|
11
|
-
|
|
12
|
-
SINGLETON_MOD = load_clvm("singleton_top_layer.clsp")
|
|
13
|
-
LAUNCHER_PUZZLE = load_clvm("singleton_launcher.clsp")
|
|
14
|
-
P2_SINGLETON_MOD = load_clvm("p2_singleton.clsp")
|
|
15
|
-
POOL_MEMBER_MOD = load_clvm("pool_member_innerpuz.clsp", package_or_requirement="chia.pools.puzzles")
|
|
16
|
-
POOL_WAITINGROOM_MOD = load_clvm("pool_waitingroom_innerpuz.clsp", package_or_requirement="chia.pools.puzzles")
|
|
17
|
-
|
|
18
|
-
LAUNCHER_PUZZLE_HASH = LAUNCHER_PUZZLE.get_tree_hash()
|
|
19
|
-
SINGLETON_MOD_HASH = SINGLETON_MOD.get_tree_hash()
|
|
10
|
+
from chia.wallet.puzzles.singleton_top_layer import P2_SINGLETON_MOD, SINGLETON_MOD, SINGLETON_MOD_HASH
|
|
11
|
+
from chia.wallet.puzzles.singleton_top_layer import SINGLETON_LAUNCHER_HASH as LAUNCHER_PUZZLE_HASH
|
|
20
12
|
|
|
21
13
|
LAUNCHER_ID = Program.to(b"launcher-id").get_tree_hash()
|
|
22
14
|
POOL_REWARD_PREFIX_MAINNET = bytes32.fromhex("ccd5bb71183532bff220ba46c268991a00000000000000000000000000000000")
|
|
@@ -4,31 +4,30 @@ from dataclasses import dataclass
|
|
|
4
4
|
from typing import Any, Callable, Optional, TypeVar, cast, get_args, get_origin
|
|
5
5
|
|
|
6
6
|
from chia_rs import G1Element, G2Element
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
8
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
7
9
|
from clvm_tools import binutils
|
|
8
10
|
|
|
9
11
|
from chia._tests.clvm.coin_store import BadSpendBundleError, CoinStore, CoinTimestamp
|
|
10
12
|
from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
|
13
|
+
from chia.pools.pool_puzzles import POOL_MEMBER_MOD
|
|
14
|
+
from chia.pools.pool_puzzles import POOL_WAITING_ROOM_MOD as POOL_WAITINGROOM_MOD
|
|
11
15
|
from chia.types.blockchain_format.coin import Coin
|
|
12
16
|
from chia.types.blockchain_format.program import Program
|
|
13
17
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
14
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
15
18
|
from chia.types.coin_spend import CoinSpend, compute_additions, make_spend
|
|
16
19
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
17
|
-
from chia.util.ints import uint32, uint64
|
|
18
20
|
from chia.wallet.conditions import AssertCoinAnnouncement
|
|
19
|
-
from chia.wallet.puzzles.
|
|
21
|
+
from chia.wallet.puzzles.singleton_top_layer import (
|
|
22
|
+
P2_SINGLETON_OR_DELAYED_MOD as P2_SINGLETON_MOD,
|
|
23
|
+
)
|
|
24
|
+
from chia.wallet.puzzles.singleton_top_layer import P2_SINGLETON_OR_DELAYED_MOD_HASH as P2_SINGLETON_MOD_HASH
|
|
25
|
+
from chia.wallet.puzzles.singleton_top_layer import SINGLETON_LAUNCHER, SINGLETON_MOD, SINGLETON_MOD_HASH
|
|
26
|
+
from chia.wallet.puzzles.singleton_top_layer import SINGLETON_LAUNCHER_HASH as LAUNCHER_PUZZLE_HASH
|
|
20
27
|
from chia.wallet.util.debug_spend_bundle import debug_spend_bundle
|
|
21
28
|
from chia.wallet.wallet_spend_bundle import WalletSpendBundle
|
|
22
29
|
|
|
23
|
-
|
|
24
|
-
LAUNCHER_PUZZLE = load_clvm("singleton_launcher.clsp")
|
|
25
|
-
P2_SINGLETON_MOD = load_clvm("p2_singleton_or_delayed_puzhash.clsp")
|
|
26
|
-
POOL_MEMBER_MOD = load_clvm("pool_member_innerpuz.clsp", package_or_requirement="chia.pools.puzzles")
|
|
27
|
-
POOL_WAITINGROOM_MOD = load_clvm("pool_waitingroom_innerpuz.clsp", package_or_requirement="chia.pools.puzzles")
|
|
28
|
-
|
|
29
|
-
LAUNCHER_PUZZLE_HASH = LAUNCHER_PUZZLE.get_tree_hash()
|
|
30
|
-
SINGLETON_MOD_HASH = SINGLETON_MOD.get_tree_hash()
|
|
31
|
-
P2_SINGLETON_MOD_HASH = P2_SINGLETON_MOD.get_tree_hash()
|
|
30
|
+
LAUNCHER_PUZZLE = SINGLETON_LAUNCHER
|
|
32
31
|
|
|
33
32
|
ANYONE_CAN_SPEND_PUZZLE = Program.to(1)
|
|
34
33
|
ANYONE_CAN_SPEND_WITH_PADDING_PUZZLE_HASH = Program.to(binutils.assemble("(a (q . 1) 3)")).get_tree_hash()
|
|
@@ -386,7 +385,7 @@ def claim_p2_singleton(
|
|
|
386
385
|
p2_singleton_puzzle,
|
|
387
386
|
p2_singleton_spend_type="claim-p2-nft",
|
|
388
387
|
singleton_inner_puzzle_hash=inner_puzzle_hash,
|
|
389
|
-
p2_singleton_coin_name=p2_singleton_coin_name,
|
|
388
|
+
p2_singleton_coin_name=bytes32(p2_singleton_coin_name),
|
|
390
389
|
)
|
|
391
390
|
p2_singleton_coin_spend = make_spend(
|
|
392
391
|
p2_singleton_coin, SerializedProgram.from_program(p2_singleton_puzzle), p2_singleton_solution
|
|
@@ -4,15 +4,13 @@ from __future__ import annotations
|
|
|
4
4
|
from secrets import token_bytes
|
|
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.util.db_connection import DBConnection
|
|
9
11
|
from chia.types.blockchain_format.coin import Coin
|
|
10
12
|
from chia.types.blockchain_format.program import Program
|
|
11
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
12
13
|
from chia.types.coin_spend import make_spend
|
|
13
|
-
from chia.util.ints import uint32, uint64
|
|
14
|
-
|
|
15
|
-
# from chia.wallet.dao_wallet.dao_wallet import DAOInfo, DAOWallet
|
|
16
14
|
from chia.wallet.lineage_proof import LineageProof
|
|
17
15
|
from chia.wallet.singleton import create_singleton_puzzle
|
|
18
16
|
from chia.wallet.singleton_record import SingletonRecord
|