chia-blockchain 2.5.2rc2__py3-none-any.whl → 2.5.3rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chia/__init__.py +7 -0
- chia/_tests/blockchain/blockchain_test_utils.py +1 -1
- chia/_tests/blockchain/test_augmented_chain.py +54 -5
- chia/_tests/blockchain/test_blockchain.py +5 -12
- chia/_tests/blockchain/test_blockchain_transactions.py +3 -5
- chia/_tests/blockchain/test_get_block_generator.py +2 -2
- chia/_tests/blockchain/test_lookup_fork_chain.py +2 -2
- chia/_tests/clvm/benchmark_costs.py +2 -1
- chia/_tests/clvm/coin_store.py +4 -3
- chia/_tests/clvm/test_chialisp_deserialization.py +2 -2
- chia/_tests/clvm/test_curry_and_treehash.py +1 -1
- chia/_tests/clvm/test_puzzle_compression.py +2 -2
- chia/_tests/clvm/test_puzzles.py +2 -2
- chia/_tests/clvm/test_singletons.py +2 -2
- chia/_tests/clvm/test_spend_sim.py +1 -1
- chia/_tests/cmds/cmd_test_utils.py +2 -2
- chia/_tests/cmds/test_click_types.py +2 -2
- chia/_tests/cmds/test_cmd_framework.py +6 -6
- chia/_tests/cmds/test_show.py +4 -3
- chia/_tests/cmds/test_tx_config_args.py +1 -1
- chia/_tests/cmds/testing_classes.py +2 -2
- chia/_tests/cmds/wallet/test_consts.py +2 -2
- chia/_tests/cmds/wallet/test_did.py +2 -2
- chia/_tests/cmds/wallet/test_nft.py +2 -2
- chia/_tests/cmds/wallet/test_notifications.py +3 -2
- chia/_tests/cmds/wallet/test_vcs.py +2 -2
- chia/_tests/cmds/wallet/test_wallet.py +4 -8
- chia/_tests/conftest.py +4 -3
- chia/_tests/connection_utils.py +2 -2
- chia/_tests/core/cmds/test_keys.py +1 -2
- chia/_tests/core/cmds/test_wallet.py +2 -2
- chia/_tests/core/consensus/test_block_creation.py +2 -2
- chia/_tests/core/consensus/test_pot_iterations.py +1 -1
- chia/_tests/core/custom_types/test_coin.py +2 -2
- chia/_tests/core/custom_types/test_proof_of_space.py +2 -2
- chia/_tests/core/custom_types/test_spend_bundle.py +2 -2
- chia/_tests/core/data_layer/conftest.py +1 -1
- chia/_tests/core/data_layer/test_data_layer.py +1 -1
- chia/_tests/core/data_layer/test_data_layer_util.py +1 -1
- chia/_tests/core/data_layer/test_data_rpc.py +2 -2
- chia/_tests/core/data_layer/test_data_store.py +1 -1
- chia/_tests/core/data_layer/test_data_store_schema.py +1 -1
- chia/_tests/core/data_layer/util.py +2 -1
- chia/_tests/core/farmer/test_farmer_api.py +1 -1
- chia/_tests/core/full_node/full_sync/test_full_sync.py +1 -7
- chia/_tests/core/full_node/ram_db.py +2 -1
- chia/_tests/core/full_node/stores/test_block_store.py +2 -2
- chia/_tests/core/full_node/stores/test_coin_store.py +2 -2
- chia/_tests/core/full_node/stores/test_full_node_store.py +3 -3
- chia/_tests/core/full_node/stores/test_hint_store.py +2 -2
- chia/_tests/core/full_node/stores/test_sync_store.py +1 -1
- chia/_tests/core/full_node/test_address_manager.py +1 -1
- chia/_tests/core/full_node/test_block_height_map.py +2 -2
- chia/_tests/core/full_node/test_conditions.py +1 -1
- chia/_tests/core/full_node/test_full_node.py +346 -164
- chia/_tests/core/full_node/test_generator_tools.py +3 -2
- chia/_tests/core/full_node/test_hint_management.py +2 -2
- chia/_tests/core/full_node/test_performance.py +2 -15
- chia/_tests/core/full_node/test_subscriptions.py +1 -1
- chia/_tests/core/full_node/test_transactions.py +186 -185
- chia/_tests/core/full_node/test_tx_processing_queue.py +1 -1
- chia/_tests/core/make_block_generator.py +2 -2
- chia/_tests/core/mempool/test_mempool.py +165 -22
- chia/_tests/core/mempool/test_mempool_fee_estimator.py +1 -1
- chia/_tests/core/mempool/test_mempool_fee_protocol.py +1 -1
- chia/_tests/core/mempool/test_mempool_manager.py +476 -66
- chia/_tests/core/mempool/test_mempool_performance.py +2 -2
- chia/_tests/core/mempool/test_singleton_fast_forward.py +19 -25
- chia/_tests/core/node_height.py +2 -1
- chia/_tests/core/server/test_capabilities.py +1 -1
- chia/_tests/core/server/test_dos.py +36 -28
- chia/_tests/core/server/test_loop.py +3 -3
- chia/_tests/core/server/test_rate_limits.py +1 -1
- chia/_tests/core/server/test_server.py +2 -2
- chia/_tests/core/services/test_services.py +1 -1
- chia/_tests/core/ssl/test_ssl.py +1 -1
- chia/_tests/core/test_coins.py +2 -1
- chia/_tests/core/test_cost_calculation.py +2 -2
- chia/_tests/core/test_crawler.py +2 -2
- chia/_tests/core/test_db_conversion.py +2 -2
- chia/_tests/core/test_db_validation.py +26 -13
- chia/_tests/core/test_farmer_harvester_rpc.py +2 -2
- chia/_tests/core/test_full_node_rpc.py +2 -2
- chia/_tests/core/test_merkle_set.py +2 -2
- chia/_tests/core/test_program.py +2 -2
- chia/_tests/core/test_rpc_util.py +1 -1
- chia/_tests/core/test_seeder.py +1 -1
- chia/_tests/core/util/test_block_cache.py +3 -3
- chia/_tests/core/util/test_jsonify.py +3 -2
- chia/_tests/core/util/test_keychain.py +3 -3
- chia/_tests/core/util/test_streamable.py +3 -4
- chia/_tests/environments/wallet.py +3 -2
- chia/_tests/farmer_harvester/test_farmer.py +3 -4
- chia/_tests/farmer_harvester/test_farmer_harvester.py +2 -2
- chia/_tests/farmer_harvester/test_filter_prefix_bits.py +2 -2
- chia/_tests/farmer_harvester/test_third_party_harvesters.py +3 -4
- chia/_tests/fee_estimation/test_fee_estimation_integration.py +1 -1
- chia/_tests/fee_estimation/test_fee_estimation_rpc.py +2 -2
- chia/_tests/fee_estimation/test_fee_estimation_unit_tests.py +1 -1
- chia/_tests/fee_estimation/test_mempoolitem_height_added.py +3 -4
- chia/_tests/generator/test_compression.py +20 -10
- chia/_tests/generator/test_rom.py +7 -9
- chia/_tests/plot_sync/test_delta.py +2 -2
- chia/_tests/plot_sync/test_plot_sync.py +2 -2
- chia/_tests/plot_sync/test_receiver.py +2 -2
- chia/_tests/plot_sync/test_sender.py +2 -2
- chia/_tests/plot_sync/test_sync_simulated.py +2 -2
- chia/_tests/plot_sync/util.py +3 -2
- chia/_tests/plotting/test_plot_manager.py +1 -1
- chia/_tests/pools/test_pool_cli_parsing.py +3 -2
- chia/_tests/pools/test_pool_cmdline.py +2 -2
- chia/_tests/pools/test_pool_puzzles_lifecycle.py +3 -3
- chia/_tests/pools/test_pool_rpc.py +4 -5
- chia/_tests/pools/test_pool_wallet.py +1 -1
- chia/_tests/pools/test_wallet_pool_store.py +2 -2
- chia/_tests/rpc/test_rpc_client.py +1 -1
- chia/_tests/rpc/test_rpc_server.py +1 -1
- chia/_tests/simulation/test_simulation.py +36 -8
- chia/_tests/simulation/test_simulator.py +5 -5
- chia/_tests/simulation/test_start_simulator.py +2 -2
- chia/_tests/timelord/test_new_peak.py +2 -2
- chia/_tests/tools/test_run_block.py +3 -2
- chia/_tests/util/benchmark_cost.py +2 -2
- chia/_tests/util/benchmarks.py +17 -6
- chia/_tests/util/blockchain.py +2 -1
- chia/_tests/util/blockchain_mock.py +9 -5
- chia/_tests/util/build_network_protocol_files.py +2 -1
- chia/_tests/util/constants.py +2 -1
- chia/_tests/util/full_sync.py +6 -3
- chia/_tests/util/gen_ssl_certs.py +2 -2
- chia/_tests/util/generator_tools_testing.py +4 -3
- chia/_tests/util/get_name_puzzle_conditions.py +2 -2
- chia/_tests/util/misc.py +16 -2
- chia/_tests/util/network_protocol_data.py +17 -7
- chia/_tests/util/run_block.py +6 -8
- chia/_tests/util/setup_nodes.py +4 -3
- chia/_tests/util/spend_sim.py +9 -5
- chia/_tests/util/test_condition_tools.py +2 -2
- chia/_tests/util/test_config.py +2 -1
- chia/_tests/util/test_errors.py +2 -1
- chia/_tests/util/test_full_block_utils.py +17 -7
- chia/_tests/util/test_misc.py +1 -1
- chia/_tests/util/test_network_protocol_test.py +24 -24
- chia/_tests/util/test_replace_str_to_bytes.py +2 -2
- chia/_tests/util/test_trusted_peer.py +1 -1
- chia/_tests/util/time_out_assert.py +20 -7
- chia/_tests/wallet/cat_wallet/test_cat_lifecycle.py +1 -1
- chia/_tests/wallet/cat_wallet/test_cat_outer_puzzle.py +2 -2
- chia/_tests/wallet/cat_wallet/test_cat_wallet.py +5 -6
- chia/_tests/wallet/cat_wallet/test_offer_lifecycle.py +17 -15
- chia/_tests/wallet/cat_wallet/test_trades.py +2 -2
- chia/_tests/wallet/clawback/test_clawback_lifecycle.py +2 -2
- chia/_tests/wallet/clawback/test_clawback_metadata.py +2 -2
- chia/_tests/wallet/conftest.py +3 -3
- chia/_tests/wallet/db_wallet/test_db_graftroot.py +3 -5
- chia/_tests/wallet/db_wallet/test_dl_offers.py +2 -2
- chia/_tests/wallet/db_wallet/test_dl_wallet.py +433 -384
- chia/_tests/wallet/did_wallet/test_did.py +3 -3
- chia/_tests/wallet/nft_wallet/test_nft_1_offers.py +2 -2
- chia/_tests/wallet/nft_wallet/test_nft_bulk_mint.py +2 -2
- chia/_tests/wallet/nft_wallet/test_nft_lifecycle.py +3 -4
- chia/_tests/wallet/nft_wallet/test_nft_offers.py +1293 -703
- chia/_tests/wallet/nft_wallet/test_nft_puzzles.py +28 -30
- chia/_tests/wallet/nft_wallet/test_nft_wallet.py +2 -2
- chia/_tests/wallet/nft_wallet/test_ownership_outer_puzzle.py +2 -2
- chia/_tests/wallet/rpc/config.py +1 -1
- chia/_tests/wallet/rpc/test_dl_wallet_rpc.py +2 -2
- chia/_tests/wallet/rpc/test_wallet_rpc.py +20 -77
- chia/_tests/wallet/simple_sync/test_simple_sync_protocol.py +9 -7
- chia/_tests/wallet/sync/test_wallet_sync.py +79 -31
- chia/_tests/wallet/test_clvm_streamable.py +2 -2
- chia/_tests/wallet/test_coin_management.py +7 -7
- chia/_tests/wallet/test_coin_selection.py +20 -2
- chia/_tests/wallet/test_conditions.py +2 -2
- chia/_tests/wallet/test_debug_spend_bundle.py +2 -2
- chia/_tests/wallet/test_new_wallet_protocol.py +2 -2
- chia/_tests/wallet/test_nft_store.py +2 -2
- chia/_tests/wallet/test_notifications.py +2 -2
- chia/_tests/wallet/test_puzzle_store.py +2 -2
- chia/_tests/wallet/test_sign_coin_spends.py +2 -2
- chia/_tests/wallet/test_signer_protocol.py +3 -3
- chia/_tests/wallet/test_singleton.py +3 -11
- chia/_tests/wallet/test_singleton_lifecycle_fast.py +12 -13
- chia/_tests/wallet/test_singleton_store.py +2 -4
- chia/_tests/wallet/test_transaction_store.py +2 -2
- chia/_tests/wallet/test_util.py +2 -2
- chia/_tests/wallet/test_wallet.py +53 -49
- chia/_tests/wallet/test_wallet_action_scope.py +24 -6
- chia/_tests/wallet/test_wallet_blockchain.py +1 -1
- chia/_tests/wallet/test_wallet_coin_store.py +2 -2
- chia/_tests/wallet/test_wallet_interested_store.py +2 -2
- chia/_tests/wallet/test_wallet_node.py +3 -3
- chia/_tests/wallet/test_wallet_retry.py +3 -3
- chia/_tests/wallet/test_wallet_state_manager.py +8 -8
- chia/_tests/wallet/test_wallet_test_framework.py +1 -1
- chia/_tests/wallet/test_wallet_trade_store.py +2 -2
- chia/_tests/wallet/test_wallet_utils.py +2 -2
- chia/_tests/wallet/vc_wallet/test_cr_outer_puzzle.py +3 -2
- chia/_tests/wallet/vc_wallet/test_vc_lifecycle.py +15 -15
- chia/_tests/wallet/vc_wallet/test_vc_wallet.py +5 -3
- chia/_tests/wallet/wallet_block_tools.py +15 -7
- chia/_tests/weight_proof/test_weight_proof.py +3 -3
- chia/cmds/chia.py +0 -2
- chia/cmds/cmd_classes.py +3 -3
- chia/cmds/cmd_helpers.py +4 -4
- chia/cmds/cmds_util.py +2 -2
- chia/cmds/coin_funcs.py +3 -2
- chia/cmds/coins.py +1 -1
- chia/cmds/data.py +2 -2
- chia/cmds/data_funcs.py +3 -2
- chia/cmds/db_upgrade_func.py +2 -2
- chia/cmds/db_validate_func.py +15 -8
- chia/cmds/farm.py +2 -4
- chia/cmds/keys.py +0 -2
- chia/cmds/keys_funcs.py +1 -1
- chia/cmds/netspace_funcs.py +2 -1
- chia/cmds/param_types.py +2 -2
- chia/cmds/plotnft.py +2 -2
- chia/cmds/plotnft_funcs.py +2 -2
- chia/cmds/rpc.py +1 -1
- chia/cmds/show.py +1 -2
- chia/cmds/show_funcs.py +6 -3
- chia/cmds/signer.py +1 -2
- chia/cmds/sim.py +1 -2
- chia/cmds/sim_funcs.py +2 -2
- chia/cmds/wallet.py +2 -2
- chia/cmds/wallet_funcs.py +4 -11
- chia/consensus/block_body_validation.py +3 -4
- chia/consensus/block_creation.py +10 -6
- chia/consensus/block_header_validation.py +3 -4
- chia/consensus/block_record.py +2 -3
- chia/consensus/block_rewards.py +1 -1
- chia/consensus/blockchain.py +20 -17
- chia/consensus/blockchain_interface.py +5 -4
- chia/consensus/coinbase.py +2 -2
- chia/consensus/constants.py +1 -1
- chia/consensus/cost_calculator.py +2 -1
- chia/consensus/default_constants.py +4 -3
- chia/consensus/deficit.py +3 -2
- chia/consensus/difficulty_adjustment.py +8 -9
- chia/consensus/find_fork_point.py +4 -3
- chia/consensus/full_block_to_block_record.py +4 -3
- chia/consensus/get_block_challenge.py +4 -3
- chia/consensus/get_block_generator.py +3 -2
- chia/consensus/make_sub_epoch_summary.py +3 -2
- chia/consensus/multiprocess_validation.py +9 -4
- chia/consensus/pos_quality.py +1 -1
- chia/consensus/pot_iterations.py +4 -3
- chia/consensus/vdf_info_computation.py +4 -3
- chia/daemon/client.py +1 -1
- chia/daemon/keychain_server.py +1 -1
- chia/daemon/server.py +1 -1
- chia/daemon/windows_signal.py +1 -1
- chia/data_layer/data_layer.py +4 -3
- chia/data_layer/data_layer_errors.py +1 -1
- chia/data_layer/data_layer_util.py +2 -2
- chia/data_layer/data_layer_wallet.py +47 -69
- chia/data_layer/data_store.py +1 -1
- chia/data_layer/dl_wallet_store.py +5 -6
- chia/data_layer/download_data.py +1 -1
- chia/data_layer/s3_plugin_service.py +4 -4
- chia/data_layer/singleton_record.py +23 -0
- chia/data_layer/util/benchmark.py +2 -1
- chia/farmer/farmer.py +4 -6
- chia/farmer/farmer_api.py +4 -6
- chia/full_node/bitcoin_fee_estimator.py +2 -1
- chia/full_node/block_height_map.py +2 -2
- chia/full_node/block_store.py +8 -9
- chia/{util → full_node}/check_fork_next_block.py +2 -1
- chia/full_node/coin_store.py +10 -10
- chia/full_node/fee_estimate.py +2 -1
- chia/full_node/fee_estimation.py +2 -1
- chia/full_node/fee_estimator.py +2 -1
- chia/full_node/fee_estimator_interface.py +1 -1
- chia/full_node/fee_history.py +2 -1
- chia/full_node/fee_tracker.py +2 -1
- chia/full_node/full_node.py +15 -13
- chia/full_node/full_node_api.py +12 -32
- chia/full_node/full_node_store.py +4 -3
- chia/full_node/hint_management.py +2 -1
- chia/full_node/hint_store.py +3 -3
- chia/full_node/mempool.py +79 -12
- chia/full_node/mempool_check_conditions.py +6 -7
- chia/full_node/mempool_manager.py +168 -21
- chia/full_node/pending_tx_cache.py +2 -2
- chia/full_node/subscriptions.py +2 -2
- chia/full_node/sync_store.py +2 -3
- chia/full_node/tx_processing_queue.py +2 -1
- chia/full_node/weight_proof.py +5 -8
- chia/harvester/harvester.py +5 -3
- chia/harvester/harvester_api.py +2 -2
- chia/introducer/introducer.py +30 -2
- chia/introducer/introducer_api.py +9 -1
- chia/legacy/keyring.py +1 -2
- chia/plot_sync/exceptions.py +2 -1
- chia/plot_sync/receiver.py +2 -2
- chia/plot_sync/sender.py +1 -1
- chia/plotting/cache.py +2 -2
- chia/plotting/check_plots.py +4 -2
- chia/plotting/create_plots.py +1 -1
- chia/plotting/manager.py +3 -3
- chia/plotting/util.py +2 -2
- chia/pools/pool_config.py +1 -1
- chia/pools/pool_puzzles.py +23 -17
- chia/pools/pool_wallet.py +22 -9
- chia/pools/pool_wallet_info.py +2 -2
- chia/protocols/farmer_protocol.py +3 -6
- chia/protocols/full_node_protocol.py +3 -2
- chia/protocols/harvester_protocol.py +3 -4
- chia/protocols/pool_protocol.py +2 -2
- chia/protocols/shared_protocol.py +2 -1
- chia/protocols/timelord_protocol.py +4 -4
- chia/protocols/wallet_protocol.py +2 -2
- chia/rpc/data_layer_rpc_api.py +3 -4
- chia/rpc/data_layer_rpc_client.py +3 -2
- chia/rpc/farmer_rpc_api.py +2 -2
- chia/rpc/farmer_rpc_client.py +2 -1
- chia/rpc/full_node_rpc_api.py +3 -2
- chia/rpc/full_node_rpc_client.py +3 -2
- chia/rpc/harvester_rpc_api.py +2 -1
- chia/rpc/rpc_client.py +2 -2
- chia/rpc/rpc_server.py +1 -1
- chia/rpc/wallet_request_types.py +2 -62
- chia/rpc/wallet_rpc_api.py +98 -628
- chia/rpc/wallet_rpc_client.py +5 -253
- chia/seeder/crawl_store.py +1 -1
- chia/seeder/crawler.py +2 -2
- chia/seeder/peer_record.py +2 -1
- chia/seeder/start_crawler.py +3 -1
- chia/server/address_manager.py +2 -1
- chia/server/address_manager_store.py +1 -1
- chia/server/capabilities.py +2 -1
- chia/server/introducer_peers.py +2 -1
- chia/server/node_discovery.py +1 -1
- chia/server/outbound_message.py +2 -1
- chia/server/server.py +2 -2
- chia/server/start_data_layer.py +2 -1
- chia/server/start_farmer.py +3 -1
- chia/server/start_full_node.py +4 -2
- chia/server/start_harvester.py +3 -1
- chia/server/start_introducer.py +12 -1
- chia/server/start_service.py +2 -1
- chia/server/start_timelord.py +3 -1
- chia/server/start_wallet.py +3 -1
- chia/server/upnp.py +1 -2
- chia/server/ws_connection.py +3 -4
- chia/simulator/add_blocks_in_batches.py +5 -3
- chia/simulator/block_tools.py +16 -12
- chia/simulator/full_node_simulator.py +9 -14
- chia/simulator/setup_services.py +5 -3
- chia/simulator/simulator_full_node_rpc_api.py +3 -2
- chia/simulator/simulator_full_node_rpc_client.py +3 -2
- chia/simulator/simulator_protocol.py +3 -2
- chia/simulator/simulator_test_tools.py +2 -2
- chia/simulator/start_simulator.py +3 -2
- chia/simulator/wallet_tools.py +3 -4
- chia/timelord/iters_from_block.py +4 -4
- chia/timelord/timelord.py +7 -12
- chia/timelord/timelord_api.py +3 -3
- chia/timelord/timelord_state.py +4 -3
- chia/types/block_protocol.py +2 -2
- chia/types/blockchain_format/coin.py +2 -2
- chia/types/blockchain_format/program.py +1 -1
- chia/types/blockchain_format/proof_of_space.py +3 -4
- chia/types/blockchain_format/tree_hash.py +1 -1
- chia/types/blockchain_format/vdf.py +3 -4
- chia/types/clvm_cost.py +1 -1
- chia/types/coin_record.py +4 -3
- chia/types/coin_spend.py +1 -1
- chia/types/eligible_coin_spends.py +9 -5
- chia/types/fee_rate.py +1 -1
- chia/types/generator_types.py +3 -3
- chia/types/internal_mempool_item.py +3 -2
- chia/types/mempool_item.py +10 -3
- chia/types/mempool_submission_status.py +2 -1
- chia/types/mojos.py +1 -1
- chia/types/peer_info.py +2 -1
- chia/types/transaction_queue_entry.py +2 -1
- chia/types/unfinished_header_block.py +4 -4
- chia/types/validation_state.py +2 -1
- chia/types/weight_proof.py +1 -9
- chia/util/augmented_chain.py +20 -9
- chia/util/block_cache.py +8 -4
- chia/util/condition_tools.py +2 -2
- chia/util/full_block_utils.py +3 -4
- chia/util/generator_tools.py +2 -2
- chia/util/initial-config.yaml +2 -11
- chia/util/network.py +2 -2
- chia/util/prev_transaction_block.py +2 -1
- chia/util/task_timing.py +1 -1
- chia/util/vdf_prover.py +3 -3
- chia/util/ws_message.py +1 -1
- chia/wallet/cat_wallet/cat_info.py +3 -2
- chia/wallet/cat_wallet/cat_outer_puzzle.py +3 -2
- chia/wallet/cat_wallet/cat_utils.py +6 -4
- chia/wallet/cat_wallet/cat_wallet.py +16 -18
- chia/wallet/cat_wallet/lineage_store.py +2 -1
- chia/wallet/coin_selection.py +5 -5
- chia/wallet/conditions.py +22 -16
- chia/wallet/db_wallet/db_wallet_puzzles.py +15 -15
- chia/wallet/derivation_record.py +2 -2
- chia/wallet/derive_keys.py +2 -2
- chia/wallet/did_wallet/did_info.py +3 -2
- chia/wallet/did_wallet/did_wallet.py +41 -19
- chia/wallet/did_wallet/did_wallet_puzzles.py +18 -12
- chia/wallet/driver_protocol.py +1 -1
- chia/wallet/lineage_proof.py +3 -2
- chia/wallet/nft_wallet/metadata_outer_puzzle.py +6 -7
- chia/wallet/nft_wallet/nft_info.py +5 -5
- chia/wallet/nft_wallet/nft_puzzle_utils.py +293 -0
- chia/wallet/nft_wallet/nft_puzzles.py +21 -298
- chia/wallet/nft_wallet/nft_wallet.py +47 -62
- chia/wallet/nft_wallet/ownership_outer_puzzle.py +4 -8
- chia/wallet/nft_wallet/singleton_outer_puzzle.py +3 -2
- chia/wallet/nft_wallet/transfer_program_puzzle.py +6 -10
- chia/wallet/nft_wallet/uncurry_nft.py +6 -8
- chia/wallet/notification_manager.py +5 -5
- chia/wallet/notification_store.py +3 -2
- chia/wallet/outer_puzzles.py +2 -1
- chia/wallet/puzzles/clawback/drivers.py +21 -8
- chia/wallet/puzzles/clawback/metadata.py +3 -2
- chia/wallet/puzzles/clawback/puzzle_decorator.py +5 -4
- chia/wallet/puzzles/deployed_puzzle_hashes.json +0 -10
- chia/wallet/puzzles/p2_conditions.py +3 -2
- chia/wallet/puzzles/p2_delegated_conditions.py +3 -2
- chia/wallet/puzzles/p2_delegated_puzzle.py +3 -2
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py +3 -3
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.py +3 -2
- chia/wallet/puzzles/p2_puzzle_hash.py +4 -3
- chia/wallet/puzzles/puzzle_utils.py +3 -2
- chia/wallet/puzzles/singleton_top_layer.py +26 -10
- chia/wallet/puzzles/singleton_top_layer_v1_1.py +21 -9
- chia/wallet/puzzles/tails.py +21 -129
- chia/wallet/signer_protocol.py +3 -2
- chia/wallet/singleton.py +12 -6
- chia/wallet/singleton_record.py +3 -2
- chia/wallet/trade_manager.py +31 -55
- chia/wallet/trade_record.py +3 -2
- chia/wallet/trading/offer.py +14 -13
- chia/wallet/trading/trade_store.py +3 -4
- chia/wallet/transaction_record.py +2 -2
- chia/wallet/util/blind_signer_tl.py +3 -2
- chia/wallet/util/compute_hints.py +3 -2
- chia/wallet/util/compute_memos.py +2 -2
- chia/wallet/util/curry_and_treehash.py +1 -2
- chia/wallet/util/merkle_tree.py +1 -1
- chia/wallet/util/merkle_utils.py +1 -1
- chia/wallet/util/new_peak_queue.py +2 -1
- chia/wallet/util/notifications.py +5 -4
- chia/wallet/util/peer_request_cache.py +3 -2
- chia/wallet/util/puzzle_compression.py +6 -4
- chia/wallet/util/puzzle_decorator.py +6 -4
- chia/wallet/util/query_filter.py +3 -2
- chia/wallet/util/tx_config.py +3 -3
- chia/wallet/util/wallet_sync_utils.py +2 -2
- chia/wallet/util/wallet_types.py +2 -3
- chia/wallet/vc_wallet/cr_cat_drivers.py +18 -22
- chia/wallet/vc_wallet/cr_cat_wallet.py +14 -10
- chia/wallet/vc_wallet/cr_outer_puzzle.py +2 -2
- chia/wallet/vc_wallet/vc_drivers.py +50 -68
- chia/wallet/vc_wallet/vc_store.py +2 -2
- chia/wallet/vc_wallet/vc_wallet.py +47 -15
- chia/wallet/wallet.py +51 -46
- chia/wallet/wallet_action_scope.py +4 -0
- chia/wallet/wallet_blockchain.py +12 -7
- chia/wallet/wallet_coin_record.py +3 -2
- chia/wallet/wallet_coin_store.py +3 -2
- chia/wallet/wallet_info.py +2 -1
- chia/wallet/wallet_interested_store.py +3 -2
- chia/wallet/wallet_nft_store.py +4 -4
- chia/wallet/wallet_node.py +3 -4
- chia/wallet/wallet_pool_store.py +3 -4
- chia/wallet/wallet_protocol.py +19 -5
- chia/wallet/wallet_puzzle_store.py +2 -2
- chia/wallet/wallet_retry_store.py +3 -6
- chia/wallet/wallet_singleton_store.py +2 -2
- chia/wallet/wallet_state_manager.py +20 -197
- chia/wallet/wallet_transaction_store.py +2 -2
- chia/wallet/wallet_user_store.py +2 -1
- chia/wallet/wallet_weight_proof_handler.py +3 -2
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc1.dist-info}/METADATA +3 -2
- chia_blockchain-2.5.3rc1.dist-info/RECORD +891 -0
- mozilla-ca/cacert.pem +64 -33
- chia/_tests/clvm/test_condition_codes.py +0 -13
- chia/_tests/cmds/wallet/test_dao.py +0 -565
- chia/_tests/wallet/dao_wallet/__init__.py +0 -0
- chia/_tests/wallet/dao_wallet/config.py +0 -3
- chia/_tests/wallet/dao_wallet/test_dao_clvm.py +0 -1330
- chia/_tests/wallet/dao_wallet/test_dao_wallets.py +0 -3488
- chia/cmds/dao.py +0 -1064
- chia/cmds/dao_funcs.py +0 -598
- chia/consensus/puzzles/__init__.py +0 -0
- chia/consensus/puzzles/chialisp_deserialisation.clsp +0 -69
- chia/consensus/puzzles/chialisp_deserialisation.clsp.hex +0 -1
- chia/consensus/puzzles/rom_bootstrap_generator.clsp +0 -37
- chia/consensus/puzzles/rom_bootstrap_generator.clsp.hex +0 -1
- chia/full_node/puzzles/__init__.py +0 -0
- chia/full_node/puzzles/block_program_zero.clsp +0 -14
- chia/full_node/puzzles/block_program_zero.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_coin_spend_entry.clsp +0 -5
- chia/full_node/puzzles/decompress_coin_spend_entry.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp +0 -7
- chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_puzzle.clsp +0 -6
- chia/full_node/puzzles/decompress_puzzle.clsp.hex +0 -1
- chia/pools/puzzles/__init__.py +0 -0
- chia/pools/puzzles/pool_member_innerpuz.clsp +0 -70
- chia/pools/puzzles/pool_member_innerpuz.clsp.hex +0 -1
- chia/pools/puzzles/pool_waitingroom_innerpuz.clsp +0 -69
- chia/pools/puzzles/pool_waitingroom_innerpuz.clsp.hex +0 -1
- chia/simulator/simulator_constants.py +0 -13
- chia/types/blockchain_format/foliage.py +0 -8
- chia/types/blockchain_format/pool_target.py +0 -5
- chia/types/blockchain_format/reward_chain_block.py +0 -6
- chia/types/blockchain_format/sized_bytes.py +0 -11
- chia/util/ints.py +0 -19
- chia/wallet/cat_wallet/dao_cat_info.py +0 -28
- chia/wallet/cat_wallet/dao_cat_wallet.py +0 -669
- chia/wallet/cat_wallet/puzzles/__init__.py +0 -0
- chia/wallet/cat_wallet/puzzles/cat_truths.clib +0 -31
- chia/wallet/cat_wallet/puzzles/cat_v2.clsp +0 -397
- chia/wallet/cat_wallet/puzzles/cat_v2.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/delegated_tail.clsp +0 -25
- chia/wallet/cat_wallet/puzzles/delegated_tail.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp +0 -15
- chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp +0 -26
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp +0 -42
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp +0 -24
- chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp.hex +0 -1
- chia/wallet/dao_wallet/__init__.py +0 -0
- chia/wallet/dao_wallet/dao_info.py +0 -61
- chia/wallet/dao_wallet/dao_utils.py +0 -811
- chia/wallet/dao_wallet/dao_wallet.py +0 -2119
- chia/wallet/did_wallet/puzzles/__init__.py +0 -0
- chia/wallet/did_wallet/puzzles/did_innerpuz.clsp +0 -135
- chia/wallet/did_wallet/puzzles/did_innerpuz.clsp.hex +0 -1
- chia/wallet/payment.py +0 -33
- chia/wallet/puzzles/augmented_condition.clsp +0 -13
- chia/wallet/puzzles/augmented_condition.clsp.hex +0 -1
- chia/wallet/puzzles/condition_codes.clib +0 -77
- chia/wallet/puzzles/curry-and-treehash.clib +0 -102
- chia/wallet/puzzles/curry.clib +0 -135
- chia/wallet/puzzles/curry_by_index.clib +0 -16
- chia/wallet/puzzles/dao_cat_eve.clsp +0 -17
- chia/wallet/puzzles/dao_cat_eve.clsp.hex +0 -1
- chia/wallet/puzzles/dao_cat_launcher.clsp +0 -36
- chia/wallet/puzzles/dao_cat_launcher.clsp.hex +0 -1
- chia/wallet/puzzles/dao_finished_state.clsp +0 -35
- chia/wallet/puzzles/dao_finished_state.clsp.hex +0 -1
- chia/wallet/puzzles/dao_finished_state.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_lockup.clsp +0 -288
- chia/wallet/puzzles/dao_lockup.clsp.hex +0 -1
- chia/wallet/puzzles/dao_lockup.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal.clsp +0 -377
- chia/wallet/puzzles/dao_proposal.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal_timer.clsp +0 -78
- chia/wallet/puzzles/dao_proposal_timer.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal_timer.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal_validator.clsp +0 -87
- chia/wallet/puzzles/dao_proposal_validator.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal_validator.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp +0 -240
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex +0 -1
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_treasury.clsp +0 -115
- chia/wallet/puzzles/dao_treasury.clsp.hex +0 -1
- chia/wallet/puzzles/dao_update_proposal.clsp +0 -44
- chia/wallet/puzzles/dao_update_proposal.clsp.hex +0 -1
- chia/wallet/puzzles/json.clib +0 -25
- chia/wallet/puzzles/merkle_utils.clib +0 -18
- chia/wallet/puzzles/notification.clsp +0 -7
- chia/wallet/puzzles/notification.clsp.hex +0 -1
- chia/wallet/puzzles/p2_1_of_n.clsp +0 -22
- chia/wallet/puzzles/p2_1_of_n.clsp.hex +0 -1
- chia/wallet/puzzles/p2_conditions.clsp +0 -3
- chia/wallet/puzzles/p2_conditions.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_conditions.clsp +0 -18
- chia/wallet/puzzles/p2_delegated_conditions.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_puzzle.clsp +0 -19
- chia/wallet/puzzles/p2_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp +0 -91
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp +0 -108
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp.hex +0 -1
- chia/wallet/puzzles/p2_parent.clsp +0 -19
- chia/wallet/puzzles/p2_parent.clsp.hex +0 -1
- chia/wallet/puzzles/p2_puzzle_hash.clsp +0 -18
- chia/wallet/puzzles/p2_puzzle_hash.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton.clsp +0 -30
- chia/wallet/puzzles/p2_singleton.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_aggregator.clsp +0 -81
- chia/wallet/puzzles/p2_singleton_aggregator.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp +0 -50
- chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp +0 -47
- chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/settlement_payments.clsp +0 -49
- chia/wallet/puzzles/settlement_payments.clsp.hex +0 -1
- chia/wallet/puzzles/sha256tree.clib +0 -11
- chia/wallet/puzzles/singleton_launcher.clsp +0 -16
- chia/wallet/puzzles/singleton_launcher.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_top_layer.clsp +0 -177
- chia/wallet/puzzles/singleton_top_layer.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_top_layer_v1_1.clsp +0 -107
- chia/wallet/puzzles/singleton_top_layer_v1_1.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_truths.clib +0 -21
- chia/wallet/vc_wallet/cr_puzzles/__init__.py +0 -0
- chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp +0 -3
- chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp.hex +0 -1
- chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp +0 -304
- chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp.hex +0 -1
- chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp +0 -45
- chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/__init__.py +0 -0
- chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp +0 -30
- chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp +0 -75
- chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp +0 -32
- chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp +0 -80
- chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp +0 -163
- chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp +0 -16
- chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp +0 -74
- chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp +0 -23
- chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp +0 -64
- chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp.hex +0 -1
- chia_blockchain-2.5.2rc2.dist-info/RECORD +0 -1042
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc1.dist-info}/LICENSE +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc1.dist-info}/WHEEL +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc1.dist-info}/entry_points.txt +0 -0
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import asyncio
|
|
4
3
|
import dataclasses
|
|
5
|
-
from typing import Any
|
|
6
4
|
|
|
7
5
|
import pytest
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
8
8
|
|
|
9
9
|
from chia._tests.environments.wallet import WalletStateTransition, WalletTestFramework
|
|
10
|
-
from chia._tests.util.setup_nodes import OldSimulatorsAndWallets
|
|
11
10
|
from chia._tests.util.time_out_assert import time_out_assert
|
|
12
11
|
from chia.data_layer.data_layer_errors import LauncherCoinNotFoundError
|
|
13
12
|
from chia.data_layer.data_layer_wallet import DataLayerWallet, Mirror
|
|
14
13
|
from chia.simulator.full_node_simulator import FullNodeSimulator
|
|
15
|
-
from chia.simulator.simulator_protocol import
|
|
14
|
+
from chia.simulator.simulator_protocol import ReorgProtocol
|
|
16
15
|
from chia.types.blockchain_format.coin import Coin
|
|
17
16
|
from chia.types.blockchain_format.program import Program
|
|
18
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
19
|
-
from chia.types.peer_info import PeerInfo
|
|
20
|
-
from chia.util.ints import uint32, uint64
|
|
21
|
-
from chia.util.timing import adjusted_timeout
|
|
22
17
|
from chia.wallet.db_wallet.db_wallet_puzzles import create_mirror_puzzle
|
|
23
18
|
from chia.wallet.util.merkle_tree import MerkleTree
|
|
24
19
|
from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG
|
|
@@ -38,91 +33,97 @@ async def is_singleton_confirmed(dl_wallet: DataLayerWallet, lid: bytes32) -> bo
|
|
|
38
33
|
|
|
39
34
|
class TestDLWallet:
|
|
40
35
|
@pytest.mark.parametrize(
|
|
41
|
-
"
|
|
36
|
+
"wallet_environments",
|
|
42
37
|
[
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
{
|
|
39
|
+
"num_environments": 1,
|
|
40
|
+
"blocks_needed": [2],
|
|
41
|
+
}
|
|
46
42
|
],
|
|
43
|
+
indirect=True,
|
|
47
44
|
)
|
|
45
|
+
@pytest.mark.limit_consensus_modes
|
|
48
46
|
@pytest.mark.anyio
|
|
49
|
-
async def test_initial_creation(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
wallet_node_0, server_0 = wallets[0]
|
|
56
|
-
wallet_0 = wallet_node_0.wallet_state_manager.main_wallet
|
|
57
|
-
|
|
58
|
-
if trusted:
|
|
59
|
-
wallet_node_0.config["trusted_peers"] = {full_node_server.node_id.hex(): full_node_server.node_id.hex()}
|
|
60
|
-
else:
|
|
61
|
-
wallet_node_0.config["trusted_peers"] = {}
|
|
62
|
-
|
|
63
|
-
await server_0.start_client(PeerInfo(self_hostname, full_node_server.get_port()), None)
|
|
64
|
-
|
|
65
|
-
funds = await full_node_api.farm_blocks_to_wallet(count=2, wallet=wallet_0)
|
|
66
|
-
|
|
67
|
-
await time_out_assert(10, wallet_0.get_unconfirmed_balance, funds)
|
|
68
|
-
await time_out_assert(10, wallet_0.get_confirmed_balance, funds)
|
|
47
|
+
async def test_initial_creation(self, wallet_environments: WalletTestFramework) -> None:
|
|
48
|
+
env = wallet_environments.environments[0]
|
|
49
|
+
env.wallet_aliases = {
|
|
50
|
+
"xch": 1,
|
|
51
|
+
"dl": 2,
|
|
52
|
+
}
|
|
69
53
|
|
|
70
|
-
|
|
71
|
-
dl_wallet = await DataLayerWallet.create_new_dl_wallet(wallet_node_0.wallet_state_manager)
|
|
54
|
+
dl_wallet = await DataLayerWallet.create_new_dl_wallet(env.wallet_state_manager)
|
|
72
55
|
|
|
73
56
|
nodes = [Program.to("thing").get_tree_hash(), Program.to([8]).get_tree_hash()]
|
|
74
57
|
current_tree = MerkleTree(nodes)
|
|
75
58
|
current_root = current_tree.calculate_root()
|
|
76
59
|
|
|
77
|
-
|
|
60
|
+
fee = uint64(1_999_999_999_999)
|
|
61
|
+
|
|
62
|
+
for i in range(2):
|
|
78
63
|
async with dl_wallet.wallet_state_manager.new_action_scope(
|
|
79
|
-
|
|
64
|
+
wallet_environments.tx_config, push=True
|
|
80
65
|
) as action_scope:
|
|
81
66
|
launcher_id = await dl_wallet.generate_new_reporter(
|
|
82
67
|
current_root,
|
|
83
68
|
action_scope,
|
|
84
|
-
fee=
|
|
69
|
+
fee=fee,
|
|
85
70
|
)
|
|
86
71
|
|
|
87
72
|
assert await dl_wallet.get_latest_singleton(launcher_id) is not None
|
|
88
|
-
await full_node_api.process_transaction_records(records=action_scope.side_effects.transactions)
|
|
89
73
|
|
|
90
|
-
await
|
|
74
|
+
await wallet_environments.process_pending_states(
|
|
75
|
+
[
|
|
76
|
+
WalletStateTransition(
|
|
77
|
+
pre_block_balance_updates={
|
|
78
|
+
"xch": {
|
|
79
|
+
"unconfirmed_wallet_balance": -fee - 1,
|
|
80
|
+
"spendable_balance": -fee - 1,
|
|
81
|
+
"max_send_amount": -fee - 1,
|
|
82
|
+
"pending_coin_removal_count": 2, # creation + launcher
|
|
83
|
+
},
|
|
84
|
+
"dl": {"init": True} if i == 0 else {},
|
|
85
|
+
},
|
|
86
|
+
post_block_balance_updates={
|
|
87
|
+
"xch": {
|
|
88
|
+
"confirmed_wallet_balance": -fee - 1,
|
|
89
|
+
"spendable_balance": 0,
|
|
90
|
+
"max_send_amount": 0,
|
|
91
|
+
"pending_coin_removal_count": -2,
|
|
92
|
+
"unspent_coin_count": -2,
|
|
93
|
+
},
|
|
94
|
+
"dl": {
|
|
95
|
+
"unspent_coin_count": 1,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
),
|
|
99
|
+
]
|
|
100
|
+
)
|
|
91
101
|
|
|
92
|
-
|
|
93
|
-
await time_out_assert(10, wallet_0.get_confirmed_balance, 0)
|
|
102
|
+
await time_out_assert(15, is_singleton_confirmed, True, dl_wallet, launcher_id)
|
|
94
103
|
|
|
95
104
|
new_puz = await dl_wallet.get_new_puzzle()
|
|
96
105
|
assert new_puz
|
|
97
106
|
|
|
98
107
|
@pytest.mark.parametrize(
|
|
99
|
-
"
|
|
100
|
-
[
|
|
108
|
+
"wallet_environments",
|
|
109
|
+
[
|
|
110
|
+
{
|
|
111
|
+
"num_environments": 1,
|
|
112
|
+
"blocks_needed": [2],
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
indirect=True,
|
|
101
116
|
)
|
|
117
|
+
@pytest.mark.limit_consensus_modes
|
|
102
118
|
@pytest.mark.anyio
|
|
103
|
-
async def test_get_owned_singletons(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
wallet_node_0, server_0 = wallets[0]
|
|
110
|
-
wallet_0 = wallet_node_0.wallet_state_manager.main_wallet
|
|
111
|
-
|
|
112
|
-
if trusted:
|
|
113
|
-
wallet_node_0.config["trusted_peers"] = {full_node_server.node_id.hex(): full_node_server.node_id.hex()}
|
|
114
|
-
else:
|
|
115
|
-
wallet_node_0.config["trusted_peers"] = {}
|
|
116
|
-
|
|
117
|
-
await server_0.start_client(PeerInfo(self_hostname, full_node_server.get_port()), None)
|
|
118
|
-
|
|
119
|
-
funds = await full_node_api.farm_blocks_to_wallet(count=2, wallet=wallet_0)
|
|
120
|
-
|
|
121
|
-
await time_out_assert(10, wallet_0.get_unconfirmed_balance, funds)
|
|
122
|
-
await time_out_assert(10, wallet_0.get_confirmed_balance, funds)
|
|
119
|
+
async def test_get_owned_singletons(self, wallet_environments: WalletTestFramework) -> None:
|
|
120
|
+
env = wallet_environments.environments[0]
|
|
121
|
+
env.wallet_aliases = {
|
|
122
|
+
"xch": 1,
|
|
123
|
+
"dl": 2,
|
|
124
|
+
}
|
|
123
125
|
|
|
124
|
-
|
|
125
|
-
dl_wallet = await DataLayerWallet.create_new_dl_wallet(wallet_node_0.wallet_state_manager)
|
|
126
|
+
dl_wallet = await DataLayerWallet.create_new_dl_wallet(env.wallet_state_manager)
|
|
126
127
|
|
|
127
128
|
nodes = [Program.to("thing").get_tree_hash(), Program.to([8]).get_tree_hash()]
|
|
128
129
|
current_tree = MerkleTree(nodes)
|
|
@@ -130,16 +131,44 @@ class TestDLWallet:
|
|
|
130
131
|
|
|
131
132
|
expected_launcher_ids = set()
|
|
132
133
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
fee = uint64(1_999_999_999_999)
|
|
135
|
+
|
|
136
|
+
for i in range(2):
|
|
137
|
+
async with dl_wallet.wallet_state_manager.new_action_scope(
|
|
138
|
+
wallet_environments.tx_config, push=True
|
|
139
|
+
) as action_scope:
|
|
140
|
+
launcher_id = await dl_wallet.generate_new_reporter(current_root, action_scope, fee=fee)
|
|
138
141
|
expected_launcher_ids.add(launcher_id)
|
|
139
142
|
|
|
140
143
|
assert await dl_wallet.get_latest_singleton(launcher_id) is not None
|
|
141
144
|
|
|
142
|
-
await
|
|
145
|
+
await wallet_environments.process_pending_states(
|
|
146
|
+
[
|
|
147
|
+
WalletStateTransition(
|
|
148
|
+
pre_block_balance_updates={
|
|
149
|
+
"xch": {
|
|
150
|
+
"unconfirmed_wallet_balance": -fee - 1,
|
|
151
|
+
"spendable_balance": -fee - 1,
|
|
152
|
+
"max_send_amount": -fee - 1,
|
|
153
|
+
"pending_coin_removal_count": 2, # creation + launcher
|
|
154
|
+
},
|
|
155
|
+
"dl": {"init": True} if i == 0 else {},
|
|
156
|
+
},
|
|
157
|
+
post_block_balance_updates={
|
|
158
|
+
"xch": {
|
|
159
|
+
"confirmed_wallet_balance": -fee - 1,
|
|
160
|
+
"spendable_balance": 0,
|
|
161
|
+
"max_send_amount": 0,
|
|
162
|
+
"pending_coin_removal_count": -2,
|
|
163
|
+
"unspent_coin_count": -2,
|
|
164
|
+
},
|
|
165
|
+
"dl": {
|
|
166
|
+
"unspent_coin_count": 1,
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
),
|
|
170
|
+
]
|
|
171
|
+
)
|
|
143
172
|
|
|
144
173
|
await time_out_assert(15, is_singleton_confirmed, True, dl_wallet, launcher_id)
|
|
145
174
|
|
|
@@ -147,40 +176,34 @@ class TestDLWallet:
|
|
|
147
176
|
owned_launcher_ids = sorted(singleton.launcher_id for singleton in owned_singletons)
|
|
148
177
|
assert owned_launcher_ids == sorted(expected_launcher_ids)
|
|
149
178
|
|
|
150
|
-
@pytest.mark.parametrize(
|
|
179
|
+
@pytest.mark.parametrize(
|
|
180
|
+
"wallet_environments",
|
|
181
|
+
[
|
|
182
|
+
{
|
|
183
|
+
"num_environments": 2,
|
|
184
|
+
"blocks_needed": [1, 1],
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
indirect=True,
|
|
188
|
+
)
|
|
189
|
+
@pytest.mark.limit_consensus_modes
|
|
151
190
|
@pytest.mark.anyio
|
|
152
|
-
async def test_tracking_non_owned(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
wallet_node_0.config["trusted_peers"] = {full_node_server.node_id.hex(): full_node_server.node_id.hex()}
|
|
164
|
-
wallet_node_1.config["trusted_peers"] = {full_node_server.node_id.hex(): full_node_server.node_id.hex()}
|
|
165
|
-
else:
|
|
166
|
-
wallet_node_0.config["trusted_peers"] = {}
|
|
167
|
-
wallet_node_1.config["trusted_peers"] = {}
|
|
168
|
-
|
|
169
|
-
await server_0.start_client(PeerInfo(self_hostname, full_node_server.get_port()), None)
|
|
170
|
-
await server_1.start_client(PeerInfo(self_hostname, full_node_server.get_port()), None)
|
|
171
|
-
|
|
172
|
-
funds = await full_node_api.farm_blocks_to_wallet(count=2, wallet=wallet_0)
|
|
173
|
-
|
|
174
|
-
await time_out_assert(10, wallet_0.get_unconfirmed_balance, funds)
|
|
175
|
-
await time_out_assert(10, wallet_0.get_confirmed_balance, funds)
|
|
176
|
-
|
|
177
|
-
async with wallet_node_0.wallet_state_manager.lock:
|
|
178
|
-
dl_wallet_0 = await DataLayerWallet.create_new_dl_wallet(wallet_node_0.wallet_state_manager)
|
|
191
|
+
async def test_tracking_non_owned(self, wallet_environments: WalletTestFramework) -> None:
|
|
192
|
+
env_0 = wallet_environments.environments[0]
|
|
193
|
+
env_1 = wallet_environments.environments[1]
|
|
194
|
+
env_0.wallet_aliases = {
|
|
195
|
+
"xch": 1,
|
|
196
|
+
"dl": 2,
|
|
197
|
+
}
|
|
198
|
+
env_1.wallet_aliases = {
|
|
199
|
+
"xch": 1,
|
|
200
|
+
"dl": 2,
|
|
201
|
+
}
|
|
179
202
|
|
|
180
|
-
|
|
181
|
-
|
|
203
|
+
dl_wallet_0 = await DataLayerWallet.create_new_dl_wallet(env_0.wallet_state_manager)
|
|
204
|
+
dl_wallet_1 = await DataLayerWallet.create_new_dl_wallet(env_1.wallet_state_manager)
|
|
182
205
|
|
|
183
|
-
peer =
|
|
206
|
+
peer = env_1.node.get_full_node_peer()
|
|
184
207
|
|
|
185
208
|
# Test tracking a launcher id that does not exist
|
|
186
209
|
with pytest.raises(LauncherCoinNotFoundError):
|
|
@@ -190,25 +213,72 @@ class TestDLWallet:
|
|
|
190
213
|
current_tree = MerkleTree(nodes)
|
|
191
214
|
current_root = current_tree.calculate_root()
|
|
192
215
|
|
|
193
|
-
async with dl_wallet_0.wallet_state_manager.new_action_scope(
|
|
216
|
+
async with dl_wallet_0.wallet_state_manager.new_action_scope(
|
|
217
|
+
wallet_environments.tx_config, push=True
|
|
218
|
+
) as action_scope:
|
|
194
219
|
launcher_id = await dl_wallet_0.generate_new_reporter(current_root, action_scope)
|
|
195
220
|
|
|
196
221
|
assert await dl_wallet_0.get_latest_singleton(launcher_id) is not None
|
|
197
|
-
|
|
222
|
+
|
|
223
|
+
await wallet_environments.process_pending_states(
|
|
224
|
+
[
|
|
225
|
+
WalletStateTransition(
|
|
226
|
+
pre_block_balance_updates={
|
|
227
|
+
"xch": {
|
|
228
|
+
"unconfirmed_wallet_balance": -1,
|
|
229
|
+
"<=#spendable_balance": -1,
|
|
230
|
+
"<=#max_send_amount": -1,
|
|
231
|
+
">=#pending_change": 1,
|
|
232
|
+
"pending_coin_removal_count": 1, # creation + launcher
|
|
233
|
+
},
|
|
234
|
+
"dl": {
|
|
235
|
+
"init": True,
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
post_block_balance_updates={
|
|
239
|
+
"xch": {
|
|
240
|
+
"confirmed_wallet_balance": -1,
|
|
241
|
+
">=#spendable_balance": 0,
|
|
242
|
+
">=#max_send_amount": 0,
|
|
243
|
+
"<=#pending_change": -1,
|
|
244
|
+
"pending_coin_removal_count": -1,
|
|
245
|
+
},
|
|
246
|
+
"dl": {
|
|
247
|
+
"unspent_coin_count": 1,
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
),
|
|
251
|
+
]
|
|
252
|
+
)
|
|
198
253
|
|
|
199
254
|
await time_out_assert(15, is_singleton_confirmed, True, dl_wallet_0, launcher_id)
|
|
200
|
-
await asyncio.sleep(0.5)
|
|
201
255
|
|
|
202
256
|
await dl_wallet_1.track_new_launcher_id(launcher_id, peer)
|
|
203
257
|
await time_out_assert(15, is_singleton_confirmed, True, dl_wallet_1, launcher_id)
|
|
204
|
-
await asyncio.sleep(0.5)
|
|
205
258
|
|
|
206
|
-
for
|
|
259
|
+
for _ in range(5):
|
|
207
260
|
new_root = MerkleTree([Program.to("root").get_tree_hash()]).calculate_root()
|
|
208
|
-
async with dl_wallet_0.wallet_state_manager.new_action_scope(
|
|
261
|
+
async with dl_wallet_0.wallet_state_manager.new_action_scope(
|
|
262
|
+
wallet_environments.tx_config, push=True
|
|
263
|
+
) as action_scope:
|
|
209
264
|
await dl_wallet_0.create_update_state_spend(launcher_id, new_root, action_scope)
|
|
210
265
|
|
|
211
|
-
await
|
|
266
|
+
await wallet_environments.process_pending_states(
|
|
267
|
+
[
|
|
268
|
+
WalletStateTransition(
|
|
269
|
+
pre_block_balance_updates={
|
|
270
|
+
"dl": {
|
|
271
|
+
"pending_coin_removal_count": 1,
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
post_block_balance_updates={
|
|
275
|
+
"dl": {
|
|
276
|
+
"pending_coin_removal_count": -1,
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
),
|
|
280
|
+
]
|
|
281
|
+
)
|
|
212
282
|
|
|
213
283
|
await time_out_assert(15, is_singleton_confirmed, True, dl_wallet_0, launcher_id)
|
|
214
284
|
|
|
@@ -226,47 +296,67 @@ class TestDLWallet:
|
|
|
226
296
|
await time_out_assert(15, do_tips_match, True)
|
|
227
297
|
|
|
228
298
|
@pytest.mark.parametrize(
|
|
229
|
-
"
|
|
230
|
-
[
|
|
299
|
+
"wallet_environments",
|
|
300
|
+
[
|
|
301
|
+
{
|
|
302
|
+
"num_environments": 2,
|
|
303
|
+
"blocks_needed": [1, 1],
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
indirect=True,
|
|
231
307
|
)
|
|
308
|
+
@pytest.mark.limit_consensus_modes
|
|
232
309
|
@pytest.mark.anyio
|
|
233
|
-
async def test_lifecycle(
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
wallet_node_0, server_0 = wallets[0]
|
|
240
|
-
wallet_0 = wallet_node_0.wallet_state_manager.main_wallet
|
|
241
|
-
|
|
242
|
-
if trusted:
|
|
243
|
-
wallet_node_0.config["trusted_peers"] = {full_node_server.node_id.hex(): full_node_server.node_id.hex()}
|
|
244
|
-
else:
|
|
245
|
-
wallet_node_0.config["trusted_peers"] = {}
|
|
246
|
-
|
|
247
|
-
await server_0.start_client(PeerInfo(self_hostname, full_node_server.get_port()), None)
|
|
248
|
-
|
|
249
|
-
funds = await full_node_api.farm_blocks_to_wallet(count=5, wallet=wallet_0)
|
|
250
|
-
|
|
251
|
-
await time_out_assert(10, wallet_0.get_unconfirmed_balance, funds)
|
|
252
|
-
await time_out_assert(10, wallet_0.get_confirmed_balance, funds)
|
|
310
|
+
async def test_lifecycle(self, wallet_environments: WalletTestFramework) -> None:
|
|
311
|
+
env = wallet_environments.environments[0]
|
|
312
|
+
env.wallet_aliases = {
|
|
313
|
+
"xch": 1,
|
|
314
|
+
"dl": 2,
|
|
315
|
+
}
|
|
253
316
|
|
|
254
|
-
|
|
255
|
-
dl_wallet = await DataLayerWallet.create_new_dl_wallet(wallet_node_0.wallet_state_manager)
|
|
317
|
+
dl_wallet = await DataLayerWallet.create_new_dl_wallet(env.wallet_state_manager)
|
|
256
318
|
|
|
257
319
|
nodes = [Program.to("thing").get_tree_hash(), Program.to([8]).get_tree_hash()]
|
|
258
320
|
current_tree = MerkleTree(nodes)
|
|
259
321
|
current_root = current_tree.calculate_root()
|
|
260
322
|
|
|
261
|
-
async with dl_wallet.wallet_state_manager.new_action_scope(
|
|
323
|
+
async with dl_wallet.wallet_state_manager.new_action_scope(
|
|
324
|
+
wallet_environments.tx_config, push=True
|
|
325
|
+
) as action_scope:
|
|
262
326
|
launcher_id = await dl_wallet.generate_new_reporter(current_root, action_scope)
|
|
263
327
|
|
|
264
328
|
assert await dl_wallet.get_latest_singleton(launcher_id) is not None
|
|
265
329
|
|
|
266
|
-
|
|
267
|
-
|
|
330
|
+
await wallet_environments.process_pending_states(
|
|
331
|
+
[
|
|
332
|
+
WalletStateTransition(
|
|
333
|
+
pre_block_balance_updates={
|
|
334
|
+
"xch": {
|
|
335
|
+
"unconfirmed_wallet_balance": -1,
|
|
336
|
+
"<=#spendable_balance": -1,
|
|
337
|
+
"<=#max_send_amount": -1,
|
|
338
|
+
">=#pending_change": 1,
|
|
339
|
+
"pending_coin_removal_count": 1, # creation + launcher
|
|
340
|
+
},
|
|
341
|
+
"dl": {
|
|
342
|
+
"init": True,
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
post_block_balance_updates={
|
|
346
|
+
"xch": {
|
|
347
|
+
"confirmed_wallet_balance": -1,
|
|
348
|
+
">=#spendable_balance": 0,
|
|
349
|
+
">=#max_send_amount": 0,
|
|
350
|
+
"<=#pending_change": -1,
|
|
351
|
+
"pending_coin_removal_count": -1,
|
|
352
|
+
},
|
|
353
|
+
"dl": {
|
|
354
|
+
"unspent_coin_count": 1,
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
),
|
|
358
|
+
]
|
|
268
359
|
)
|
|
269
|
-
await full_node_api.process_transaction_records(records=[std_record])
|
|
270
360
|
|
|
271
361
|
await time_out_assert(15, is_singleton_confirmed, True, dl_wallet, launcher_id)
|
|
272
362
|
|
|
@@ -276,19 +366,23 @@ class TestDLWallet:
|
|
|
276
366
|
|
|
277
367
|
new_root = MerkleTree([Program.to("root").get_tree_hash()]).calculate_root()
|
|
278
368
|
|
|
279
|
-
|
|
369
|
+
fee = uint64(1_999_999_999_999)
|
|
370
|
+
|
|
371
|
+
async with dl_wallet.wallet_state_manager.new_action_scope(
|
|
372
|
+
wallet_environments.tx_config, push=True
|
|
373
|
+
) as action_scope:
|
|
280
374
|
await dl_wallet.generate_signed_transaction(
|
|
281
375
|
[previous_record.lineage_proof.amount],
|
|
282
376
|
[previous_record.inner_puzzle_hash],
|
|
283
377
|
action_scope,
|
|
284
378
|
launcher_id=previous_record.launcher_id,
|
|
285
379
|
new_root_hash=new_root,
|
|
286
|
-
fee=
|
|
380
|
+
fee=fee,
|
|
287
381
|
)
|
|
288
382
|
assert action_scope.side_effects.transactions[0].spend_bundle is not None
|
|
289
383
|
with pytest.raises(ValueError, match="is currently pending"):
|
|
290
384
|
async with dl_wallet.wallet_state_manager.new_action_scope(
|
|
291
|
-
|
|
385
|
+
wallet_environments.tx_config, push=False
|
|
292
386
|
) as failed_action_scope:
|
|
293
387
|
await dl_wallet.generate_signed_transaction(
|
|
294
388
|
[previous_record.lineage_proof.amount],
|
|
@@ -301,7 +395,7 @@ class TestDLWallet:
|
|
|
301
395
|
if rem.amount == 1
|
|
302
396
|
)
|
|
303
397
|
},
|
|
304
|
-
fee=
|
|
398
|
+
fee=fee,
|
|
305
399
|
)
|
|
306
400
|
|
|
307
401
|
new_record = await dl_wallet.get_latest_singleton(launcher_id)
|
|
@@ -309,13 +403,38 @@ class TestDLWallet:
|
|
|
309
403
|
assert new_record != previous_record
|
|
310
404
|
assert not new_record.confirmed
|
|
311
405
|
|
|
312
|
-
|
|
313
|
-
|
|
406
|
+
await wallet_environments.process_pending_states(
|
|
407
|
+
[
|
|
408
|
+
WalletStateTransition(
|
|
409
|
+
pre_block_balance_updates={
|
|
410
|
+
"xch": {
|
|
411
|
+
"unconfirmed_wallet_balance": -fee,
|
|
412
|
+
# these match exactly because of our change from the creation
|
|
413
|
+
"spendable_balance": -fee,
|
|
414
|
+
"max_send_amount": -fee,
|
|
415
|
+
"pending_coin_removal_count": 2,
|
|
416
|
+
},
|
|
417
|
+
"dl": {
|
|
418
|
+
"pending_coin_removal_count": 1,
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
post_block_balance_updates={
|
|
422
|
+
"xch": {
|
|
423
|
+
"confirmed_wallet_balance": -fee,
|
|
424
|
+
"spendable_balance": 0,
|
|
425
|
+
"max_send_amount": 0,
|
|
426
|
+
"pending_coin_removal_count": -2,
|
|
427
|
+
"unspent_coin_count": -2,
|
|
428
|
+
},
|
|
429
|
+
"dl": {
|
|
430
|
+
"pending_coin_removal_count": -1,
|
|
431
|
+
},
|
|
432
|
+
},
|
|
433
|
+
),
|
|
434
|
+
]
|
|
435
|
+
)
|
|
314
436
|
|
|
315
437
|
await time_out_assert(15, is_singleton_confirmed, True, dl_wallet, launcher_id)
|
|
316
|
-
await time_out_assert(10, wallet_0.get_unconfirmed_balance, funds - 2000000000000)
|
|
317
|
-
await time_out_assert(10, wallet_0.get_confirmed_balance, funds - 2000000000000)
|
|
318
|
-
await asyncio.sleep(0.5)
|
|
319
438
|
|
|
320
439
|
dl_coin_record = await dl_wallet.wallet_state_manager.coin_store.get_coin_record(new_record.coin_id)
|
|
321
440
|
assert dl_coin_record is not None
|
|
@@ -324,217 +443,33 @@ class TestDLWallet:
|
|
|
324
443
|
previous_record = await dl_wallet.get_latest_singleton(launcher_id)
|
|
325
444
|
|
|
326
445
|
new_root = MerkleTree([Program.to("new root").get_tree_hash()]).calculate_root()
|
|
327
|
-
async with dl_wallet.wallet_state_manager.new_action_scope(
|
|
446
|
+
async with dl_wallet.wallet_state_manager.new_action_scope(
|
|
447
|
+
wallet_environments.tx_config, push=True
|
|
448
|
+
) as action_scope:
|
|
328
449
|
await dl_wallet.create_update_state_spend(launcher_id, new_root, action_scope)
|
|
329
450
|
new_record = await dl_wallet.get_latest_singleton(launcher_id)
|
|
330
451
|
assert new_record is not None
|
|
331
452
|
assert new_record != previous_record
|
|
332
453
|
assert not new_record.confirmed
|
|
333
454
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
two_wallet_nodes: OldSimulatorsAndWallets,
|
|
350
|
-
trusted: bool,
|
|
351
|
-
) -> None: # pragma: no cover
|
|
352
|
-
full_nodes, wallets, _ = two_wallet_nodes
|
|
353
|
-
full_node_api = full_nodes[0]
|
|
354
|
-
full_node_server = full_node_api.server
|
|
355
|
-
wallet_node_0, server_0 = wallets[0]
|
|
356
|
-
wallet_node_1, server_1 = wallets[1]
|
|
357
|
-
wallet_0 = wallet_node_0.wallet_state_manager.main_wallet
|
|
358
|
-
wallet_1 = wallet_node_1.wallet_state_manager.main_wallet
|
|
359
|
-
|
|
360
|
-
if trusted:
|
|
361
|
-
wallet_node_0.config["trusted_peers"] = {full_node_server.node_id.hex(): full_node_server.node_id.hex()}
|
|
362
|
-
wallet_node_1.config["trusted_peers"] = {full_node_server.node_id.hex(): full_node_server.node_id.hex()}
|
|
363
|
-
else:
|
|
364
|
-
wallet_node_0.config["trusted_peers"] = {}
|
|
365
|
-
wallet_node_1.config["trusted_peers"] = {}
|
|
366
|
-
|
|
367
|
-
await server_0.start_client(PeerInfo(self_hostname, full_node_server.get_port()), None)
|
|
368
|
-
await server_1.start_client(PeerInfo(self_hostname, full_node_server.get_port()), None)
|
|
369
|
-
|
|
370
|
-
funds = await full_node_api.farm_blocks_to_wallet(count=5, wallet=wallet_0)
|
|
371
|
-
await full_node_api.farm_blocks_to_wallet(count=5, wallet=wallet_1)
|
|
372
|
-
|
|
373
|
-
await time_out_assert(10, wallet_0.get_unconfirmed_balance, funds)
|
|
374
|
-
await time_out_assert(10, wallet_0.get_confirmed_balance, funds)
|
|
375
|
-
await time_out_assert(10, wallet_1.get_unconfirmed_balance, funds)
|
|
376
|
-
await time_out_assert(10, wallet_1.get_confirmed_balance, funds)
|
|
377
|
-
|
|
378
|
-
async with wallet_node_0.wallet_state_manager.lock:
|
|
379
|
-
dl_wallet_0 = await DataLayerWallet.create_new_dl_wallet(wallet_node_0.wallet_state_manager)
|
|
380
|
-
|
|
381
|
-
async with wallet_node_1.wallet_state_manager.lock:
|
|
382
|
-
dl_wallet_1 = await DataLayerWallet.create_new_dl_wallet(wallet_node_1.wallet_state_manager)
|
|
383
|
-
|
|
384
|
-
nodes = [Program.to("thing").get_tree_hash(), Program.to([8]).get_tree_hash()]
|
|
385
|
-
current_tree = MerkleTree(nodes)
|
|
386
|
-
current_root = current_tree.calculate_root()
|
|
387
|
-
|
|
388
|
-
async def is_singleton_confirmed(wallet: DataLayerWallet, lid: bytes32) -> bool:
|
|
389
|
-
latest_singleton = await wallet.get_latest_singleton(lid)
|
|
390
|
-
if latest_singleton is None:
|
|
391
|
-
return False
|
|
392
|
-
return latest_singleton.confirmed
|
|
393
|
-
|
|
394
|
-
async with dl_wallet_0.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=False) as action_scope:
|
|
395
|
-
launcher_id = await dl_wallet_0.generate_new_reporter(current_root, action_scope)
|
|
396
|
-
|
|
397
|
-
initial_record = await dl_wallet_0.get_latest_singleton(launcher_id)
|
|
398
|
-
assert initial_record is not None
|
|
399
|
-
|
|
400
|
-
[std_record] = await wallet_node_0.wallet_state_manager.add_pending_transactions(
|
|
401
|
-
action_scope.side_effects.transactions
|
|
402
|
-
)
|
|
403
|
-
await asyncio.wait_for(
|
|
404
|
-
full_node_api.process_transaction_records(records=[std_record]),
|
|
405
|
-
timeout=adjusted_timeout(timeout=15),
|
|
406
|
-
)
|
|
407
|
-
|
|
408
|
-
await time_out_assert(15, is_singleton_confirmed, True, dl_wallet_0, launcher_id)
|
|
409
|
-
await asyncio.sleep(0.5)
|
|
410
|
-
|
|
411
|
-
peer = wallet_node_1.get_full_node_peer()
|
|
412
|
-
await dl_wallet_1.track_new_launcher_id(launcher_id, peer)
|
|
413
|
-
await time_out_assert(15, is_singleton_confirmed, True, dl_wallet_1, launcher_id)
|
|
414
|
-
current_record = await dl_wallet_1.get_latest_singleton(launcher_id)
|
|
415
|
-
assert current_record is not None
|
|
416
|
-
await asyncio.sleep(0.5)
|
|
417
|
-
|
|
418
|
-
# Because these have the same fee, the one that gets pushed first will win
|
|
419
|
-
async with dl_wallet_1.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
420
|
-
await dl_wallet_1.create_update_state_spend(
|
|
421
|
-
launcher_id, current_record.root, action_scope, fee=uint64(2000000000000)
|
|
422
|
-
)
|
|
423
|
-
report_txs = action_scope.side_effects.transactions
|
|
424
|
-
record_1 = await dl_wallet_1.get_latest_singleton(launcher_id)
|
|
425
|
-
assert record_1 is not None
|
|
426
|
-
assert current_record != record_1
|
|
427
|
-
async with dl_wallet_0.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
|
|
428
|
-
await dl_wallet_0.create_update_state_spend(
|
|
429
|
-
launcher_id, bytes32.zeros, action_scope, fee=uint64(2000000000000)
|
|
430
|
-
)
|
|
431
|
-
update_txs = action_scope.side_effects.transactions
|
|
432
|
-
record_0 = await dl_wallet_0.get_latest_singleton(launcher_id)
|
|
433
|
-
assert record_0 is not None
|
|
434
|
-
assert initial_record != record_0
|
|
435
|
-
assert record_0 != record_1
|
|
436
|
-
|
|
437
|
-
report_txs = await wallet_node_1.wallet_state_manager.add_pending_transactions(report_txs)
|
|
438
|
-
|
|
439
|
-
await asyncio.wait_for(
|
|
440
|
-
full_node_api.wait_transaction_records_entered_mempool(records=report_txs),
|
|
441
|
-
timeout=adjusted_timeout(timeout=15),
|
|
442
|
-
)
|
|
443
|
-
|
|
444
|
-
update_txs = await wallet_node_0.wallet_state_manager.add_pending_transactions(update_txs)
|
|
445
|
-
|
|
446
|
-
await asyncio.wait_for(
|
|
447
|
-
full_node_api.process_transaction_records(records=report_txs), timeout=adjusted_timeout(timeout=15)
|
|
448
|
-
)
|
|
449
|
-
|
|
450
|
-
funds -= 2000000000001
|
|
451
|
-
|
|
452
|
-
async def is_singleton_generation(wallet: DataLayerWallet, launcher_id: bytes32, generation: int) -> bool:
|
|
453
|
-
latest = await wallet.get_latest_singleton(launcher_id)
|
|
454
|
-
if latest is not None and latest.generation == generation:
|
|
455
|
-
return True
|
|
456
|
-
return False
|
|
457
|
-
|
|
458
|
-
next_generation = current_record.generation + 2
|
|
459
|
-
await time_out_assert(15, is_singleton_generation, True, dl_wallet_0, launcher_id, next_generation)
|
|
460
|
-
|
|
461
|
-
for i in range(0, 2):
|
|
462
|
-
await full_node_api.farm_new_transaction_block(FarmNewBlockProtocol(bytes32(32 * b"0")))
|
|
463
|
-
await asyncio.sleep(0.5)
|
|
464
|
-
|
|
465
|
-
await time_out_assert(15, is_singleton_confirmed, True, dl_wallet_0, launcher_id)
|
|
466
|
-
await time_out_assert(15, is_singleton_generation, True, dl_wallet_1, launcher_id, next_generation)
|
|
467
|
-
latest = await dl_wallet_0.get_latest_singleton(launcher_id)
|
|
468
|
-
assert latest is not None
|
|
469
|
-
assert latest == (await dl_wallet_1.get_latest_singleton(launcher_id))
|
|
470
|
-
await time_out_assert(15, wallet_0.get_confirmed_balance, funds)
|
|
471
|
-
await time_out_assert(15, wallet_0.get_unconfirmed_balance, funds)
|
|
472
|
-
assert (
|
|
473
|
-
len(
|
|
474
|
-
await dl_wallet_0.get_history(
|
|
475
|
-
launcher_id, min_generation=uint32(next_generation - 1), max_generation=uint32(next_generation - 1)
|
|
476
|
-
)
|
|
477
|
-
)
|
|
478
|
-
== 1
|
|
479
|
-
)
|
|
480
|
-
for tx in update_txs:
|
|
481
|
-
assert await wallet_node_0.wallet_state_manager.tx_store.get_transaction_record(tx.name) is None
|
|
482
|
-
assert await dl_wallet_0.get_singleton_record(record_0.coin_id) is None
|
|
483
|
-
|
|
484
|
-
async with dl_wallet_0.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=False) as action_scope:
|
|
485
|
-
await dl_wallet_0.create_update_state_spend(
|
|
486
|
-
launcher_id, bytes32([1] * 32), action_scope, fee=uint64(2000000000000)
|
|
487
|
-
)
|
|
488
|
-
record_1 = await dl_wallet_0.get_latest_singleton(launcher_id)
|
|
489
|
-
assert record_1 is not None
|
|
490
|
-
update_txs_1 = await wallet_node_0.wallet_state_manager.add_pending_transactions(
|
|
491
|
-
action_scope.side_effects.transactions
|
|
492
|
-
)
|
|
493
|
-
await full_node_api.wait_transaction_records_entered_mempool(update_txs_1)
|
|
494
|
-
|
|
495
|
-
# Delete any trace of that update
|
|
496
|
-
await wallet_node_0.wallet_state_manager.dl_store.delete_singleton_record(record_1.coin_id)
|
|
497
|
-
for tx in update_txs_1:
|
|
498
|
-
await wallet_node_0.wallet_state_manager.tx_store.delete_transaction_record(tx.name)
|
|
499
|
-
|
|
500
|
-
async with dl_wallet_0.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=False) as action_scope:
|
|
501
|
-
await dl_wallet_0.create_update_state_spend(launcher_id, bytes32([2] * 32), action_scope)
|
|
502
|
-
record_0 = await dl_wallet_0.get_latest_singleton(launcher_id)
|
|
503
|
-
assert record_0 is not None
|
|
504
|
-
assert record_0 != record_1
|
|
505
|
-
|
|
506
|
-
update_txs_0 = await wallet_node_0.wallet_state_manager.add_pending_transactions(
|
|
507
|
-
action_scope.side_effects.transactions
|
|
508
|
-
)
|
|
509
|
-
|
|
510
|
-
await asyncio.wait_for(
|
|
511
|
-
full_node_api.process_transaction_records(records=update_txs_1), timeout=adjusted_timeout(timeout=15)
|
|
455
|
+
await wallet_environments.process_pending_states(
|
|
456
|
+
[
|
|
457
|
+
WalletStateTransition(
|
|
458
|
+
pre_block_balance_updates={
|
|
459
|
+
"dl": {
|
|
460
|
+
"pending_coin_removal_count": 1,
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
post_block_balance_updates={
|
|
464
|
+
"dl": {
|
|
465
|
+
"pending_coin_removal_count": -1,
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
),
|
|
469
|
+
]
|
|
512
470
|
)
|
|
513
471
|
|
|
514
|
-
|
|
515
|
-
latest_singleton = await wallet.get_latest_singleton(lid)
|
|
516
|
-
if latest_singleton is None:
|
|
517
|
-
return False
|
|
518
|
-
return latest_singleton.root == root
|
|
519
|
-
|
|
520
|
-
funds -= 2000000000000
|
|
521
|
-
|
|
522
|
-
next_generation += 1
|
|
523
|
-
await time_out_assert(15, is_singleton_generation, True, dl_wallet_0, launcher_id, next_generation)
|
|
524
|
-
await time_out_assert(15, does_singleton_have_root, True, dl_wallet_0, launcher_id, bytes32([1] * 32))
|
|
525
|
-
await time_out_assert(15, wallet_0.get_confirmed_balance, funds)
|
|
526
|
-
await time_out_assert(15, wallet_0.get_unconfirmed_balance, funds)
|
|
527
|
-
assert (
|
|
528
|
-
len(
|
|
529
|
-
await dl_wallet_0.get_history(
|
|
530
|
-
launcher_id, min_generation=uint32(next_generation), max_generation=uint32(next_generation)
|
|
531
|
-
)
|
|
532
|
-
)
|
|
533
|
-
== 1
|
|
534
|
-
)
|
|
535
|
-
for tx in update_txs_0:
|
|
536
|
-
assert await wallet_node_0.wallet_state_manager.tx_store.get_transaction_record(tx.name) is None
|
|
537
|
-
assert await dl_wallet_0.get_singleton_record(record_0.coin_id) is None
|
|
472
|
+
await time_out_assert(15, is_singleton_confirmed, True, dl_wallet, launcher_id)
|
|
538
473
|
|
|
539
474
|
|
|
540
475
|
async def is_singleton_confirmed_and_root(dl_wallet: DataLayerWallet, lid: bytes32, root: bytes32) -> bool:
|
|
@@ -548,54 +483,132 @@ async def is_singleton_confirmed_and_root(dl_wallet: DataLayerWallet, lid: bytes
|
|
|
548
483
|
|
|
549
484
|
|
|
550
485
|
@pytest.mark.parametrize(
|
|
551
|
-
"
|
|
552
|
-
[
|
|
486
|
+
"wallet_environments",
|
|
487
|
+
[
|
|
488
|
+
{
|
|
489
|
+
"num_environments": 2,
|
|
490
|
+
"blocks_needed": [3, 1],
|
|
491
|
+
}
|
|
492
|
+
],
|
|
493
|
+
indirect=True,
|
|
553
494
|
)
|
|
495
|
+
@pytest.mark.limit_consensus_modes
|
|
554
496
|
@pytest.mark.anyio
|
|
555
|
-
async def test_mirrors(
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
497
|
+
async def test_mirrors(wallet_environments: WalletTestFramework) -> None:
|
|
498
|
+
env_1 = wallet_environments.environments[0]
|
|
499
|
+
env_2 = wallet_environments.environments[1]
|
|
500
|
+
env_1.wallet_aliases = {
|
|
501
|
+
"xch": 1,
|
|
502
|
+
"dl": 2,
|
|
503
|
+
}
|
|
504
|
+
env_2.wallet_aliases = {
|
|
505
|
+
"xch": 1,
|
|
506
|
+
"dl": 2,
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
dl_wallet_1 = await DataLayerWallet.create_new_dl_wallet(env_1.wallet_state_manager)
|
|
510
|
+
dl_wallet_2 = await DataLayerWallet.create_new_dl_wallet(env_2.wallet_state_manager)
|
|
511
|
+
|
|
512
|
+
async with dl_wallet_1.wallet_state_manager.new_action_scope(
|
|
513
|
+
wallet_environments.tx_config, push=True
|
|
514
|
+
) as action_scope:
|
|
572
515
|
launcher_id_1 = await dl_wallet_1.generate_new_reporter(bytes32.zeros, action_scope)
|
|
573
|
-
assert await dl_wallet_1.get_latest_singleton(launcher_id_1) is not None
|
|
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.zeros)
|
|
576
516
|
|
|
577
|
-
async with dl_wallet_2.wallet_state_manager.new_action_scope(
|
|
517
|
+
async with dl_wallet_2.wallet_state_manager.new_action_scope(
|
|
518
|
+
wallet_environments.tx_config, push=True
|
|
519
|
+
) as action_scope:
|
|
578
520
|
launcher_id_2 = await dl_wallet_2.generate_new_reporter(bytes32.zeros, action_scope)
|
|
521
|
+
|
|
522
|
+
assert await dl_wallet_1.get_latest_singleton(launcher_id_1) is not None
|
|
579
523
|
assert await dl_wallet_2.get_latest_singleton(launcher_id_2) is not None
|
|
580
|
-
|
|
524
|
+
|
|
525
|
+
await wallet_environments.process_pending_states(
|
|
526
|
+
[
|
|
527
|
+
WalletStateTransition(
|
|
528
|
+
pre_block_balance_updates={
|
|
529
|
+
"xch": {
|
|
530
|
+
"unconfirmed_wallet_balance": -1,
|
|
531
|
+
"<=#spendable_balance": -1,
|
|
532
|
+
"<=#max_send_amount": -1,
|
|
533
|
+
">=#pending_change": 1,
|
|
534
|
+
"pending_coin_removal_count": 1, # creation + launcher
|
|
535
|
+
},
|
|
536
|
+
"dl": {
|
|
537
|
+
"init": True,
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
post_block_balance_updates={
|
|
541
|
+
"xch": {
|
|
542
|
+
"confirmed_wallet_balance": -1,
|
|
543
|
+
">=#spendable_balance": 0,
|
|
544
|
+
">=#max_send_amount": 0,
|
|
545
|
+
"<=#pending_change": -1,
|
|
546
|
+
"pending_coin_removal_count": -1,
|
|
547
|
+
},
|
|
548
|
+
"dl": {
|
|
549
|
+
"unspent_coin_count": 1,
|
|
550
|
+
},
|
|
551
|
+
},
|
|
552
|
+
),
|
|
553
|
+
]
|
|
554
|
+
* 2
|
|
555
|
+
)
|
|
556
|
+
|
|
557
|
+
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet_1, launcher_id_1, bytes32.zeros)
|
|
581
558
|
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet_2, launcher_id_2, bytes32.zeros)
|
|
582
559
|
|
|
583
|
-
peer_1 =
|
|
560
|
+
peer_1 = env_1.node.get_full_node_peer()
|
|
584
561
|
await dl_wallet_1.track_new_launcher_id(launcher_id_2, peer_1)
|
|
585
|
-
|
|
562
|
+
await env_1.change_balances({"dl": {"unspent_coin_count": 1}})
|
|
563
|
+
peer_2 = env_2.node.get_full_node_peer()
|
|
586
564
|
await dl_wallet_2.track_new_launcher_id(launcher_id_1, peer_2)
|
|
565
|
+
await env_2.change_balances({"dl": {"unspent_coin_count": 1}})
|
|
587
566
|
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet_1, launcher_id_2, bytes32.zeros)
|
|
588
567
|
await time_out_assert(15, is_singleton_confirmed_and_root, True, dl_wallet_2, launcher_id_1, bytes32.zeros)
|
|
589
568
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
569
|
+
fee = uint64(1_999_999_999_999)
|
|
570
|
+
mirror_amount = uint64(3)
|
|
571
|
+
|
|
572
|
+
async with dl_wallet_1.wallet_state_manager.new_action_scope(
|
|
573
|
+
wallet_environments.tx_config, push=True
|
|
574
|
+
) as action_scope:
|
|
575
|
+
await dl_wallet_1.create_new_mirror(launcher_id_2, mirror_amount, [b"foo", b"bar"], action_scope, fee=fee)
|
|
576
|
+
|
|
594
577
|
additions: list[Coin] = []
|
|
595
578
|
for tx in action_scope.side_effects.transactions:
|
|
596
579
|
if tx.spend_bundle is not None:
|
|
597
580
|
additions.extend(tx.spend_bundle.additions())
|
|
598
|
-
|
|
581
|
+
|
|
582
|
+
await wallet_environments.process_pending_states(
|
|
583
|
+
[
|
|
584
|
+
WalletStateTransition(
|
|
585
|
+
pre_block_balance_updates={
|
|
586
|
+
"xch": {
|
|
587
|
+
"unconfirmed_wallet_balance": -fee - mirror_amount,
|
|
588
|
+
# these match exactly because of our change from the creation
|
|
589
|
+
"<=#spendable_balance": -fee - mirror_amount,
|
|
590
|
+
"<=#max_send_amount": -fee - mirror_amount,
|
|
591
|
+
">=#pending_change": 1,
|
|
592
|
+
"pending_coin_removal_count": 3,
|
|
593
|
+
},
|
|
594
|
+
"dl": {},
|
|
595
|
+
},
|
|
596
|
+
post_block_balance_updates={
|
|
597
|
+
"xch": {
|
|
598
|
+
"confirmed_wallet_balance": -fee - mirror_amount,
|
|
599
|
+
">=#spendable_balance": 1,
|
|
600
|
+
">=#max_send_amount": 1,
|
|
601
|
+
"<=#pending_change": -1,
|
|
602
|
+
"pending_coin_removal_count": -3,
|
|
603
|
+
"unspent_coin_count": -2,
|
|
604
|
+
},
|
|
605
|
+
"dl": {
|
|
606
|
+
"unspent_coin_count": 1,
|
|
607
|
+
},
|
|
608
|
+
},
|
|
609
|
+
),
|
|
610
|
+
]
|
|
611
|
+
)
|
|
599
612
|
|
|
600
613
|
mirror_coin: Coin = next(c for c in additions if c.puzzle_hash == create_mirror_puzzle().get_tree_hash())
|
|
601
614
|
mirror = Mirror(
|
|
@@ -604,16 +617,52 @@ async def test_mirrors(wallets_prefarm: Any, trusted: bool) -> None:
|
|
|
604
617
|
uint64(mirror_coin.amount),
|
|
605
618
|
[b"foo", b"bar"],
|
|
606
619
|
True,
|
|
607
|
-
|
|
620
|
+
wallet_environments.full_node.full_node.blockchain.get_peak_height(),
|
|
608
621
|
)
|
|
609
622
|
await time_out_assert(15, dl_wallet_1.get_mirrors_for_launcher, [mirror], launcher_id_2)
|
|
610
623
|
await time_out_assert(
|
|
611
624
|
15, dl_wallet_2.get_mirrors_for_launcher, [dataclasses.replace(mirror, ours=False)], launcher_id_2
|
|
612
625
|
)
|
|
613
626
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
627
|
+
fee = uint64(2_000_000_000_000)
|
|
628
|
+
|
|
629
|
+
async with dl_wallet_1.wallet_state_manager.new_action_scope(
|
|
630
|
+
wallet_environments.tx_config, push=True
|
|
631
|
+
) as action_scope:
|
|
632
|
+
await dl_wallet_1.delete_mirror(mirror.coin_id, peer_1, action_scope, fee=fee)
|
|
633
|
+
|
|
634
|
+
await wallet_environments.process_pending_states(
|
|
635
|
+
[
|
|
636
|
+
WalletStateTransition(
|
|
637
|
+
pre_block_balance_updates={
|
|
638
|
+
"xch": {
|
|
639
|
+
"unconfirmed_wallet_balance": -fee + mirror.amount,
|
|
640
|
+
# these match exactly because of our change from the creation
|
|
641
|
+
"<=#spendable_balance": -fee + mirror.amount,
|
|
642
|
+
"<=#max_send_amount": -fee + mirror.amount,
|
|
643
|
+
">=#pending_change": 1,
|
|
644
|
+
"pending_coin_removal_count": 2,
|
|
645
|
+
},
|
|
646
|
+
"dl": {
|
|
647
|
+
"pending_coin_removal_count": 1,
|
|
648
|
+
},
|
|
649
|
+
},
|
|
650
|
+
post_block_balance_updates={
|
|
651
|
+
"xch": {
|
|
652
|
+
"confirmed_wallet_balance": -fee + mirror.amount,
|
|
653
|
+
">=#spendable_balance": 1,
|
|
654
|
+
">=#max_send_amount": 1,
|
|
655
|
+
"<=#pending_change": -1,
|
|
656
|
+
"pending_coin_removal_count": -2,
|
|
657
|
+
},
|
|
658
|
+
"dl": {
|
|
659
|
+
"pending_coin_removal_count": -1,
|
|
660
|
+
"unspent_coin_count": -1,
|
|
661
|
+
},
|
|
662
|
+
},
|
|
663
|
+
),
|
|
664
|
+
]
|
|
665
|
+
)
|
|
617
666
|
|
|
618
667
|
await time_out_assert(15, dl_wallet_1.get_mirrors_for_launcher, [], launcher_id_2)
|
|
619
668
|
await time_out_assert(15, dl_wallet_2.get_mirrors_for_launcher, [], launcher_id_2)
|