chia-blockchain 2.5.7rc4__py3-none-any.whl → 2.5.8rc1__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 +8 -4
- chia/_tests/blockchain/blockchain_test_utils.py +6 -8
- chia/_tests/blockchain/test_augmented_chain.py +4 -4
- chia/_tests/blockchain/test_blockchain.py +165 -190
- chia/_tests/blockchain/test_build_chains.py +2 -4
- chia/_tests/blockchain/test_get_block_generator.py +2 -3
- chia/_tests/clvm/coin_store.py +4 -7
- chia/_tests/clvm/test_clvm_step.py +4 -4
- chia/_tests/clvm/test_puzzle_compression.py +2 -1
- chia/_tests/clvm/test_puzzle_drivers.py +2 -2
- chia/_tests/clvm/test_singletons.py +2 -4
- chia/_tests/clvm/test_spend_sim.py +2 -2
- chia/_tests/cmds/cmd_test_utils.py +27 -45
- chia/_tests/cmds/test_cmd_framework.py +6 -6
- chia/_tests/cmds/test_daemon.py +3 -3
- chia/_tests/cmds/test_show.py +4 -4
- chia/_tests/cmds/test_tx_config_args.py +1 -2
- chia/_tests/cmds/testing_classes.py +4 -5
- chia/_tests/cmds/wallet/test_did.py +24 -27
- chia/_tests/cmds/wallet/test_nft.py +12 -10
- chia/_tests/cmds/wallet/test_vcs.py +11 -12
- chia/_tests/cmds/wallet/test_wallet.py +134 -89
- chia/_tests/conftest.py +59 -30
- chia/_tests/connection_utils.py +2 -2
- chia/_tests/core/cmds/test_beta.py +4 -4
- chia/_tests/core/cmds/test_keys.py +2 -3
- chia/_tests/core/cmds/test_wallet.py +15 -15
- chia/_tests/core/consensus/test_pot_iterations.py +19 -73
- chia/_tests/core/custom_types/test_proof_of_space.py +124 -98
- chia/_tests/core/daemon/test_daemon.py +11 -11
- chia/_tests/core/data_layer/conftest.py +2 -2
- chia/_tests/core/data_layer/test_data_rpc.py +28 -14
- chia/_tests/core/data_layer/test_data_store.py +10 -10
- chia/_tests/core/data_layer/util.py +11 -11
- chia/_tests/core/farmer/test_farmer_api.py +2 -4
- chia/_tests/core/full_node/full_sync/test_full_sync.py +8 -7
- chia/_tests/core/full_node/stores/test_block_store.py +5 -4
- chia/_tests/core/full_node/stores/test_coin_store.py +5 -11
- chia/_tests/core/full_node/stores/test_full_node_store.py +8 -8
- chia/_tests/core/full_node/stores/test_hint_store.py +2 -2
- chia/_tests/core/full_node/test_block_height_map.py +3 -4
- chia/_tests/core/full_node/test_conditions.py +21 -23
- chia/_tests/core/full_node/test_full_node.py +225 -62
- chia/_tests/core/full_node/test_hint_management.py +2 -4
- chia/_tests/core/full_node/test_performance.py +0 -1
- chia/_tests/core/full_node/test_prev_tx_block.py +88 -11
- chia/_tests/core/full_node/test_transactions.py +1 -2
- chia/_tests/core/full_node/test_tx_processing_queue.py +109 -25
- chia/_tests/core/mempool/test_mempool.py +29 -37
- chia/_tests/core/mempool/test_mempool_fee_estimator.py +39 -39
- chia/_tests/core/mempool/test_mempool_fee_protocol.py +2 -6
- chia/_tests/core/mempool/test_mempool_manager.py +963 -839
- chia/_tests/core/mempool/test_singleton_fast_forward.py +6 -6
- chia/_tests/core/server/serve.py +7 -7
- chia/_tests/core/server/test_dos.py +1 -2
- chia/_tests/core/server/test_event_loop.py +12 -4
- chia/_tests/core/server/test_loop.py +7 -8
- chia/_tests/core/server/test_rate_limits.py +9 -8
- chia/_tests/core/server/test_server.py +61 -1
- chia/_tests/core/services/test_services.py +2 -2
- chia/_tests/core/ssl/test_ssl.py +2 -2
- chia/_tests/core/test_cost_calculation.py +2 -6
- chia/_tests/core/test_farmer_harvester_rpc.py +3 -5
- chia/_tests/core/test_filter.py +0 -1
- chia/_tests/core/test_full_node_rpc.py +2 -2
- chia/_tests/core/test_merkle_set.py +1 -2
- chia/_tests/core/test_seeder.py +4 -4
- chia/_tests/core/util/test_config.py +4 -4
- chia/_tests/core/util/test_jsonify.py +2 -2
- chia/_tests/core/util/test_keychain.py +3 -3
- chia/_tests/core/util/test_lockfile.py +2 -1
- chia/_tests/core/util/test_log_exceptions.py +1 -2
- chia/_tests/core/util/test_streamable.py +17 -17
- chia/_tests/db/test_db_wrapper.py +3 -2
- chia/_tests/environments/wallet.py +14 -14
- chia/_tests/ether.py +4 -3
- chia/_tests/farmer_harvester/test_farmer.py +41 -24
- chia/_tests/farmer_harvester/test_farmer_harvester.py +50 -17
- chia/_tests/farmer_harvester/test_filter_prefix_bits.py +27 -27
- chia/_tests/farmer_harvester/test_third_party_harvesters.py +21 -22
- chia/_tests/fee_estimation/test_fee_estimation_integration.py +18 -18
- chia/_tests/fee_estimation/test_fee_estimation_rpc.py +11 -9
- chia/_tests/harvester/test_harvester_api.py +11 -4
- chia/_tests/plot_sync/test_plot_sync.py +13 -11
- chia/_tests/plot_sync/test_receiver.py +11 -10
- chia/_tests/plot_sync/test_sync_simulated.py +2 -2
- chia/_tests/plot_sync/util.py +1 -2
- chia/_tests/plotting/test_plot_manager.py +7 -6
- chia/_tests/plotting/test_prover.py +30 -38
- chia/_tests/pools/test_pool_cmdline.py +4 -6
- chia/_tests/pools/test_pool_rpc.py +203 -61
- chia/_tests/pools/test_pool_wallet.py +3 -3
- chia/_tests/pools/test_wallet_pool_store.py +1 -4
- chia/_tests/process_junit.py +2 -2
- chia/_tests/rpc/test_rpc_client.py +4 -4
- chia/_tests/rpc/test_rpc_server.py +3 -3
- chia/_tests/simulation/test_simulation.py +12 -25
- chia/_tests/solver/test_solver_service.py +13 -4
- chia/_tests/testconfig.py +2 -2
- chia/_tests/timelord/test_new_peak.py +22 -11
- chia/_tests/tools/test_run_block.py +0 -2
- chia/_tests/tools/test_virtual_project.py +2 -1
- chia/_tests/util/benchmarks.py +1 -0
- chia/_tests/util/blockchain.py +38 -36
- chia/_tests/util/blockchain_mock.py +11 -11
- chia/_tests/util/build_network_protocol_files.py +2 -1
- chia/_tests/util/coin_store.py +2 -1
- chia/_tests/util/config.py +1 -1
- chia/_tests/util/db_connection.py +2 -3
- chia/_tests/util/full_sync.py +9 -11
- chia/_tests/util/gen_ssl_certs.py +4 -5
- chia/_tests/util/get_name_puzzle_conditions.py +2 -0
- chia/_tests/util/misc.py +24 -24
- chia/_tests/util/network_protocol_data.py +20 -3
- chia/_tests/util/protocol_messages_bytes-v1.0 +0 -0
- chia/_tests/util/protocol_messages_json.py +292 -3
- chia/_tests/util/setup_nodes.py +62 -47
- chia/_tests/util/spend_sim.py +57 -57
- chia/_tests/util/test_async_pool.py +2 -3
- chia/_tests/util/test_chia_version.py +1 -3
- chia/_tests/util/test_config.py +3 -3
- chia/_tests/util/test_full_block_utils.py +6 -3
- chia/_tests/util/test_limited_semaphore.py +1 -2
- chia/_tests/util/test_misc.py +2 -2
- chia/_tests/util/test_network.py +1 -2
- chia/_tests/util/test_priority_mutex.py +3 -3
- chia/_tests/util/test_recursive_replace.py +5 -6
- chia/_tests/util/test_replace_str_to_bytes.py +8 -10
- chia/_tests/util/test_testnet_overrides.py +3 -3
- chia/_tests/util/time_out_assert.py +2 -2
- chia/_tests/wallet/cat_wallet/test_cat_lifecycle.py +4 -6
- chia/_tests/wallet/cat_wallet/test_cat_outer_puzzle.py +2 -4
- chia/_tests/wallet/cat_wallet/test_cat_wallet.py +19 -13
- chia/_tests/wallet/cat_wallet/test_offer_lifecycle.py +13 -13
- chia/_tests/wallet/cat_wallet/test_trades.py +40 -38
- chia/_tests/wallet/clawback/test_clawback_lifecycle.py +2 -4
- chia/_tests/wallet/conftest.py +6 -6
- chia/_tests/wallet/db_wallet/test_db_graftroot.py +1 -1
- chia/_tests/wallet/db_wallet/test_dl_offers.py +34 -34
- chia/_tests/wallet/did_wallet/test_did.py +16 -6
- chia/_tests/wallet/nft_wallet/test_nft_1_offers.py +21 -21
- chia/_tests/wallet/nft_wallet/test_nft_bulk_mint.py +20 -6
- chia/_tests/wallet/nft_wallet/test_nft_offers.py +19 -21
- chia/_tests/wallet/nft_wallet/test_nft_puzzles.py +1 -2
- chia/_tests/wallet/nft_wallet/test_nft_wallet.py +121 -2
- chia/_tests/wallet/nft_wallet/test_ownership_outer_puzzle.py +6 -9
- chia/_tests/wallet/rpc/test_dl_wallet_rpc.py +44 -1
- chia/_tests/wallet/rpc/test_wallet_rpc.py +1672 -896
- chia/_tests/wallet/sync/test_wallet_sync.py +43 -47
- chia/_tests/wallet/test_clvm_streamable.py +2 -3
- chia/_tests/wallet/test_coin_management.py +2 -2
- chia/_tests/wallet/test_conditions.py +45 -51
- chia/_tests/wallet/test_debug_spend_bundle.py +2 -2
- chia/_tests/wallet/test_new_wallet_protocol.py +4 -6
- chia/_tests/wallet/test_notifications.py +14 -14
- chia/_tests/wallet/test_signer_protocol.py +5 -5
- chia/_tests/wallet/test_singleton_lifecycle_fast.py +4 -3
- chia/_tests/wallet/test_transaction_store.py +20 -20
- chia/_tests/wallet/test_util.py +2 -2
- chia/_tests/wallet/test_wallet.py +380 -228
- chia/_tests/wallet/test_wallet_action_scope.py +4 -4
- chia/_tests/wallet/test_wallet_blockchain.py +12 -12
- chia/_tests/wallet/test_wallet_coin_store.py +3 -4
- chia/_tests/wallet/test_wallet_node.py +14 -14
- chia/_tests/wallet/test_wallet_test_framework.py +2 -1
- chia/_tests/wallet/test_wallet_utils.py +2 -3
- chia/_tests/wallet/vc_wallet/test_cr_outer_puzzle.py +3 -5
- chia/_tests/wallet/vc_wallet/test_vc_lifecycle.py +14 -15
- chia/_tests/wallet/vc_wallet/test_vc_wallet.py +29 -24
- chia/_tests/wallet/wallet_block_tools.py +12 -11
- chia/_tests/weight_proof/config.py +1 -0
- chia/_tests/weight_proof/test_weight_proof.py +5 -4
- chia/apis/__init__.py +21 -0
- chia/apis/farmer_stub.py +102 -0
- chia/apis/full_node_stub.py +372 -0
- chia/apis/harvester_stub.py +57 -0
- chia/apis/introducer_stub.py +35 -0
- chia/apis/solver_stub.py +30 -0
- chia/apis/stub_protocol_registry.py +21 -0
- chia/apis/timelord_stub.py +39 -0
- chia/apis/wallet_stub.py +161 -0
- chia/cmds/beta.py +3 -4
- chia/cmds/beta_funcs.py +4 -3
- chia/cmds/check_wallet_db.py +4 -4
- chia/cmds/chia.py +1 -2
- chia/cmds/cmd_classes.py +11 -13
- chia/cmds/cmd_helpers.py +11 -11
- chia/cmds/cmds_util.py +15 -15
- chia/cmds/coin_funcs.py +6 -7
- chia/cmds/coins.py +2 -3
- chia/cmds/configure.py +1 -2
- chia/cmds/data.py +42 -42
- chia/cmds/data_funcs.py +81 -81
- chia/cmds/db.py +4 -5
- chia/cmds/db_backup_func.py +2 -2
- chia/cmds/db_upgrade_func.py +3 -3
- chia/cmds/db_validate_func.py +2 -2
- chia/cmds/dev/data.py +4 -4
- chia/cmds/dev/gh.py +5 -5
- chia/cmds/dev/installers.py +2 -3
- chia/cmds/dev/mempool.py +3 -4
- chia/cmds/dev/mempool_funcs.py +4 -4
- chia/cmds/dev/sim.py +8 -8
- chia/cmds/dump_keyring.py +3 -3
- chia/cmds/farm.py +6 -8
- chia/cmds/farm_funcs.py +25 -24
- chia/cmds/init_funcs.py +4 -4
- chia/cmds/keys.py +16 -18
- chia/cmds/keys_funcs.py +36 -36
- chia/cmds/netspace.py +1 -3
- chia/cmds/netspace_funcs.py +1 -2
- chia/cmds/options.py +3 -2
- chia/cmds/param_types.py +17 -16
- chia/cmds/passphrase.py +6 -7
- chia/cmds/passphrase_funcs.py +11 -13
- chia/cmds/peer.py +1 -3
- chia/cmds/peer_funcs.py +3 -3
- chia/cmds/plotnft.py +6 -7
- chia/cmds/plotnft_funcs.py +37 -26
- chia/cmds/rpc.py +3 -3
- chia/cmds/show.py +3 -5
- chia/cmds/show_funcs.py +9 -9
- chia/cmds/sim_funcs.py +25 -26
- chia/cmds/solver.py +1 -3
- chia/cmds/solver_funcs.py +1 -2
- chia/cmds/start_funcs.py +2 -2
- chia/cmds/wallet.py +76 -81
- chia/cmds/wallet_funcs.py +206 -177
- chia/consensus/augmented_chain.py +6 -6
- chia/consensus/block_body_validation.py +19 -15
- chia/consensus/block_creation.py +25 -21
- chia/consensus/block_header_validation.py +27 -13
- chia/consensus/block_height_map.py +3 -6
- chia/consensus/block_height_map_protocol.py +2 -2
- chia/consensus/block_record.py +2 -4
- chia/consensus/blockchain.py +58 -40
- chia/consensus/blockchain_interface.py +7 -7
- chia/consensus/coin_store_protocol.py +5 -6
- chia/consensus/condition_tools.py +4 -4
- chia/consensus/cost_calculator.py +2 -3
- chia/consensus/default_constants.py +16 -13
- chia/consensus/deficit.py +1 -3
- chia/consensus/difficulty_adjustment.py +3 -5
- chia/consensus/find_fork_point.py +2 -4
- chia/consensus/full_block_to_block_record.py +11 -13
- chia/consensus/generator_tools.py +2 -3
- chia/consensus/get_block_challenge.py +42 -26
- chia/consensus/get_block_generator.py +2 -3
- chia/consensus/make_sub_epoch_summary.py +8 -7
- chia/consensus/multiprocess_validation.py +31 -20
- chia/consensus/pos_quality.py +6 -23
- chia/consensus/pot_iterations.py +17 -44
- chia/consensus/signage_point.py +4 -5
- chia/consensus/vdf_info_computation.py +2 -4
- chia/daemon/client.py +8 -8
- chia/daemon/keychain_proxy.py +31 -37
- chia/daemon/server.py +32 -33
- chia/daemon/windows_signal.py +4 -3
- chia/data_layer/data_layer.py +86 -77
- chia/data_layer/data_layer_rpc_api.py +9 -9
- chia/data_layer/data_layer_rpc_client.py +13 -15
- chia/data_layer/data_layer_server.py +3 -3
- chia/data_layer/data_layer_util.py +14 -14
- chia/data_layer/data_layer_wallet.py +94 -101
- chia/data_layer/data_store.py +50 -50
- chia/data_layer/dl_wallet_store.py +9 -12
- chia/data_layer/download_data.py +8 -9
- chia/data_layer/s3_plugin_service.py +5 -9
- chia/data_layer/start_data_layer.py +5 -5
- chia/farmer/farmer.py +31 -31
- chia/farmer/farmer_api.py +45 -33
- chia/farmer/farmer_rpc_api.py +5 -4
- chia/farmer/farmer_rpc_client.py +6 -6
- chia/farmer/start_farmer.py +6 -6
- chia/full_node/block_store.py +13 -16
- chia/full_node/check_fork_next_block.py +1 -2
- chia/full_node/coin_store.py +15 -16
- chia/full_node/eligible_coin_spends.py +3 -3
- chia/full_node/fee_estimate_store.py +2 -3
- chia/full_node/fee_tracker.py +1 -2
- chia/full_node/full_block_utils.py +4 -4
- chia/full_node/full_node.py +238 -224
- chia/full_node/full_node_api.py +193 -150
- chia/full_node/full_node_rpc_api.py +53 -31
- chia/full_node/full_node_rpc_client.py +18 -19
- chia/full_node/full_node_store.py +45 -43
- chia/full_node/hint_management.py +2 -2
- chia/full_node/mempool.py +17 -19
- chia/full_node/mempool_manager.py +89 -42
- chia/full_node/pending_tx_cache.py +2 -3
- chia/full_node/start_full_node.py +5 -5
- chia/full_node/sync_store.py +3 -4
- chia/full_node/tx_processing_queue.py +34 -13
- chia/full_node/weight_proof.py +61 -48
- chia/harvester/harvester.py +25 -24
- chia/harvester/harvester_api.py +61 -38
- chia/harvester/harvester_rpc_api.py +10 -10
- chia/harvester/start_harvester.py +4 -4
- chia/introducer/introducer.py +3 -3
- chia/introducer/introducer_api.py +6 -4
- chia/introducer/start_introducer.py +4 -4
- chia/legacy/keyring.py +3 -3
- chia/plot_sync/delta.py +1 -2
- chia/plot_sync/receiver.py +20 -17
- chia/plot_sync/sender.py +15 -10
- chia/plotters/bladebit.py +7 -7
- chia/plotters/chiapos.py +2 -2
- chia/plotters/madmax.py +4 -4
- chia/plotters/plotters.py +4 -4
- chia/plotters/plotters_util.py +3 -3
- chia/plotting/cache.py +20 -14
- chia/plotting/check_plots.py +26 -35
- chia/plotting/create_plots.py +22 -23
- chia/plotting/manager.py +21 -14
- chia/plotting/prover.py +59 -42
- chia/plotting/util.py +16 -16
- chia/pools/pool_config.py +2 -1
- chia/pools/pool_puzzles.py +11 -12
- chia/pools/pool_wallet.py +34 -57
- chia/pools/pool_wallet_info.py +39 -10
- chia/protocols/farmer_protocol.py +8 -9
- chia/protocols/fee_estimate.py +3 -4
- chia/protocols/full_node_protocol.py +3 -4
- chia/protocols/harvester_protocol.py +27 -15
- chia/protocols/outbound_message.py +3 -3
- chia/protocols/pool_protocol.py +8 -9
- chia/protocols/shared_protocol.py +1 -2
- chia/protocols/solver_protocol.py +9 -2
- chia/protocols/timelord_protocol.py +4 -7
- chia/protocols/wallet_protocol.py +11 -12
- chia/rpc/rpc_client.py +9 -9
- chia/rpc/rpc_server.py +17 -17
- chia/rpc/util.py +2 -2
- chia/seeder/crawler.py +8 -8
- chia/seeder/crawler_api.py +21 -27
- chia/seeder/crawler_rpc_api.py +2 -2
- chia/seeder/dns_server.py +21 -21
- chia/seeder/start_crawler.py +4 -4
- chia/server/address_manager.py +15 -16
- chia/server/api_protocol.py +11 -11
- chia/server/chia_policy.py +46 -26
- chia/server/introducer_peers.py +2 -3
- chia/server/node_discovery.py +19 -19
- chia/server/rate_limit_numbers.py +4 -5
- chia/server/rate_limits.py +4 -4
- chia/server/resolve_peer_info.py +4 -4
- chia/server/server.py +49 -52
- chia/server/signal_handlers.py +6 -6
- chia/server/start_service.py +17 -17
- chia/server/upnp.py +4 -6
- chia/server/ws_connection.py +52 -37
- chia/simulator/add_blocks_in_batches.py +1 -3
- chia/simulator/block_tools.py +312 -200
- chia/simulator/full_node_simulator.py +56 -35
- chia/simulator/keyring.py +2 -3
- chia/simulator/setup_services.py +15 -15
- chia/simulator/simulator_full_node_rpc_api.py +1 -2
- chia/simulator/simulator_full_node_rpc_client.py +1 -2
- chia/simulator/simulator_protocol.py +1 -2
- chia/simulator/simulator_test_tools.py +3 -3
- chia/simulator/start_simulator.py +7 -7
- chia/simulator/wallet_tools.py +10 -10
- chia/solver/solver.py +10 -10
- chia/solver/solver_api.py +10 -8
- chia/solver/solver_rpc_api.py +2 -2
- chia/solver/start_solver.py +4 -4
- chia/ssl/cacert.pem +148 -90
- chia/ssl/chia_ca.crt +14 -10
- chia/ssl/chia_ca_old.crt +19 -0
- chia/ssl/create_ssl.py +4 -4
- chia/ssl/renewedselfsignedca.conf +4 -0
- chia/ssl/ssl_check.py +1 -2
- chia/timelord/iters_from_block.py +1 -4
- chia/timelord/start_timelord.py +4 -4
- chia/timelord/timelord.py +44 -40
- chia/timelord/timelord_api.py +6 -4
- chia/timelord/timelord_launcher.py +2 -2
- chia/timelord/timelord_rpc_api.py +2 -2
- chia/timelord/timelord_state.py +11 -12
- chia/types/block_protocol.py +1 -3
- chia/types/blockchain_format/coin.py +1 -3
- chia/types/blockchain_format/program.py +11 -8
- chia/types/blockchain_format/proof_of_space.py +123 -76
- chia/types/blockchain_format/tree_hash.py +3 -3
- chia/types/blockchain_format/vdf.py +1 -2
- chia/types/coin_spend.py +3 -3
- chia/types/mempool_item.py +5 -5
- chia/types/mempool_submission_status.py +2 -3
- chia/types/peer_info.py +1 -2
- chia/types/unfinished_header_block.py +3 -4
- chia/types/validation_state.py +1 -2
- chia/util/action_scope.py +8 -8
- chia/util/async_pool.py +5 -5
- chia/util/bech32m.py +1 -2
- chia/util/beta_metrics.py +2 -2
- chia/util/block_cache.py +4 -4
- chia/util/chia_logging.py +2 -2
- chia/util/chia_version.py +1 -2
- chia/util/config.py +15 -16
- chia/util/db_wrapper.py +26 -27
- chia/util/default_root.py +1 -2
- chia/util/errors.py +3 -3
- chia/util/file_keyring.py +14 -14
- chia/util/files.py +2 -3
- chia/util/hash.py +4 -4
- chia/util/initial-config.yaml +3 -5
- chia/util/inline_executor.py +2 -1
- chia/util/ip_address.py +1 -2
- chia/util/keychain.py +25 -27
- chia/util/keyring_wrapper.py +18 -19
- chia/util/lock.py +3 -4
- chia/util/log_exceptions.py +1 -2
- chia/util/lru_cache.py +2 -2
- chia/util/network.py +6 -6
- chia/util/path.py +2 -3
- chia/util/priority_mutex.py +2 -2
- chia/util/profiler.py +1 -2
- chia/util/safe_cancel_task.py +1 -2
- chia/util/streamable.py +22 -8
- chia/util/task_referencer.py +1 -1
- chia/util/timing.py +3 -3
- chia/util/virtual_project_analysis.py +6 -5
- chia/util/ws_message.py +2 -2
- chia/wallet/cat_wallet/cat_info.py +3 -4
- chia/wallet/cat_wallet/cat_outer_puzzle.py +12 -11
- chia/wallet/cat_wallet/cat_utils.py +3 -4
- chia/wallet/cat_wallet/cat_wallet.py +61 -83
- chia/wallet/cat_wallet/lineage_store.py +3 -4
- chia/wallet/cat_wallet/r_cat_wallet.py +19 -22
- chia/wallet/coin_selection.py +9 -10
- chia/wallet/conditions.py +120 -105
- chia/wallet/db_wallet/db_wallet_puzzles.py +4 -5
- chia/wallet/derivation_record.py +1 -2
- chia/wallet/derive_keys.py +2 -4
- chia/wallet/did_wallet/did_info.py +10 -11
- chia/wallet/did_wallet/did_wallet.py +36 -82
- chia/wallet/did_wallet/did_wallet_puzzles.py +7 -8
- chia/wallet/driver_protocol.py +5 -7
- chia/wallet/lineage_proof.py +4 -4
- chia/wallet/nft_wallet/metadata_outer_puzzle.py +11 -11
- chia/wallet/nft_wallet/nft_info.py +8 -9
- chia/wallet/nft_wallet/nft_puzzle_utils.py +8 -8
- chia/wallet/nft_wallet/nft_wallet.py +79 -116
- chia/wallet/nft_wallet/ownership_outer_puzzle.py +14 -14
- chia/wallet/nft_wallet/singleton_outer_puzzle.py +12 -11
- chia/wallet/nft_wallet/transfer_program_puzzle.py +11 -11
- chia/wallet/nft_wallet/uncurry_nft.py +10 -11
- chia/wallet/notification_manager.py +3 -3
- chia/wallet/notification_store.py +44 -61
- chia/wallet/outer_puzzles.py +6 -7
- chia/wallet/puzzle_drivers.py +34 -6
- chia/wallet/puzzles/clawback/drivers.py +6 -6
- chia/wallet/puzzles/deployed_puzzle_hashes.json +1 -54
- chia/wallet/puzzles/load_clvm.py +1 -1
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py +1 -2
- chia/wallet/puzzles/singleton_top_layer.py +2 -3
- chia/wallet/puzzles/singleton_top_layer_v1_1.py +3 -4
- chia/wallet/puzzles/tails.py +3 -3
- chia/wallet/singleton.py +5 -7
- chia/wallet/singleton_record.py +3 -3
- chia/wallet/start_wallet.py +5 -5
- chia/wallet/trade_manager.py +37 -58
- chia/wallet/trade_record.py +4 -4
- chia/wallet/trading/offer.py +59 -46
- chia/wallet/trading/trade_store.py +8 -9
- chia/wallet/transaction_record.py +8 -8
- chia/wallet/uncurried_puzzle.py +1 -2
- chia/wallet/util/clvm_streamable.py +12 -12
- chia/wallet/util/compute_hints.py +4 -5
- chia/wallet/util/curry_and_treehash.py +1 -2
- chia/wallet/util/merkle_tree.py +2 -3
- chia/wallet/util/peer_request_cache.py +8 -8
- chia/wallet/util/signing.py +85 -0
- chia/wallet/util/tx_config.py +15 -6
- chia/wallet/util/wallet_sync_utils.py +14 -16
- chia/wallet/util/wallet_types.py +2 -2
- chia/wallet/vc_wallet/cr_cat_drivers.py +10 -11
- chia/wallet/vc_wallet/cr_cat_wallet.py +50 -68
- chia/wallet/vc_wallet/cr_outer_puzzle.py +14 -13
- chia/wallet/vc_wallet/vc_drivers.py +27 -27
- chia/wallet/vc_wallet/vc_store.py +5 -6
- chia/wallet/vc_wallet/vc_wallet.py +33 -61
- chia/wallet/wallet.py +50 -78
- chia/wallet/wallet_action_scope.py +11 -11
- chia/wallet/wallet_blockchain.py +12 -12
- chia/wallet/wallet_coin_record.py +12 -6
- chia/wallet/wallet_coin_store.py +24 -25
- chia/wallet/wallet_interested_store.py +3 -5
- chia/wallet/wallet_nft_store.py +10 -11
- chia/wallet/wallet_node.py +53 -61
- chia/wallet/wallet_node_api.py +5 -3
- chia/wallet/wallet_protocol.py +23 -23
- chia/wallet/wallet_puzzle_store.py +15 -18
- chia/wallet/wallet_request_types.py +778 -114
- chia/wallet/wallet_retry_store.py +1 -3
- chia/wallet/wallet_rpc_api.py +572 -909
- chia/wallet/wallet_rpc_client.py +87 -279
- chia/wallet/wallet_singleton_store.py +3 -4
- chia/wallet/wallet_state_manager.py +332 -106
- chia/wallet/wallet_transaction_store.py +11 -14
- chia/wallet/wallet_user_store.py +4 -6
- chia/wallet/wallet_weight_proof_handler.py +4 -4
- {chia_blockchain-2.5.7rc4.dist-info → chia_blockchain-2.5.8rc1.dist-info}/METADATA +6 -5
- {chia_blockchain-2.5.7rc4.dist-info → chia_blockchain-2.5.8rc1.dist-info}/RECORD +507 -516
- chia/apis.py +0 -21
- chia/consensus/check_time_locks.py +0 -57
- chia/data_layer/puzzles/__init__.py +0 -0
- chia/data_layer/puzzles/graftroot_dl_offers.clsp +0 -100
- chia/data_layer/puzzles/graftroot_dl_offers.clsp.hex +0 -1
- chia/types/coin_record.py +0 -44
- chia/wallet/nft_wallet/puzzles/__init__.py +0 -0
- chia/wallet/nft_wallet/puzzles/create_nft_launcher_from_did.clsp +0 -6
- chia/wallet/nft_wallet/puzzles/create_nft_launcher_from_did.clsp.hex +0 -1
- chia/wallet/nft_wallet/puzzles/nft_intermediate_launcher.clsp +0 -6
- chia/wallet/nft_wallet/puzzles/nft_intermediate_launcher.clsp.hex +0 -1
- chia/wallet/nft_wallet/puzzles/nft_metadata_updater_default.clsp +0 -30
- chia/wallet/nft_wallet/puzzles/nft_metadata_updater_default.clsp.hex +0 -1
- chia/wallet/nft_wallet/puzzles/nft_metadata_updater_updateable.clsp +0 -28
- chia/wallet/nft_wallet/puzzles/nft_metadata_updater_updateable.clsp.hex +0 -1
- chia/wallet/nft_wallet/puzzles/nft_ownership_layer.clsp +0 -100
- chia/wallet/nft_wallet/puzzles/nft_ownership_layer.clsp.hex +0 -1
- chia/wallet/nft_wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clsp +0 -78
- chia/wallet/nft_wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clsp.hex +0 -1
- chia/wallet/nft_wallet/puzzles/nft_state_layer.clsp +0 -74
- chia/wallet/nft_wallet/puzzles/nft_state_layer.clsp.hex +0 -1
- {chia_blockchain-2.5.7rc4.dist-info → chia_blockchain-2.5.8rc1.dist-info}/WHEEL +0 -0
- {chia_blockchain-2.5.7rc4.dist-info → chia_blockchain-2.5.8rc1.dist-info}/entry_points.txt +0 -0
- {chia_blockchain-2.5.7rc4.dist-info → chia_blockchain-2.5.8rc1.dist-info}/licenses/LICENSE +0 -0
|
@@ -9,7 +9,6 @@ import time
|
|
|
9
9
|
from collections.abc import AsyncIterator, Awaitable
|
|
10
10
|
from contextlib import asynccontextmanager
|
|
11
11
|
from dataclasses import dataclass, replace
|
|
12
|
-
from typing import Optional
|
|
13
12
|
|
|
14
13
|
import pytest
|
|
15
14
|
from chia_rs import (
|
|
@@ -39,6 +38,7 @@ from chia._tests.blockchain.blockchain_test_utils import (
|
|
|
39
38
|
check_block_store_invariant,
|
|
40
39
|
)
|
|
41
40
|
from chia._tests.conftest import ConsensusMode
|
|
41
|
+
from chia._tests.core.full_node.test_full_node import find_reward_coin
|
|
42
42
|
from chia._tests.util.blockchain import create_blockchain
|
|
43
43
|
from chia._tests.util.get_name_puzzle_conditions import get_name_puzzle_conditions
|
|
44
44
|
from chia.consensus.augmented_chain import AugmentedBlockchain
|
|
@@ -152,7 +152,14 @@ class TestGenesisBlock:
|
|
|
152
152
|
await _validate_and_add_block(empty_blockchain, genesis)
|
|
153
153
|
|
|
154
154
|
@pytest.mark.anyio
|
|
155
|
-
async def test_genesis_validate_1(
|
|
155
|
+
async def test_genesis_validate_1(
|
|
156
|
+
self, empty_blockchain: Blockchain, bt: BlockTools, monkeypatch: pytest.MonkeyPatch
|
|
157
|
+
) -> None:
|
|
158
|
+
# Monkey patch pre_sp_tx_block so we dont throw there
|
|
159
|
+
monkeypatch.setattr(
|
|
160
|
+
"chia.consensus.multiprocess_validation.pre_sp_tx_block_height",
|
|
161
|
+
lambda *args, **kwargs: uint32(0),
|
|
162
|
+
)
|
|
156
163
|
genesis = bt.get_consecutive_blocks(1, force_overflow=False)[0]
|
|
157
164
|
bad_prev = bytes([1] * 32)
|
|
158
165
|
genesis = recursive_replace(genesis, "foliage.prev_block_hash", bad_prev)
|
|
@@ -160,124 +167,126 @@ class TestGenesisBlock:
|
|
|
160
167
|
|
|
161
168
|
|
|
162
169
|
class TestBlockHeaderValidation:
|
|
163
|
-
@pytest.mark.limit_consensus_modes(reason="save time")
|
|
164
170
|
@pytest.mark.anyio
|
|
165
171
|
async def test_long_chain(self, empty_blockchain: Blockchain, default_1000_blocks: list[FullBlock]) -> None:
|
|
166
172
|
blocks = default_1000_blocks
|
|
167
173
|
fork_info = ForkInfo(blocks[0].height - 1, blocks[0].height - 1, blocks[0].prev_header_hash)
|
|
168
174
|
for block in blocks:
|
|
169
175
|
if (
|
|
170
|
-
len(block.finished_sub_slots)
|
|
171
|
-
|
|
176
|
+
len(block.finished_sub_slots) == 0
|
|
177
|
+
or block.finished_sub_slots[0].challenge_chain.subepoch_summary_hash is None
|
|
172
178
|
):
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
block.finished_sub_slots[0],
|
|
176
|
-
"challenge_chain.new_sub_slot_iters",
|
|
177
|
-
uint64(10_000_000),
|
|
178
|
-
)
|
|
179
|
-
block_bad = recursive_replace(
|
|
180
|
-
block, "finished_sub_slots", [new_finished_ss, *block.finished_sub_slots[1:]]
|
|
181
|
-
)
|
|
182
|
-
header_block_bad = get_block_header(block_bad)
|
|
183
|
-
# TODO: Inspect these block values as they are currently None
|
|
184
|
-
expected_difficulty = block.finished_sub_slots[0].challenge_chain.new_difficulty or uint64(0)
|
|
185
|
-
expected_sub_slot_iters = block.finished_sub_slots[0].challenge_chain.new_sub_slot_iters or uint64(0)
|
|
186
|
-
expected_vs = ValidationState(expected_sub_slot_iters, expected_difficulty, None)
|
|
187
|
-
_, error = validate_finished_header_block(
|
|
188
|
-
empty_blockchain.constants, empty_blockchain, header_block_bad, False, expected_vs
|
|
189
|
-
)
|
|
190
|
-
assert error is not None
|
|
191
|
-
assert error.code == Err.INVALID_NEW_SUB_SLOT_ITERS
|
|
179
|
+
await _validate_and_add_block(empty_blockchain, block, fork_info=fork_info)
|
|
180
|
+
continue
|
|
192
181
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
empty_blockchain, block_bad, expected_result=AddBlockResult.INVALID_BLOCK, fork_info=fork_info
|
|
196
|
-
)
|
|
182
|
+
# TODO: deduplicate the test code, perhaps by parameterizing the
|
|
183
|
+
# test
|
|
197
184
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
)
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
185
|
+
# Sub/Epoch. Try using a bad ssi and difficulty to test 2m and 2n
|
|
186
|
+
new_finished_ss = recursive_replace(
|
|
187
|
+
block.finished_sub_slots[0],
|
|
188
|
+
"challenge_chain.new_sub_slot_iters",
|
|
189
|
+
uint64(10_000_000),
|
|
190
|
+
)
|
|
191
|
+
block_bad = recursive_replace(block, "finished_sub_slots", [new_finished_ss, *block.finished_sub_slots[1:]])
|
|
192
|
+
header_block_bad = get_block_header(block_bad)
|
|
193
|
+
# TODO: Inspect these block values as they are currently None
|
|
194
|
+
expected_difficulty = block.finished_sub_slots[0].challenge_chain.new_difficulty or uint64(0)
|
|
195
|
+
expected_sub_slot_iters = block.finished_sub_slots[0].challenge_chain.new_sub_slot_iters or uint64(0)
|
|
196
|
+
expected_vs = ValidationState(expected_sub_slot_iters, expected_difficulty, None)
|
|
197
|
+
_, error = validate_finished_header_block(
|
|
198
|
+
empty_blockchain.constants, empty_blockchain, header_block_bad, False, expected_vs
|
|
199
|
+
)
|
|
200
|
+
assert error is not None
|
|
201
|
+
assert error.code == Err.INVALID_NEW_SUB_SLOT_ITERS
|
|
206
202
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
expected_vs = ValidationState(expected_sub_slot_iters, expected_difficulty, None)
|
|
212
|
-
_, error = validate_finished_header_block(
|
|
213
|
-
empty_blockchain.constants, empty_blockchain, header_block_bad_2, False, expected_vs
|
|
214
|
-
)
|
|
215
|
-
assert error is not None
|
|
216
|
-
assert error.code == Err.INVALID_NEW_DIFFICULTY
|
|
203
|
+
# Also fails calling the outer methods, but potentially with a different error
|
|
204
|
+
await _validate_and_add_block(
|
|
205
|
+
empty_blockchain, block_bad, expected_result=AddBlockResult.INVALID_BLOCK, fork_info=fork_info
|
|
206
|
+
)
|
|
217
207
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
)
|
|
208
|
+
new_finished_ss = recursive_replace(
|
|
209
|
+
block.finished_sub_slots[0],
|
|
210
|
+
"challenge_chain.new_difficulty",
|
|
211
|
+
uint64(10_000_000),
|
|
212
|
+
)
|
|
213
|
+
block_bad = recursive_replace(block, "finished_sub_slots", [new_finished_ss, *block.finished_sub_slots[1:]])
|
|
214
|
+
|
|
215
|
+
header_block_bad = get_block_header(block_bad)
|
|
216
|
+
# TODO: Inspect these block values as they are currently None
|
|
217
|
+
expected_difficulty = block.finished_sub_slots[0].challenge_chain.new_difficulty or uint64(0)
|
|
218
|
+
expected_sub_slot_iters = block.finished_sub_slots[0].challenge_chain.new_sub_slot_iters or uint64(0)
|
|
219
|
+
expected_vs = ValidationState(expected_sub_slot_iters, expected_difficulty, None)
|
|
220
|
+
_, error = validate_finished_header_block(
|
|
221
|
+
empty_blockchain.constants, empty_blockchain, header_block_bad, False, expected_vs
|
|
222
|
+
)
|
|
223
|
+
assert error is not None
|
|
224
|
+
assert error.code == Err.INVALID_NEW_DIFFICULTY
|
|
222
225
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
bytes([0] * 32),
|
|
228
|
-
)
|
|
229
|
-
new_finished_ss_3 = recursive_replace(
|
|
230
|
-
new_finished_ss_3,
|
|
231
|
-
"reward_chain.challenge_chain_sub_slot_hash",
|
|
232
|
-
new_finished_ss_3.challenge_chain.get_hash(),
|
|
233
|
-
)
|
|
234
|
-
log.warning(f"Number of slots: {len(block.finished_sub_slots)}")
|
|
235
|
-
block_bad_3 = recursive_replace(block, "finished_sub_slots", [new_finished_ss_3])
|
|
226
|
+
# Also fails calling the outer methods, but potentially with a different error
|
|
227
|
+
await _validate_and_add_block(
|
|
228
|
+
empty_blockchain, block_bad, expected_result=AddBlockResult.INVALID_BLOCK, fork_info=fork_info
|
|
229
|
+
)
|
|
236
230
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
231
|
+
# 3c
|
|
232
|
+
new_finished_ss = recursive_replace(
|
|
233
|
+
block.finished_sub_slots[0],
|
|
234
|
+
"challenge_chain.subepoch_summary_hash",
|
|
235
|
+
bytes([0] * 32),
|
|
236
|
+
)
|
|
237
|
+
new_finished_ss = recursive_replace(
|
|
238
|
+
new_finished_ss,
|
|
239
|
+
"reward_chain.challenge_chain_sub_slot_hash",
|
|
240
|
+
new_finished_ss.challenge_chain.get_hash(),
|
|
241
|
+
)
|
|
242
|
+
log.warning(f"Number of slots: {len(block.finished_sub_slots)}")
|
|
243
|
+
block_bad = recursive_replace(block, "finished_sub_slots", [new_finished_ss])
|
|
244
|
+
|
|
245
|
+
header_block_bad = get_block_header(block_bad)
|
|
246
|
+
# TODO: Inspect these block values as they are currently None
|
|
247
|
+
expected_difficulty = block.finished_sub_slots[0].challenge_chain.new_difficulty or uint64(0)
|
|
248
|
+
expected_sub_slot_iters = block.finished_sub_slots[0].challenge_chain.new_sub_slot_iters or uint64(0)
|
|
249
|
+
expected_vs = ValidationState(expected_sub_slot_iters, expected_difficulty, None)
|
|
250
|
+
_, error = validate_finished_header_block(
|
|
251
|
+
empty_blockchain.constants, empty_blockchain, header_block_bad, False, expected_vs
|
|
252
|
+
)
|
|
253
|
+
assert error is not None
|
|
254
|
+
assert error.code == Err.INVALID_SUB_EPOCH_SUMMARY
|
|
247
255
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
256
|
+
# Also fails calling the outer methods, but potentially with a different error
|
|
257
|
+
await _validate_and_add_block(
|
|
258
|
+
empty_blockchain, block_bad, expected_result=AddBlockResult.INVALID_BLOCK, fork_info=fork_info
|
|
259
|
+
)
|
|
252
260
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
261
|
+
# 3d
|
|
262
|
+
new_finished_ss = recursive_replace(
|
|
263
|
+
block.finished_sub_slots[0],
|
|
264
|
+
"challenge_chain.subepoch_summary_hash",
|
|
265
|
+
std_hash(b"123"),
|
|
266
|
+
)
|
|
267
|
+
new_finished_ss = recursive_replace(
|
|
268
|
+
new_finished_ss,
|
|
269
|
+
"reward_chain.challenge_chain_sub_slot_hash",
|
|
270
|
+
new_finished_ss.challenge_chain.get_hash(),
|
|
271
|
+
)
|
|
272
|
+
block_bad = recursive_replace(block, "finished_sub_slots", [new_finished_ss])
|
|
273
|
+
|
|
274
|
+
header_block_bad = get_block_header(block_bad)
|
|
275
|
+
# TODO: Inspect these block values as they are currently None
|
|
276
|
+
expected_difficulty = block.finished_sub_slots[0].challenge_chain.new_difficulty or uint64(0)
|
|
277
|
+
expected_sub_slot_iters = block.finished_sub_slots[0].challenge_chain.new_sub_slot_iters or uint64(0)
|
|
278
|
+
expected_vs = ValidationState(expected_sub_slot_iters, expected_difficulty, None)
|
|
279
|
+
_, error = validate_finished_header_block(
|
|
280
|
+
empty_blockchain.constants, empty_blockchain, header_block_bad, False, expected_vs
|
|
281
|
+
)
|
|
282
|
+
assert error is not None
|
|
283
|
+
assert error.code == Err.INVALID_SUB_EPOCH_SUMMARY
|
|
265
284
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
expected_vs = ValidationState(expected_sub_slot_iters, expected_difficulty, None)
|
|
271
|
-
_, error = validate_finished_header_block(
|
|
272
|
-
empty_blockchain.constants, empty_blockchain, header_block_bad_4, False, expected_vs
|
|
273
|
-
)
|
|
274
|
-
assert error is not None
|
|
275
|
-
assert error.code == Err.INVALID_SUB_EPOCH_SUMMARY
|
|
285
|
+
# Also fails calling the outer methods, but potentially with a different error
|
|
286
|
+
await _validate_and_add_block(
|
|
287
|
+
empty_blockchain, block_bad, expected_result=AddBlockResult.INVALID_BLOCK, fork_info=fork_info
|
|
288
|
+
)
|
|
276
289
|
|
|
277
|
-
# Also fails calling the outer methods, but potentially with a different error
|
|
278
|
-
await _validate_and_add_block(
|
|
279
|
-
empty_blockchain, block_bad_4, expected_result=AddBlockResult.INVALID_BLOCK, fork_info=fork_info
|
|
280
|
-
)
|
|
281
290
|
await _validate_and_add_block(empty_blockchain, block, fork_info=fork_info)
|
|
282
291
|
log.info(
|
|
283
292
|
f"Added block {block.height} total iters {block.total_iters} new slot? {len(block.finished_sub_slots)}"
|
|
@@ -609,14 +618,16 @@ class TestBlockHeaderValidation:
|
|
|
609
618
|
async def do_test_invalid_icc_sub_slot_vdf(
|
|
610
619
|
self, keychain: Keychain, db_version: int, constants: ConsensusConstants
|
|
611
620
|
) -> None:
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
621
|
+
async with (
|
|
622
|
+
create_block_tools_async(
|
|
623
|
+
constants=constants.replace(
|
|
624
|
+
SUB_SLOT_ITERS_STARTING=uint64(2**12),
|
|
625
|
+
DIFFICULTY_STARTING=uint64(2**14),
|
|
626
|
+
),
|
|
627
|
+
keychain=keychain,
|
|
628
|
+
) as bt_high_iters,
|
|
629
|
+
create_blockchain(bt_high_iters.constants, db_version) as (bc1, _),
|
|
630
|
+
):
|
|
620
631
|
blocks = bt_high_iters.get_consecutive_blocks(10)
|
|
621
632
|
for block in blocks:
|
|
622
633
|
if (
|
|
@@ -1443,7 +1454,7 @@ class TestBlockHeaderValidation:
|
|
|
1443
1454
|
new_fsb_sig = bt.get_plot_signature(new_m, blocks[-1].reward_chain_block.proof_of_space.plot_public_key)
|
|
1444
1455
|
block_bad = recursive_replace(block_bad, "foliage.foliage_block_data_signature", new_fsb_sig)
|
|
1445
1456
|
await _validate_and_add_block(empty_blockchain, block_bad, expected_error=Err.INVALID_POOL_TARGET)
|
|
1446
|
-
return
|
|
1457
|
+
return
|
|
1447
1458
|
attempts += 1
|
|
1448
1459
|
|
|
1449
1460
|
@pytest.mark.anyio
|
|
@@ -1887,7 +1898,6 @@ class TestBodyValidation:
|
|
|
1887
1898
|
3,
|
|
1888
1899
|
guarantee_transaction_block=True,
|
|
1889
1900
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
1890
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
1891
1901
|
genesis_timestamp=uint64(10_000),
|
|
1892
1902
|
time_per_block=10,
|
|
1893
1903
|
)
|
|
@@ -1897,9 +1907,8 @@ class TestBodyValidation:
|
|
|
1897
1907
|
|
|
1898
1908
|
wt: WalletTool = bt.get_pool_wallet_tool()
|
|
1899
1909
|
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
)
|
|
1910
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
1911
|
+
tx1 = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin)
|
|
1903
1912
|
coin1: Coin = tx1.additions()[0]
|
|
1904
1913
|
|
|
1905
1914
|
if opcode == ConditionOpcode.ASSERT_MY_AMOUNT:
|
|
@@ -2036,7 +2045,6 @@ class TestBodyValidation:
|
|
|
2036
2045
|
3,
|
|
2037
2046
|
guarantee_transaction_block=True,
|
|
2038
2047
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
2039
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
2040
2048
|
genesis_timestamp=uint64(10_000),
|
|
2041
2049
|
time_per_block=10,
|
|
2042
2050
|
)
|
|
@@ -2047,7 +2055,7 @@ class TestBodyValidation:
|
|
|
2047
2055
|
|
|
2048
2056
|
conditions = {opcode: [ConditionWithArgs(opcode, [int_to_bytes(lock_value)])]}
|
|
2049
2057
|
|
|
2050
|
-
coin = blocks[-1].
|
|
2058
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
2051
2059
|
tx = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin, condition_dic=conditions)
|
|
2052
2060
|
|
|
2053
2061
|
blocks = bt.get_consecutive_blocks(
|
|
@@ -2107,7 +2115,6 @@ class TestBodyValidation:
|
|
|
2107
2115
|
3,
|
|
2108
2116
|
guarantee_transaction_block=True,
|
|
2109
2117
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
2110
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
2111
2118
|
genesis_timestamp=uint64(10_000),
|
|
2112
2119
|
time_per_block=10,
|
|
2113
2120
|
)
|
|
@@ -2117,9 +2124,8 @@ class TestBodyValidation:
|
|
|
2117
2124
|
|
|
2118
2125
|
wt: WalletTool = bt.get_pool_wallet_tool()
|
|
2119
2126
|
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
)
|
|
2127
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
2128
|
+
tx1 = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin)
|
|
2123
2129
|
coin1: Coin = tx1.additions()[0]
|
|
2124
2130
|
secret_key = wt.get_private_key_for_puzzle_hash(coin1.puzzle_hash)
|
|
2125
2131
|
synthetic_secret_key = calculate_synthetic_secret_key(secret_key, DEFAULT_HIDDEN_PUZZLE_HASH)
|
|
@@ -2237,7 +2243,6 @@ class TestBodyValidation:
|
|
|
2237
2243
|
3,
|
|
2238
2244
|
guarantee_transaction_block=True,
|
|
2239
2245
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
2240
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
2241
2246
|
genesis_timestamp=uint64(10_000),
|
|
2242
2247
|
time_per_block=10,
|
|
2243
2248
|
)
|
|
@@ -2251,9 +2256,8 @@ class TestBodyValidation:
|
|
|
2251
2256
|
opcode: [ConditionWithArgs(opcode, [int_to_bytes(lock_value)] + ([b"garbage"] if with_garbage else []))]
|
|
2252
2257
|
}
|
|
2253
2258
|
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
)
|
|
2259
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
2260
|
+
tx1 = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin)
|
|
2257
2261
|
coin1: Coin = tx1.additions()[0]
|
|
2258
2262
|
tx2 = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin1, condition_dic=conditions)
|
|
2259
2263
|
assert coin1 in tx2.removals()
|
|
@@ -2487,15 +2491,13 @@ class TestBodyValidation:
|
|
|
2487
2491
|
block_list_input=blocks,
|
|
2488
2492
|
guarantee_transaction_block=True,
|
|
2489
2493
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
2490
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
2491
2494
|
)
|
|
2492
2495
|
await _validate_and_add_block(b, blocks[2])
|
|
2493
2496
|
await _validate_and_add_block(b, blocks[3])
|
|
2494
2497
|
|
|
2495
2498
|
wt: WalletTool = bt.get_pool_wallet_tool()
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
)
|
|
2499
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
2500
|
+
tx = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin)
|
|
2499
2501
|
blocks = bt.get_consecutive_blocks(
|
|
2500
2502
|
1, block_list_input=blocks, guarantee_transaction_block=True, transaction_data=tx
|
|
2501
2503
|
)
|
|
@@ -2525,7 +2527,6 @@ class TestBodyValidation:
|
|
|
2525
2527
|
3,
|
|
2526
2528
|
guarantee_transaction_block=True,
|
|
2527
2529
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
2528
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
2529
2530
|
)
|
|
2530
2531
|
await _validate_and_add_block(b, blocks[0])
|
|
2531
2532
|
await _validate_and_add_block(b, blocks[1])
|
|
@@ -2557,9 +2558,8 @@ class TestBodyValidation:
|
|
|
2557
2558
|
# Hash should be correct when there is a ref list
|
|
2558
2559
|
await _validate_and_add_block(b, blocks[-1])
|
|
2559
2560
|
wt: WalletTool = bt.get_pool_wallet_tool()
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
)
|
|
2561
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
2562
|
+
tx = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin)
|
|
2563
2563
|
blocks = bt.get_consecutive_blocks(5, block_list_input=blocks, guarantee_transaction_block=False)
|
|
2564
2564
|
for block in blocks[-5:]:
|
|
2565
2565
|
await _validate_and_add_block(b, block)
|
|
@@ -2592,7 +2592,6 @@ class TestBodyValidation:
|
|
|
2592
2592
|
3,
|
|
2593
2593
|
guarantee_transaction_block=True,
|
|
2594
2594
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
2595
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
2596
2595
|
)
|
|
2597
2596
|
await _validate_and_add_block(b, blocks[0])
|
|
2598
2597
|
await _validate_and_add_block(b, blocks[1])
|
|
@@ -2605,9 +2604,8 @@ class TestBodyValidation:
|
|
|
2605
2604
|
output = ConditionWithArgs(ConditionOpcode.CREATE_COIN, [bt.pool_ph, int_to_bytes(i)])
|
|
2606
2605
|
condition_dict[ConditionOpcode.CREATE_COIN].append(output)
|
|
2607
2606
|
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
)
|
|
2607
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
2608
|
+
tx = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin, condition_dic=condition_dict)
|
|
2611
2609
|
|
|
2612
2610
|
blocks = bt.get_consecutive_blocks(
|
|
2613
2611
|
1, block_list_input=blocks, guarantee_transaction_block=True, transaction_data=tx
|
|
@@ -2663,7 +2661,6 @@ class TestBodyValidation:
|
|
|
2663
2661
|
3,
|
|
2664
2662
|
guarantee_transaction_block=True,
|
|
2665
2663
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
2666
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
2667
2664
|
)
|
|
2668
2665
|
await _validate_and_add_block(b, blocks[0])
|
|
2669
2666
|
await _validate_and_add_block(b, blocks[1])
|
|
@@ -2671,9 +2668,8 @@ class TestBodyValidation:
|
|
|
2671
2668
|
|
|
2672
2669
|
wt: WalletTool = bt.get_pool_wallet_tool()
|
|
2673
2670
|
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
)
|
|
2671
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
2672
|
+
tx = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin)
|
|
2677
2673
|
|
|
2678
2674
|
blocks = bt.get_consecutive_blocks(
|
|
2679
2675
|
1, block_list_input=blocks, guarantee_transaction_block=True, transaction_data=tx
|
|
@@ -2813,7 +2809,6 @@ class TestBodyValidation:
|
|
|
2813
2809
|
# 3,
|
|
2814
2810
|
# guarantee_transaction_block=True,
|
|
2815
2811
|
# farmer_reward_puzzle_hash=bt.pool_ph,
|
|
2816
|
-
# pool_reward_puzzle_hash=bt.pool_ph,
|
|
2817
2812
|
# )
|
|
2818
2813
|
# assert (await b.add_block(blocks[0]))[0] == AddBlockResult.NEW_PEAK
|
|
2819
2814
|
# assert (await b.add_block(blocks[1]))[0] == AddBlockResult.NEW_PEAK
|
|
@@ -2825,10 +2820,11 @@ class TestBodyValidation:
|
|
|
2825
2820
|
# output = ConditionWithArgs(ConditionOpcode.CREATE_COIN, [bt_2.pool_ph, int_to_bytes(2 ** 64)])
|
|
2826
2821
|
# condition_dict[ConditionOpcode.CREATE_COIN].append(output)
|
|
2827
2822
|
|
|
2823
|
+
# coin = find_reward_coin(blocks[1], bt.pool_ph)
|
|
2828
2824
|
# tx = wt.generate_signed_transaction_multiple_coins(
|
|
2829
2825
|
# uint64(10),
|
|
2830
2826
|
# wt.get_new_puzzlehash(),
|
|
2831
|
-
#
|
|
2827
|
+
# coin,
|
|
2832
2828
|
# condition_dic=condition_dict,
|
|
2833
2829
|
# )
|
|
2834
2830
|
# with pytest.raises(Exception):
|
|
@@ -2845,7 +2841,6 @@ class TestBodyValidation:
|
|
|
2845
2841
|
3,
|
|
2846
2842
|
guarantee_transaction_block=True,
|
|
2847
2843
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
2848
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
2849
2844
|
)
|
|
2850
2845
|
await _validate_and_add_block(empty_blockchain, blocks[0])
|
|
2851
2846
|
await _validate_and_add_block(empty_blockchain, blocks[1])
|
|
@@ -2853,9 +2848,8 @@ class TestBodyValidation:
|
|
|
2853
2848
|
|
|
2854
2849
|
wt: WalletTool = bt.get_pool_wallet_tool()
|
|
2855
2850
|
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
)
|
|
2851
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
2852
|
+
tx = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin)
|
|
2859
2853
|
|
|
2860
2854
|
blocks = bt.get_consecutive_blocks(
|
|
2861
2855
|
1, block_list_input=blocks, guarantee_transaction_block=True, transaction_data=tx
|
|
@@ -2896,7 +2890,6 @@ class TestBodyValidation:
|
|
|
2896
2890
|
3,
|
|
2897
2891
|
guarantee_transaction_block=True,
|
|
2898
2892
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
2899
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
2900
2893
|
)
|
|
2901
2894
|
await _validate_and_add_block(b, blocks[0])
|
|
2902
2895
|
await _validate_and_add_block(b, blocks[1])
|
|
@@ -2904,9 +2897,8 @@ class TestBodyValidation:
|
|
|
2904
2897
|
|
|
2905
2898
|
wt: WalletTool = bt.get_pool_wallet_tool()
|
|
2906
2899
|
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
)
|
|
2900
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
2901
|
+
tx = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin)
|
|
2910
2902
|
|
|
2911
2903
|
blocks = bt.get_consecutive_blocks(
|
|
2912
2904
|
1, block_list_input=blocks, guarantee_transaction_block=True, transaction_data=tx
|
|
@@ -2931,7 +2923,6 @@ class TestBodyValidation:
|
|
|
2931
2923
|
3,
|
|
2932
2924
|
guarantee_transaction_block=True,
|
|
2933
2925
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
2934
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
2935
2926
|
)
|
|
2936
2927
|
await _validate_and_add_block(b, blocks[0])
|
|
2937
2928
|
await _validate_and_add_block(b, blocks[1])
|
|
@@ -2944,9 +2935,8 @@ class TestBodyValidation:
|
|
|
2944
2935
|
output = ConditionWithArgs(ConditionOpcode.CREATE_COIN, [bt.pool_ph, int_to_bytes(1)])
|
|
2945
2936
|
condition_dict[ConditionOpcode.CREATE_COIN].append(output)
|
|
2946
2937
|
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
)
|
|
2938
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
2939
|
+
tx = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin, condition_dic=condition_dict)
|
|
2950
2940
|
|
|
2951
2941
|
blocks = bt.get_consecutive_blocks(
|
|
2952
2942
|
1, block_list_input=blocks, guarantee_transaction_block=True, transaction_data=tx
|
|
@@ -2961,7 +2951,6 @@ class TestBodyValidation:
|
|
|
2961
2951
|
3,
|
|
2962
2952
|
guarantee_transaction_block=True,
|
|
2963
2953
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
2964
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
2965
2954
|
)
|
|
2966
2955
|
await _validate_and_add_block(b, blocks[0])
|
|
2967
2956
|
await _validate_and_add_block(b, blocks[1])
|
|
@@ -2969,12 +2958,9 @@ class TestBodyValidation:
|
|
|
2969
2958
|
|
|
2970
2959
|
wt: WalletTool = bt.get_pool_wallet_tool()
|
|
2971
2960
|
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
)
|
|
2975
|
-
tx_2 = wt.generate_signed_transaction(
|
|
2976
|
-
uint64(11), wt.get_new_puzzlehash(), blocks[-1].get_included_reward_coins()[0]
|
|
2977
|
-
)
|
|
2961
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
2962
|
+
tx = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin)
|
|
2963
|
+
tx_2 = wt.generate_signed_transaction(uint64(11), wt.get_new_puzzlehash(), coin)
|
|
2978
2964
|
agg = SpendBundle.aggregate([tx, tx_2])
|
|
2979
2965
|
|
|
2980
2966
|
blocks = bt.get_consecutive_blocks(
|
|
@@ -2990,7 +2976,6 @@ class TestBodyValidation:
|
|
|
2990
2976
|
3,
|
|
2991
2977
|
guarantee_transaction_block=True,
|
|
2992
2978
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
2993
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
2994
2979
|
)
|
|
2995
2980
|
await _validate_and_add_block(b, blocks[0])
|
|
2996
2981
|
await _validate_and_add_block(b, blocks[1])
|
|
@@ -2998,9 +2983,8 @@ class TestBodyValidation:
|
|
|
2998
2983
|
|
|
2999
2984
|
wt: WalletTool = bt.get_pool_wallet_tool()
|
|
3000
2985
|
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
)
|
|
2986
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
2987
|
+
tx = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin)
|
|
3004
2988
|
|
|
3005
2989
|
blocks = bt.get_consecutive_blocks(
|
|
3006
2990
|
1, block_list_input=blocks, guarantee_transaction_block=True, transaction_data=tx
|
|
@@ -3024,7 +3008,6 @@ class TestBodyValidation:
|
|
|
3024
3008
|
3,
|
|
3025
3009
|
guarantee_transaction_block=True,
|
|
3026
3010
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
3027
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
3028
3011
|
)
|
|
3029
3012
|
await _validate_and_add_block(b, blocks[0])
|
|
3030
3013
|
await _validate_and_add_block(b, blocks[1])
|
|
@@ -3032,9 +3015,8 @@ class TestBodyValidation:
|
|
|
3032
3015
|
|
|
3033
3016
|
wt: WalletTool = bt.get_pool_wallet_tool()
|
|
3034
3017
|
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
)
|
|
3018
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
3019
|
+
tx = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin)
|
|
3038
3020
|
blocks = bt.get_consecutive_blocks(
|
|
3039
3021
|
1, block_list_input=blocks, guarantee_transaction_block=True, transaction_data=tx
|
|
3040
3022
|
)
|
|
@@ -3132,7 +3114,6 @@ class TestBodyValidation:
|
|
|
3132
3114
|
3,
|
|
3133
3115
|
guarantee_transaction_block=True,
|
|
3134
3116
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
3135
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
3136
3117
|
)
|
|
3137
3118
|
await _validate_and_add_block(b, blocks[0])
|
|
3138
3119
|
await _validate_and_add_block(b, blocks[1])
|
|
@@ -3140,7 +3121,7 @@ class TestBodyValidation:
|
|
|
3140
3121
|
|
|
3141
3122
|
wt: WalletTool = bt.get_pool_wallet_tool()
|
|
3142
3123
|
|
|
3143
|
-
spend = blocks[-1].
|
|
3124
|
+
spend = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
3144
3125
|
print("spend=", spend)
|
|
3145
3126
|
# this create coin will spend all of the coin, so the 10 mojos below
|
|
3146
3127
|
# will be "minted".
|
|
@@ -3168,7 +3149,6 @@ class TestBodyValidation:
|
|
|
3168
3149
|
3,
|
|
3169
3150
|
guarantee_transaction_block=True,
|
|
3170
3151
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
3171
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
3172
3152
|
)
|
|
3173
3153
|
await _validate_and_add_block(b, blocks[0])
|
|
3174
3154
|
await _validate_and_add_block(b, blocks[1])
|
|
@@ -3176,9 +3156,8 @@ class TestBodyValidation:
|
|
|
3176
3156
|
|
|
3177
3157
|
wt: WalletTool = bt.get_pool_wallet_tool()
|
|
3178
3158
|
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
)
|
|
3159
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
3160
|
+
tx = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin)
|
|
3182
3161
|
|
|
3183
3162
|
blocks = bt.get_consecutive_blocks(
|
|
3184
3163
|
1, block_list_input=blocks, guarantee_transaction_block=True, transaction_data=tx
|
|
@@ -3210,7 +3189,6 @@ class TestBodyValidation:
|
|
|
3210
3189
|
3,
|
|
3211
3190
|
guarantee_transaction_block=True,
|
|
3212
3191
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
3213
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
3214
3192
|
)
|
|
3215
3193
|
await _validate_and_add_block(b, blocks[0])
|
|
3216
3194
|
await _validate_and_add_block(b, blocks[1])
|
|
@@ -3218,9 +3196,8 @@ class TestBodyValidation:
|
|
|
3218
3196
|
|
|
3219
3197
|
wt: WalletTool = bt.get_pool_wallet_tool()
|
|
3220
3198
|
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
)
|
|
3199
|
+
coin = find_reward_coin(blocks[-1], bt.pool_ph)
|
|
3200
|
+
tx = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin)
|
|
3224
3201
|
blocks = bt.get_consecutive_blocks(
|
|
3225
3202
|
1, block_list_input=blocks, guarantee_transaction_block=True, transaction_data=tx
|
|
3226
3203
|
)
|
|
@@ -3257,7 +3234,7 @@ class TestBodyValidation:
|
|
|
3257
3234
|
assert preval_result.error == Err.BAD_AGGREGATE_SIGNATURE.value
|
|
3258
3235
|
|
|
3259
3236
|
|
|
3260
|
-
def maybe_header_hash(block:
|
|
3237
|
+
def maybe_header_hash(block: BlockRecord | None) -> bytes32 | None:
|
|
3261
3238
|
if block is None:
|
|
3262
3239
|
return None
|
|
3263
3240
|
return block.header_hash
|
|
@@ -3304,7 +3281,7 @@ class TestReorgs:
|
|
|
3304
3281
|
reorg_point = 12
|
|
3305
3282
|
blocks = bt.get_consecutive_blocks(reorg_point)
|
|
3306
3283
|
|
|
3307
|
-
last_tx_block:
|
|
3284
|
+
last_tx_block: bytes32 | None = None
|
|
3308
3285
|
for block in blocks:
|
|
3309
3286
|
assert maybe_header_hash(b.get_tx_peak()) == last_tx_block
|
|
3310
3287
|
await _validate_and_add_block(b, block)
|
|
@@ -3315,7 +3292,7 @@ class TestReorgs:
|
|
|
3315
3292
|
assert peak.height == reorg_point - 1
|
|
3316
3293
|
assert maybe_header_hash(b.get_tx_peak()) == last_tx_block
|
|
3317
3294
|
|
|
3318
|
-
reorg_last_tx_block:
|
|
3295
|
+
reorg_last_tx_block: bytes32 | None = None
|
|
3319
3296
|
fork_block = blocks[9]
|
|
3320
3297
|
fork_info = ForkInfo(fork_block.height, fork_block.height, fork_block.header_hash)
|
|
3321
3298
|
blocks_reorg_chain = bt.get_consecutive_blocks(7, blocks[:10], seed=b"2")
|
|
@@ -3613,16 +3590,14 @@ class TestReorgs:
|
|
|
3613
3590
|
blocks = bt.get_consecutive_blocks(
|
|
3614
3591
|
3,
|
|
3615
3592
|
guarantee_transaction_block=True,
|
|
3616
|
-
pool_reward_puzzle_hash=bt.pool_ph,
|
|
3617
3593
|
farmer_reward_puzzle_hash=bt.pool_ph,
|
|
3618
3594
|
)
|
|
3619
3595
|
await _validate_and_add_block(b, blocks[0])
|
|
3620
3596
|
await _validate_and_add_block(b, blocks[1])
|
|
3621
3597
|
await _validate_and_add_block(b, blocks[2])
|
|
3622
3598
|
wt: WalletTool = bt.get_pool_wallet_tool()
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
)
|
|
3599
|
+
coin = find_reward_coin(blocks[2], bt.pool_ph)
|
|
3600
|
+
tx = wt.generate_signed_transaction(uint64(10), wt.get_new_puzzlehash(), coin)
|
|
3626
3601
|
blocks = bt.get_consecutive_blocks(
|
|
3627
3602
|
1,
|
|
3628
3603
|
block_list_input=blocks,
|
|
@@ -4076,7 +4051,7 @@ async def test_get_tx_peak(default_400_blocks: list[FullBlock], empty_blockchain
|
|
|
4076
4051
|
assert bc.get_tx_peak() == last_tx_block_record
|
|
4077
4052
|
|
|
4078
4053
|
|
|
4079
|
-
def to_bytes(gen:
|
|
4054
|
+
def to_bytes(gen: SerializedProgram | None) -> bytes:
|
|
4080
4055
|
assert gen is not None
|
|
4081
4056
|
return bytes(gen)
|
|
4082
4057
|
|
|
@@ -4209,7 +4184,7 @@ async def get_fork_info(blockchain: Blockchain, block: FullBlock, peak: BlockRec
|
|
|
4209
4184
|
counter = 0
|
|
4210
4185
|
start = time.monotonic()
|
|
4211
4186
|
for height in range(fork_info.fork_height + 1, block.height):
|
|
4212
|
-
fork_block:
|
|
4187
|
+
fork_block: FullBlock | None = await blockchain.block_store.get_full_block(fork_chain[uint32(height)])
|
|
4213
4188
|
assert fork_block is not None
|
|
4214
4189
|
assert fork_block.height - 1 == fork_info.peak_height
|
|
4215
4190
|
assert fork_block.height == 0 or fork_block.prev_header_hash == fork_info.peak_hash
|