Storage: added a dedicated store for predecessors under /block/

This commit is contained in:
Marco Stronati 2018-01-22 18:16:26 +01:00 committed by Benjamin Canou
parent 3be9928e54
commit eaf2103967
2 changed files with 18 additions and 0 deletions

View File

@ -176,6 +176,14 @@ module Block = struct
end end
end end
module Predecessors =
Store_helpers.Make_map
(Store_helpers.Make_substore
(Indexed_store.Store)
(struct let name = ["predecessors"] end))
(Store_helpers.Integer_index)
(Store_helpers.Make_value(Block_hash))
end end

View File

@ -121,6 +121,16 @@ module Block : sig
and type key = Block_hash.t and type key = Block_hash.t
and type value = invalid_block and type value = invalid_block
(**
Block predecessors under
[/blocks/<block_id>/predecessors/<distance>/<block_id>].
Used to compute block predecessors in [lib_node_shell/state.ml].
*)
module Predecessors : MAP_STORE
with type t = store * Block_hash.t
and type key = int
and type value = Block_hash.t
end end