2016-09-08 21:13:10 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* Copyright (c) 2014 - 2016. *)
|
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
|
|
|
type t = Storage.t
|
|
|
|
type context = t
|
|
|
|
|
|
|
|
module type BASIC_DATA = sig
|
|
|
|
type t
|
|
|
|
include Compare.S with type t := t
|
|
|
|
val encoding: t Data_encoding.t
|
|
|
|
val pp: Format.formatter -> t -> unit
|
|
|
|
end
|
|
|
|
|
|
|
|
module Tez = Tez_repr
|
|
|
|
module Period = Period_repr
|
2017-03-03 16:05:20 +04:00
|
|
|
|
2016-09-08 21:13:10 +04:00
|
|
|
module Timestamp = struct
|
|
|
|
include Time_repr
|
2017-04-10 14:14:11 +04:00
|
|
|
let current = Storage.current_timestamp
|
2016-09-08 21:13:10 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
include Operation_repr
|
2017-04-19 21:21:23 +04:00
|
|
|
module Operation = struct
|
|
|
|
type t = operation
|
|
|
|
include Operation_repr
|
|
|
|
end
|
2017-04-20 17:21:10 +04:00
|
|
|
module Block_header = Block_header_repr
|
2016-09-08 21:13:10 +04:00
|
|
|
module Vote = struct
|
|
|
|
include Vote_repr
|
|
|
|
include Vote_storage
|
|
|
|
end
|
|
|
|
module Raw_level = Raw_level_repr
|
|
|
|
module Cycle = Cycle_repr
|
|
|
|
module Script_int = Script_int_repr
|
|
|
|
module Script = Script_repr
|
|
|
|
|
2017-02-28 05:56:40 +04:00
|
|
|
type public_key = Ed25519.Public_key.t
|
2016-11-14 18:54:21 +04:00
|
|
|
type public_key_hash = Ed25519.Public_key_hash.t
|
2017-02-28 05:56:40 +04:00
|
|
|
type secret_key = Ed25519.Secret_key.t
|
|
|
|
type signature = Ed25519.Signature.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
include Tezos_hash
|
|
|
|
|
|
|
|
module Constants = struct
|
|
|
|
include Constants_repr
|
|
|
|
let cycle_length c =
|
|
|
|
let constants = Storage.constants c in
|
|
|
|
constants.cycle_length
|
|
|
|
let voting_period_length c =
|
|
|
|
let constants = Storage.constants c in
|
|
|
|
constants.voting_period_length
|
|
|
|
let time_before_reward c =
|
|
|
|
let constants = Storage.constants c in
|
|
|
|
constants.time_before_reward
|
2017-02-24 21:32:30 +04:00
|
|
|
let slot_durations c =
|
2016-09-08 21:13:10 +04:00
|
|
|
let constants = Storage.constants c in
|
2017-02-24 21:32:30 +04:00
|
|
|
constants.slot_durations
|
2016-09-08 21:13:10 +04:00
|
|
|
let first_free_mining_slot c =
|
|
|
|
let constants = Storage.constants c in
|
|
|
|
constants.first_free_mining_slot
|
|
|
|
let max_signing_slot c =
|
|
|
|
let constants = Storage.constants c in
|
|
|
|
constants.max_signing_slot
|
|
|
|
let instructions_per_transaction c =
|
|
|
|
let constants = Storage.constants c in
|
|
|
|
constants.instructions_per_transaction
|
|
|
|
let proof_of_work_threshold c =
|
|
|
|
let constants = Storage.constants c in
|
|
|
|
constants.proof_of_work_threshold
|
2017-02-27 21:24:26 +04:00
|
|
|
let dictator_pubkey c =
|
|
|
|
let constants = Storage.constants c in
|
|
|
|
constants.dictator_pubkey
|
2016-09-08 21:13:10 +04:00
|
|
|
end
|
|
|
|
|
2017-03-15 21:00:27 +04:00
|
|
|
module Public_key = Public_key_storage
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
module Voting_period = Voting_period_repr
|
|
|
|
|
|
|
|
module Level = struct
|
|
|
|
include Level_repr
|
|
|
|
include Level_storage
|
|
|
|
end
|
|
|
|
module Contract = struct
|
|
|
|
include Contract_repr
|
|
|
|
include Contract_storage
|
|
|
|
end
|
|
|
|
module Roll = struct
|
|
|
|
include Roll_repr
|
|
|
|
include Roll_storage
|
|
|
|
end
|
|
|
|
module Nonce = Nonce_storage
|
|
|
|
module Seed = struct
|
|
|
|
include Seed_repr
|
|
|
|
include Seed_storage
|
|
|
|
end
|
|
|
|
module Bootstrap = Bootstrap_storage
|
|
|
|
module Reward = Reward_storage
|
|
|
|
|
|
|
|
module Fitness = struct
|
|
|
|
|
|
|
|
include Fitness_repr
|
|
|
|
include Fitness
|
2017-04-19 21:21:23 +04:00
|
|
|
type fitness = t
|
2016-09-08 21:13:10 +04:00
|
|
|
include Fitness_storage
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
let init = Init_storage.may_initialize
|
2017-03-03 16:05:20 +04:00
|
|
|
|
2017-04-10 14:14:11 +04:00
|
|
|
let finalize ?commit_message:message c =
|
|
|
|
let fitness = Fitness.from_int64 (Fitness.current c) in
|
|
|
|
let context = Storage.recover c in
|
|
|
|
{ Updater.context ; fitness ; message }
|
2017-03-03 16:05:20 +04:00
|
|
|
|
2016-09-08 21:13:10 +04:00
|
|
|
let configure_sandbox = Init_storage.configure_sandbox
|
|
|
|
|
|
|
|
let activate = Storage.activate
|
|
|
|
let fork_test_network = Storage.fork_test_network
|