ligo/lib_embedded_protocol_alpha/src/nonce_storage.mli

44 lines
1.4 KiB
OCaml
Raw Normal View History

2016-09-08 21:13:10 +04:00
(**************************************************************************)
(* *)
2017-11-14 03:36:14 +04:00
(* Copyright (c) 2014 - 2017. *)
2016-09-08 21:13:10 +04:00
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
open Tezos_hash
type error +=
| Too_late_revelation
| Too_early_revelation
| Previously_revealed_nonce
| Unexpected_nonce
type t = Seed_repr.nonce
type nonce = t
val encoding: nonce Data_encoding.t
val record_hash:
Raw_context.t ->
Ed25519.Public_key_hash.t -> Tez_repr.t ->
Nonce_hash.t -> Raw_context.t tzresult Lwt.t
2016-09-08 21:13:10 +04:00
val reveal:
Raw_context.t -> Level_repr.t -> nonce ->
(Raw_context.t * Ed25519.Public_key_hash.t * Tez_repr.t) tzresult Lwt.t
2016-09-08 21:13:10 +04:00
type status =
| Unrevealed of {
nonce_hash: Tezos_hash.Nonce_hash.t ;
delegate_to_reward: Ed25519.Public_key_hash.t ;
2016-09-08 21:13:10 +04:00
reward_amount: Tez_repr.t ;
}
| Revealed of nonce
val get: Raw_context.t -> Level_repr.t -> status tzresult Lwt.t
2016-09-08 21:13:10 +04:00
val of_bytes: MBytes.t -> nonce tzresult
val hash: nonce -> Nonce_hash.t
val check_hash: nonce -> Nonce_hash.t -> bool