@@ -458,8 +458,9 @@ module Proof_with_metric = struct
458
458
end
459
459
460
460
let construct_selector_result
461
- ~(instances : (Selector.Single.Spec.t * Proof_with_metric.t) One_or_two.t )
462
- ~fee ~prover =
461
+ ~(instances :
462
+ (_ Work.Single.Spec.t * _ Proof_with_metric.Poly.t) One_or_two.t ) ~fee
463
+ ~prover =
463
464
let proofs = One_or_two. map ~f: (fun (_ , { proof; _ } ) -> proof) instances in
464
465
let metrics =
465
466
One_or_two. map
@@ -476,7 +477,8 @@ let construct_selector_result
476
477
in
477
478
478
479
let instances = One_or_two. map ~f: (fun (single , _ ) -> single) instances in
479
- ({ proofs; metrics; spec = { instances; fee }; prover } : Selector.Result.t )
480
+ ( { proofs; metrics; spec = ({ instances; fee } : _ Work.Spec.t ); prover }
481
+ : _ Work.Result. t )
480
482
481
483
module Result = struct
482
484
module Poly = struct
@@ -542,6 +544,9 @@ module Result = struct
542
544
None
543
545
end
544
546
end ]
547
+
548
+ [%% define_locally
549
+ Stable.Latest. (to_spec, of_selector_result, to_selector_result)]
545
550
end
546
551
547
552
[%% versioned
@@ -550,53 +555,37 @@ module Result = struct
550
555
551
556
module V1 = struct
552
557
type t =
553
- { data :
554
- ( Transaction_witness.Stable.V2 .t
555
- , Transaction_snark.Zkapp_command_segment.Witness.Stable.V1 .t
556
- , Ledger_proof.Stable.V2 .t
557
- , Proof_with_metric.Stable.V1 .t )
558
- Spec.Poly.Stable.V1 .t
559
- ; prover : Signature_lib.Public_key.Compressed.Stable.V1 .t
560
- }
558
+ ( Transaction_witness.Stable.V2 .t
559
+ , Transaction_snark.Zkapp_command_segment.Witness.Stable.V1 .t
560
+ , Ledger_proof.Stable.V2 .t
561
+ , Proof_with_metric.Stable.V1 .t )
562
+ Poly.Stable.V1 .t
561
563
562
564
let to_latest = Fn. id
563
565
end
564
566
end ]
565
567
566
568
type t =
567
- { data :
568
- ( Transaction_witness .t
569
- , Transaction_snark.Zkapp_command_segment.Witness .t
570
- , Ledger_proof.Cached .t
571
- , Proof_with_metric .t )
572
- Spec.Poly .t
573
- ; prover : Signature_lib.Public_key.Compressed .t
574
- }
575
-
576
- let read_all_proofs_from_disk ({ data; prover } : t ) : Stable.Latest.t =
577
- let data =
578
- Spec.Poly. map ~f_witness: Transaction_witness. read_all_proofs_from_disk
579
- ~f_zkapp_command_segment_witness:
580
- Transaction_witness. Zkapp_command_segment_witness
581
- .read_all_proofs_from_disk
582
- ~f_proof: Ledger_proof.Cached. read_proof_from_disk
583
- ~f_metric: Proof_with_metric. read_all_proofs_from_disk data
584
- in
585
-
586
- { data; prover }
569
+ ( Transaction_witness .t
570
+ , Transaction_snark.Zkapp_command_segment.Witness .t
571
+ , Ledger_proof.Cached .t
572
+ , Proof_with_metric .t )
573
+ Poly .t
587
574
588
- let write_all_proofs_to_disk ~proof_cache_db
589
- ({ data; prover } : Stable.Latest.t ) : t =
590
- let data =
591
- Spec.Poly. map
592
- ~f_witness:
593
- (Transaction_witness. write_all_proofs_to_disk ~proof_cache_db )
594
- ~f_zkapp_command_segment_witness:
595
- (Transaction_witness. Zkapp_command_segment_witness
596
- .write_all_proofs_to_disk ~proof_cache_db )
597
- ~f_proof: (Ledger_proof.Cached. write_proof_to_disk ~proof_cache_db )
598
- ~f_metric: (Proof_with_metric. write_all_proofs_to_disk ~proof_cache_db )
599
- data
600
- in
601
- { data; prover }
575
+ let read_all_proofs_from_disk =
576
+ Spec.Poly. map ~f_witness: Transaction_witness. read_all_proofs_from_disk
577
+ ~f_zkapp_command_segment_witness:
578
+ Transaction_witness. Zkapp_command_segment_witness
579
+ .read_all_proofs_from_disk
580
+ ~f_proof: Ledger_proof.Cached. read_proof_from_disk
581
+ ~f_metric: Proof_with_metric. read_all_proofs_from_disk
582
+
583
+ let write_all_proofs_to_disk ~proof_cache_db =
584
+ Spec.Poly. map
585
+ ~f_witness: (Transaction_witness. write_all_proofs_to_disk ~proof_cache_db )
586
+ ~f_zkapp_command_segment_witness:
587
+ (Transaction_witness. Zkapp_command_segment_witness
588
+ .write_all_proofs_to_disk ~proof_cache_db )
589
+ ~f_proof: (Ledger_proof.Cached. write_proof_to_disk ~proof_cache_db )
590
+ ~f_metric: (Proof_with_metric. write_all_proofs_to_disk ~proof_cache_db )
602
591
end
0 commit comments