State: export predecessor_n
This commit is contained in:
parent
f8e69ac8f5
commit
d05dceb0b0
@ -541,6 +541,11 @@ module Block = struct
|
|||||||
read_exn net_state header.shell.predecessor >>= fun block ->
|
read_exn net_state header.shell.predecessor >>= fun block ->
|
||||||
Lwt.return (Some block)
|
Lwt.return (Some block)
|
||||||
|
|
||||||
|
let predecessor_n (net: Net.t) (b: Block_hash.t) (distance: int) : Block_hash.t option Lwt.t =
|
||||||
|
Shared.use net.block_store (fun store ->
|
||||||
|
predecessor_n store b distance)
|
||||||
|
|
||||||
|
|
||||||
type error += Inconsistent_hash of Context_hash.t * Context_hash.t
|
type error += Inconsistent_hash of Context_hash.t * Context_hash.t
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
|
@ -138,6 +138,7 @@ module Block : sig
|
|||||||
|
|
||||||
val is_genesis: t -> bool
|
val is_genesis: t -> bool
|
||||||
val predecessor: t -> block option Lwt.t
|
val predecessor: t -> block option Lwt.t
|
||||||
|
val predecessor_n: Net.t -> Block_hash.t -> int -> Block_hash.t option Lwt.t
|
||||||
|
|
||||||
val context: t -> Context.t Lwt.t
|
val context: t -> Context.t Lwt.t
|
||||||
val protocol_hash: t -> Protocol_hash.t Lwt.t
|
val protocol_hash: t -> Protocol_hash.t Lwt.t
|
||||||
|
Loading…
Reference in New Issue
Block a user