1717from chia ._tests .util .time_out_assert import time_out_assert
1818from chia .cmds .cmds_util import get_any_service_client
1919from chia .farmer .farmer import Farmer
20+ from chia .farmer .farmer_api import serialize
2021from chia .farmer .farmer_service import FarmerService
2122from chia .harvester .harvester_rpc_client import HarvesterRpcClient
2223from chia .harvester .harvester_service import HarvesterService
@@ -338,7 +339,7 @@ async def test_v2_partial_proofs_new_sp_hash(
338339 challenge_hash = bytes32 (b"2" * 32 ),
339340 sp_hash = sp_hash ,
340341 plot_identifier = "test_plot_id" ,
341- partial_proofs = [[uint64 (1 ), uint64 (2 ), uint64 (3 ), uint64 (4 )]],
342+ partial_proofs = [[uint64 (100 ), uint64 (200 ), uint64 (300 ), uint64 (400 )]],
342343 signage_point_index = uint8 (0 ),
343344 plot_size = uint8 (32 ),
344345 strength = uint8 (5 ),
@@ -369,7 +370,7 @@ async def test_v2_partial_proofs_missing_sp_hash(
369370 challenge_hash = bytes32 (b"2" * 32 ),
370371 sp_hash = sp_hash ,
371372 plot_identifier = "test_plot_id" ,
372- partial_proofs = [[uint64 (1 ), uint64 (2 ), uint64 (3 ), uint64 (4 )]],
373+ partial_proofs = [[uint64 (100 ), uint64 (200 ), uint64 (300 ), uint64 (400 )]],
373374 signage_point_index = uint8 (0 ),
374375 plot_size = uint8 (32 ),
375376 plot_id = bytes32 .fromhex ("abababababababababababababababababababababababababababababababab" ),
@@ -413,7 +414,10 @@ async def test_v2_partial_proofs_with_existing_sp(
413414 challenge_hash = challenge_hash ,
414415 sp_hash = sp_hash ,
415416 plot_identifier = "test_plot_id" ,
416- partial_proofs = [[uint64 (1 ), uint64 (2 ), uint64 (3 ), uint64 (4 )], [uint64 (2 ), uint64 (3 ), uint64 (4 ), uint64 (5 )]],
417+ partial_proofs = [
418+ [uint64 (100 ), uint64 (200 ), uint64 (300 ), uint64 (400 )],
419+ [uint64 (2222 ), uint64 (3333 ), uint64 (4444 ), uint64 (5555 )],
420+ ],
417421 signage_point_index = uint8 (0 ),
418422 plot_size = uint8 (32 ),
419423 plot_id = bytes32 .fromhex ("abababababababababababababababababababababababababababababababab" ),
@@ -447,7 +451,7 @@ async def test_solution_response_handler(
447451 challenge_hash = challenge_hash ,
448452 sp_hash = sp_hash ,
449453 plot_identifier = "test_plot_id" ,
450- partial_proofs = [[uint64 (1 ), uint64 (2 ), uint64 (3 ), uint64 (4 )]],
454+ partial_proofs = [[uint64 (1111 ), uint64 (2222 ), uint64 (3333 ), uint64 (4444 )]],
451455 signage_point_index = uint8 (0 ),
452456 plot_size = uint8 (32 ),
453457 plot_id = bytes32 .fromhex ("abababababababababababababababababababababababababababababababab" ),
@@ -460,7 +464,7 @@ async def test_solution_response_handler(
460464 harvester_peer = await get_harvester_peer (farmer )
461465
462466 # manually add pending request
463- key = bytes (partial_proofs .partial_proofs [0 ])
467+ key = serialize (partial_proofs .partial_proofs [0 ])
464468 farmer .pending_solver_requests [key ] = {
465469 "proof_data" : partial_proofs ,
466470 "peer" : harvester_peer ,
@@ -486,7 +490,7 @@ async def test_solution_response_handler(
486490 assert original_peer == harvester_peer
487491
488492 # verify pending request was removed
489- key = bytes (partial_proofs .partial_proofs [0 ])
493+ key = serialize (partial_proofs .partial_proofs [0 ])
490494 assert key not in farmer .pending_solver_requests
491495
492496
@@ -530,7 +534,10 @@ async def test_solution_response_empty_proof(
530534 challenge_hash = challenge_hash ,
531535 sp_hash = sp_hash ,
532536 plot_identifier = "test_plot_id" ,
533- partial_proofs = [[uint64 (1 ), uint64 (2 ), uint64 (3 ), uint64 (4 )], [uint64 (2 ), uint64 (3 ), uint64 (4 ), uint64 (5 )]],
537+ partial_proofs = [
538+ [uint64 (100 ), uint64 (200 ), uint64 (300 ), uint64 (400 )],
539+ [uint64 (2222 ), uint64 (3333 ), uint64 (4444 ), uint64 (5555 )],
540+ ],
534541 signage_point_index = uint8 (0 ),
535542 plot_size = uint8 (32 ),
536543 plot_id = bytes32 .fromhex ("abababababababababababababababababababababababababababababababab" ),
@@ -544,7 +551,7 @@ async def test_solution_response_empty_proof(
544551 harvester_peer .peer_node_id = "harvester_peer"
545552
546553 # manually add pending request
547- key = bytes (partial_proofs .partial_proofs [0 ])
554+ key = serialize (partial_proofs .partial_proofs [0 ])
548555 farmer .pending_solver_requests [key ] = {
549556 "proof_data" : partial_proofs ,
550557 "peer" : harvester_peer ,
@@ -563,7 +570,7 @@ async def test_solution_response_empty_proof(
563570 mock_new_proof .assert_not_called ()
564571
565572 # verify pending request was removed (cleanup still happens)
566- key = bytes (partial_proofs .partial_proofs [0 ])
573+ key = serialize (partial_proofs .partial_proofs [0 ])
567574 assert key not in farmer .pending_solver_requests
568575
569576
@@ -595,7 +602,10 @@ async def test_v2_partial_proofs_solver_exception(
595602 challenge_hash = challenge_hash ,
596603 sp_hash = sp_hash ,
597604 plot_identifier = "test_plot_id" ,
598- partial_proofs = [[uint64 (1 ), uint64 (2 ), uint64 (3 ), uint64 (4 )], [uint64 (2 ), uint64 (3 ), uint64 (4 ), uint64 (5 )]],
605+ partial_proofs = [
606+ [uint64 (100 ), uint64 (200 ), uint64 (300 ), uint64 (400 )],
607+ [uint64 (2222 ), uint64 (3333 ), uint64 (4444 ), uint64 (5555 )],
608+ ],
599609 signage_point_index = uint8 (0 ),
600610 plot_size = uint8 (32 ),
601611 plot_id = bytes32 .fromhex ("abababababababababababababababababababababababababababababababab" ),
@@ -612,5 +622,5 @@ async def test_v2_partial_proofs_solver_exception(
612622 await farmer_api .partial_proofs (partial_proofs , harvester_peer )
613623
614624 # verify pending request was cleaned up after exception
615- key = bytes (partial_proofs .partial_proofs [0 ])
625+ key = serialize (partial_proofs .partial_proofs [0 ])
616626 assert key not in farmer .pending_solver_requests
0 commit comments