Skip to content

Commit d767eaa

Browse files
committed
Expose protocol_states_for_root_scan_state in transition frontier
1 parent 2185951 commit d767eaa

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

src/lib/transition_frontier/frontier_base/frontier_intf.ml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,11 @@ module type S = sig
4343
val precomputed_values : t -> Precomputed_values.t
4444

4545
val genesis_constants : t -> Genesis_constants.t
46+
47+
module Protocol_states_for_root_scan_state : sig
48+
type t
49+
end
50+
51+
val protocol_states_for_root_scan_state :
52+
t -> Protocol_states_for_root_scan_state.t
4653
end

src/lib/transition_frontier/full_frontier/full_frontier.mli

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ module type CONTEXT = sig
2424
val consensus_constants : Consensus.Constants.t
2525
end
2626

27-
include Frontier_intf.S
28-
2927
module Protocol_states_for_root_scan_state : sig
3028
type t = Protocol_state.value State_hash.With_state_hashes.t State_hash.Map.t
3129

@@ -36,6 +34,10 @@ module Protocol_states_for_root_scan_state : sig
3634
-> Protocol_state.value State_hash.With_state_hashes.t list
3735
end
3836

37+
include
38+
Frontier_intf.S
39+
with module Protocol_states_for_root_scan_state := Protocol_states_for_root_scan_state
40+
3941
val create :
4042
context:(module CONTEXT)
4143
-> root_data:Root_data.t
@@ -54,9 +56,6 @@ val root_data : t -> Root_data.t
5456

5557
val calculate_diffs : t -> Breadcrumb.t -> Diff.Full.E.t list
5658

57-
val protocol_states_for_root_scan_state :
58-
t -> Protocol_states_for_root_scan_state.t
59-
6059
val apply_diffs :
6160
t
6261
-> Diff.Full.E.t list

src/lib/transition_frontier/transition_frontier.ml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ open Mina_base
99
module Ledger = Mina_ledger.Ledger
1010
module Root_ledger = Mina_ledger.Root
1111
include Frontier_base
12-
module Full_frontier = Full_frontier
1312
module Extensions = Extensions
1413
module Persistent_root = Persistent_root
1514
module Persistent_frontier = Persistent_frontier
1615
module Catchup_state = Catchup_state
1716
module Full_catchup_tree = Full_catchup_tree
1817
module Catchup_hash_tree = Catchup_hash_tree
18+
module Util = Full_frontier.Util
1919

2020
module type CONTEXT = sig
2121
val logger : Logger.t
@@ -564,6 +564,12 @@ include struct
564564
(* why can't this one be proxied? *)
565565
let path_map ?max_length { full_frontier; _ } breadcrumb ~f =
566566
path_map ?max_length full_frontier breadcrumb ~f
567+
568+
module Protocol_states_for_root_scan_state =
569+
Protocol_states_for_root_scan_state
570+
571+
let protocol_states_for_root_scan_state =
572+
proxy1 protocol_states_for_root_scan_state
567573
end
568574

569575
module For_tests = struct

src/lib/transition_frontier/transition_frontier.mli

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module Catchup_state = Catchup_state
1818
module Full_catchup_tree = Full_catchup_tree
1919
module Catchup_hash_tree = Catchup_hash_tree
2020
module Root_ledger = Mina_ledger.Root
21+
module Util = Full_frontier.Util
2122

2223
module type CONTEXT = sig
2324
val logger : Logger.t
@@ -33,7 +34,10 @@ module type CONTEXT = sig
3334
val signature_kind : Mina_signature_kind.t
3435
end
3536

36-
include Frontier_intf.S
37+
include
38+
Frontier_intf.S
39+
with module Protocol_states_for_root_scan_state := Full_frontier
40+
.Protocol_states_for_root_scan_state
3741

3842
type Structured_log_events.t += Added_breadcrumb_user_commands
3943
[@@deriving register_event]

0 commit comments

Comments
 (0)