Alpha: add Constants_storage

This commit is contained in:
Grégoire Henry 2018-02-23 12:43:53 -05:00 committed by Benjamin Canou
parent bd721b1085
commit cd5ac0a27d
3 changed files with 50 additions and 36 deletions

View File

@ -34,6 +34,7 @@
"Storage_functors",
"Storage",
"Constants_storage",
"Level_storage",
"Nonce_storage",
"Seed_storage",

View File

@ -56,42 +56,7 @@ type signature = Ed25519.Signature.t
module Constants = struct
include Constants_repr
let cycle_length c =
let constants = Raw_context.constants c in
constants.cycle_length
let voting_period_length c =
let constants = Raw_context.constants c in
constants.voting_period_length
let time_before_reward c =
let constants = Raw_context.constants c in
constants.time_before_reward
let slot_durations c =
let constants = Raw_context.constants c in
constants.slot_durations
let first_free_baking_slot c =
let constants = Raw_context.constants c in
constants.first_free_baking_slot
let max_signing_slot c =
let constants = Raw_context.constants c in
constants.max_signing_slot
let max_gas c =
let constants = Raw_context.constants c in
constants.max_gas
let proof_of_work_threshold c =
let constants = Raw_context.constants c in
constants.proof_of_work_threshold
let dictator_pubkey c =
let constants = Raw_context.constants c in
constants.dictator_pubkey
let max_number_of_operations c =
let constants = Raw_context.constants c in
constants.max_number_of_operations
let max_operation_data_length c =
let constants = Raw_context.constants c in
constants.max_operation_data_length
let michelson_maximum_type_size c =
let constants = Raw_context.constants c in
constants.michelson_maximum_type_size
include Constants_storage
end
module Voting_period = Voting_period_repr

View File

@ -0,0 +1,48 @@
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
let preserved_cycles c =
let constants = Raw_context.constants c in
constants.preserved_cycles
let cycle_length c =
let constants = Raw_context.constants c in
constants.cycle_length
let voting_period_length c =
let constants = Raw_context.constants c in
constants.voting_period_length
let time_before_reward c =
let constants = Raw_context.constants c in
constants.time_before_reward
let slot_durations c =
let constants = Raw_context.constants c in
constants.slot_durations
let first_free_baking_slot c =
let constants = Raw_context.constants c in
constants.first_free_baking_slot
let max_signing_slot c =
let constants = Raw_context.constants c in
constants.max_signing_slot
let max_gas c =
let constants = Raw_context.constants c in
constants.max_gas
let proof_of_work_threshold c =
let constants = Raw_context.constants c in
constants.proof_of_work_threshold
let dictator_pubkey c =
let constants = Raw_context.constants c in
constants.dictator_pubkey
let max_number_of_operations c =
let constants = Raw_context.constants c in
constants.max_number_of_operations
let max_operation_data_length c =
let constants = Raw_context.constants c in
constants.max_operation_data_length
let michelson_maximum_type_size c =
let constants = Raw_context.constants c in
constants.michelson_maximum_type_size