92
92
from chia_rs .sized_ints import uint128
93
93
94
94
from chia ._tests .environments .wallet import WalletEnvironment , WalletState , WalletTestFramework
95
- from chia ._tests .util .setup_nodes import setup_farmer_multi_harvester
95
+ from chia ._tests .util .setup_nodes import setup_farmer_solver_multi_harvester
96
96
from chia .full_node .full_node_rpc_client import FullNodeRpcClient
97
97
from chia .simulator .block_tools import BlockTools , create_block_tools_async , test_constants
98
98
from chia .simulator .keyring import TempKeyring
@@ -866,7 +866,7 @@ async def farmer_one_harvester_simulator_wallet(
866
866
]
867
867
]:
868
868
async with setup_simulators_and_wallets_service (1 , 1 , blockchain_constants ) as (nodes , wallets , bt ):
869
- async with setup_farmer_multi_harvester (bt , 1 , tmp_path , bt .constants , start_services = True ) as (
869
+ async with setup_farmer_solver_multi_harvester (bt , 1 , tmp_path , bt .constants , start_services = True ) as (
870
870
harvester_services ,
871
871
farmer_service ,
872
872
_ ,
@@ -879,7 +879,9 @@ async def farmer_one_harvester_simulator_wallet(
879
879
880
880
@pytest .fixture (scope = "function" )
881
881
async def farmer_one_harvester (tmp_path : Path , get_b_tools : BlockTools ) -> AsyncIterator [FarmerOneHarvester ]:
882
- async with setup_farmer_multi_harvester (get_b_tools , 1 , tmp_path , get_b_tools .constants , start_services = True ) as _ :
882
+ async with setup_farmer_solver_multi_harvester (
883
+ get_b_tools , 1 , tmp_path , get_b_tools .constants , start_services = True
884
+ ) as _ :
883
885
yield _
884
886
885
887
@@ -890,37 +892,41 @@ async def farmer_one_harvester(tmp_path: Path, get_b_tools: BlockTools) -> Async
890
892
async def farmer_one_harvester_solver (
891
893
tmp_path : Path , get_b_tools : BlockTools
892
894
) -> AsyncIterator [FarmerOneHarvesterSolver ]:
893
- async with setup_farmer_multi_harvester (get_b_tools , 1 , tmp_path , get_b_tools .constants , start_services = True ) as (
894
- harvester_services ,
895
- farmer_service ,
896
- bt ,
897
- ):
898
- farmer_peer = UnresolvedPeerInfo (bt .config ["self_hostname" ], farmer_service ._server .get_port ())
899
- async with setup_solver (tmp_path / "solver" , bt , bt .constants , farmer_peer = farmer_peer ) as solver_service :
895
+ async with setup_solver (tmp_path / "solver" , get_b_tools , get_b_tools .constants ) as solver_service :
896
+ solver_peer = UnresolvedPeerInfo (get_b_tools .config ["self_hostname" ], solver_service ._server .get_port ())
897
+ async with setup_farmer_solver_multi_harvester (
898
+ get_b_tools , 1 , tmp_path , get_b_tools .constants , start_services = True , solver_peer = solver_peer
899
+ ) as (harvester_services , farmer_service , bt ):
900
900
yield harvester_services , farmer_service , solver_service , bt
901
901
902
902
903
903
@pytest .fixture (scope = "function" )
904
904
async def farmer_one_harvester_not_started (
905
905
tmp_path : Path , get_b_tools : BlockTools
906
906
) -> AsyncIterator [tuple [list [HarvesterService ], FarmerService , BlockTools ]]:
907
- async with setup_farmer_multi_harvester (get_b_tools , 1 , tmp_path , get_b_tools .constants , start_services = False ) as _ :
907
+ async with setup_farmer_solver_multi_harvester (
908
+ get_b_tools , 1 , tmp_path , get_b_tools .constants , start_services = False
909
+ ) as _ :
908
910
yield _
909
911
910
912
911
913
@pytest .fixture (scope = "function" )
912
914
async def farmer_two_harvester_not_started (
913
915
tmp_path : Path , get_b_tools : BlockTools
914
916
) -> AsyncIterator [tuple [list [HarvesterService ], FarmerService , BlockTools ]]:
915
- async with setup_farmer_multi_harvester (get_b_tools , 2 , tmp_path , get_b_tools .constants , start_services = False ) as _ :
917
+ async with setup_farmer_solver_multi_harvester (
918
+ get_b_tools , 2 , tmp_path , get_b_tools .constants , start_services = False
919
+ ) as _ :
916
920
yield _
917
921
918
922
919
923
@pytest .fixture (scope = "function" )
920
924
async def farmer_three_harvester_not_started (
921
925
tmp_path : Path , get_b_tools : BlockTools
922
926
) -> AsyncIterator [tuple [list [HarvesterService ], FarmerService , BlockTools ]]:
923
- async with setup_farmer_multi_harvester (get_b_tools , 3 , tmp_path , get_b_tools .constants , start_services = False ) as _ :
927
+ async with setup_farmer_solver_multi_harvester (
928
+ get_b_tools , 3 , tmp_path , get_b_tools .constants , start_services = False
929
+ ) as _ :
924
930
yield _
925
931
926
932
@@ -1301,10 +1307,13 @@ async def farmer_harvester_2_simulators_zero_bits_plot_filter(
1301
1307
)
1302
1308
for index in range (len (bts ))
1303
1309
]
1304
-
1305
- [harvester_service ], farmer_service , _ = await async_exit_stack .enter_async_context (
1306
- setup_farmer_multi_harvester (bt , 1 , tmp_path , bt .constants , start_services = True )
1307
- )
1310
+ async with setup_solver (tmp_path / "solver" , bt , bt .constants ) as solver_service :
1311
+ solver_peer = UnresolvedPeerInfo (bt .config ["self_hostname" ], solver_service ._server .get_port ())
1312
+ [harvester_service ], farmer_service , _ = await async_exit_stack .enter_async_context (
1313
+ setup_farmer_solver_multi_harvester (
1314
+ bt , 1 , tmp_path , bt .constants , start_services = True , solver_peer = solver_peer
1315
+ )
1316
+ )
1308
1317
1309
1318
yield farmer_service , harvester_service , simulators [0 ], simulators [1 ], bt
1310
1319
0 commit comments