Alpha: minor cosmetic changes
This commit is contained in:
parent
a873930a09
commit
43fe4dbdc3
@ -33,17 +33,17 @@ let get_unrevealed c level =
|
|||||||
| Revealed _ -> fail Previously_revealed_nonce
|
| Revealed _ -> fail Previously_revealed_nonce
|
||||||
| Unrevealed status -> return status
|
| Unrevealed status -> return status
|
||||||
|
|
||||||
let record_hash c unrevealed =
|
let record_hash ctxt unrevealed =
|
||||||
let level = Level_storage.current c in
|
let level = Level_storage.current ctxt in
|
||||||
Storage.Seed.Nonce.init c level (Unrevealed unrevealed)
|
Storage.Seed.Nonce.init ctxt level (Unrevealed unrevealed)
|
||||||
|
|
||||||
let reveal c level nonce =
|
let reveal ctxt level nonce =
|
||||||
get_unrevealed c level >>=? fun unrevealed ->
|
get_unrevealed ctxt level >>=? fun unrevealed ->
|
||||||
fail_unless
|
fail_unless
|
||||||
(Seed_repr.check_hash nonce unrevealed.nonce_hash)
|
(Seed_repr.check_hash nonce unrevealed.nonce_hash)
|
||||||
Unexpected_nonce >>=? fun () ->
|
Unexpected_nonce >>=? fun () ->
|
||||||
Storage.Seed.Nonce.set c level (Revealed nonce) >>=? fun c ->
|
Storage.Seed.Nonce.set ctxt level (Revealed nonce) >>=? fun ctxt ->
|
||||||
return c
|
return ctxt
|
||||||
|
|
||||||
type unrevealed = Storage.Seed.unrevealed_nonce = {
|
type unrevealed = Storage.Seed.unrevealed_nonce = {
|
||||||
nonce_hash: Nonce_hash.t ;
|
nonce_hash: Nonce_hash.t ;
|
||||||
@ -57,7 +57,7 @@ type status = Storage.Seed.nonce_status =
|
|||||||
| Unrevealed of unrevealed
|
| Unrevealed of unrevealed
|
||||||
| Revealed of Seed_repr.nonce
|
| Revealed of Seed_repr.nonce
|
||||||
|
|
||||||
let get c level = Storage.Seed.Nonce.get c level
|
let get = Storage.Seed.Nonce.get
|
||||||
|
|
||||||
let of_bytes = Seed_repr.make_nonce
|
let of_bytes = Seed_repr.make_nonce
|
||||||
let hash = Seed_repr.hash
|
let hash = Seed_repr.hash
|
||||||
|
Loading…
Reference in New Issue
Block a user