ligo/vendors/ligo-utils/tezos-protocol-alpha/michelson_v1_gas.mli

317 lines
7.6 KiB
OCaml
Raw Permalink Normal View History

2019-09-05 17:21:01 +04:00
(*****************************************************************************)
(* *)
(* Open Source License *)
(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* Permission is hereby granted, free of charge, to any person obtaining a *)
(* copy of this software and associated documentation files (the "Software"),*)
(* to deal in the Software without restriction, including without limitation *)
(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)
(* and/or sell copies of the Software, and to permit persons to whom the *)
(* Software is furnished to do so, subject to the following conditions: *)
(* *)
(* The above copyright notice and this permission notice shall be included *)
(* in all copies or substantial portions of the Software. *)
(* *)
(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)
(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)
(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)
(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)
(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)
(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)
(* DEALINGS IN THE SOFTWARE. *)
(* *)
(*****************************************************************************)
open Alpha_context
module Cost_of : sig
val manager_operation : Gas.cost
2019-10-17 13:45:27 +04:00
module Legacy : sig
val z_to_int64 : Gas.cost
2019-10-17 13:45:27 +04:00
val hash : MBytes.t -> int -> Gas.cost
val map_to_list : ('b, 'c) Script_typed_ir.map -> Gas.cost
2019-10-17 13:45:27 +04:00
val set_update : 'a -> bool -> 'a Script_typed_ir.set -> Gas.cost
end
module Interpreter : sig
val cycle : Gas.cost
2019-10-17 13:45:27 +04:00
val loop_cycle : Gas.cost
2019-10-17 13:45:27 +04:00
val loop_size : Gas.cost
2019-10-17 13:45:27 +04:00
val loop_iter : Gas.cost
2019-10-17 13:45:27 +04:00
val loop_map : Gas.cost
2019-10-17 13:45:27 +04:00
val nop : Gas.cost
2019-10-17 13:45:27 +04:00
val stack_op : Gas.cost
2019-10-17 13:45:27 +04:00
val stack_n_op : int -> Gas.cost
2019-10-17 13:45:27 +04:00
val bool_binop : 'a -> 'b -> Gas.cost
2019-10-17 13:45:27 +04:00
val bool_unop : 'a -> Gas.cost
2019-10-17 13:45:27 +04:00
val pair : Gas.cost
2019-10-17 13:45:27 +04:00
val pair_access : Gas.cost
2019-10-17 13:45:27 +04:00
val cons : Gas.cost
2019-10-17 13:45:27 +04:00
val variant_no_data : Gas.cost
2019-10-17 13:45:27 +04:00
val branch : Gas.cost
2019-10-17 13:45:27 +04:00
val concat_string : string list -> Gas.cost
2019-10-17 13:45:27 +04:00
val concat_bytes : MBytes.t list -> Gas.cost
2019-10-17 13:45:27 +04:00
val slice_string : int -> Gas.cost
val map_mem : 'a -> ('a, 'b) Script_typed_ir.map -> Gas.cost
2019-10-17 13:45:27 +04:00
val map_to_list : ('a, 'b) Script_typed_ir.map -> Gas.cost
2019-10-17 13:45:27 +04:00
val map_get : 'a -> ('a, 'b) Script_typed_ir.map -> Gas.cost
val map_update :
'a -> 'b option -> ('a, 'b) Script_typed_ir.map -> Gas.cost
2019-10-17 13:45:27 +04:00
val map_size : Gas.cost
2019-10-17 13:45:27 +04:00
val set_to_list : 'a Script_typed_ir.set -> Gas.cost
2019-10-17 13:45:27 +04:00
val set_update : 'a -> bool -> 'a Script_typed_ir.set -> Gas.cost
2019-10-17 13:45:27 +04:00
val set_mem : 'a -> 'a Script_typed_ir.set -> Gas.cost
2019-10-17 13:45:27 +04:00
val mul : 'a Script_int.num -> 'b Script_int.num -> Gas.cost
2019-10-17 13:45:27 +04:00
val div : 'a Script_int.num -> 'b Script_int.num -> Gas.cost
2019-10-17 13:45:27 +04:00
val add : 'a Script_int.num -> 'b Script_int.num -> Gas.cost
2019-10-17 13:45:27 +04:00
val sub : 'a Script_int.num -> 'b Script_int.num -> Gas.cost
2019-10-17 13:45:27 +04:00
val abs : 'a Script_int.num -> Gas.cost
2019-10-17 13:45:27 +04:00
val neg : 'a Script_int.num -> Gas.cost
2019-10-17 13:45:27 +04:00
val int : 'a -> Gas.cost
2019-10-17 13:45:27 +04:00
val add_timestamp : Script_timestamp.t -> 'a Script_int.num -> Gas.cost
2019-10-17 13:45:27 +04:00
val sub_timestamp : Script_timestamp.t -> 'a Script_int.num -> Gas.cost
2019-10-17 13:45:27 +04:00
val diff_timestamps : Script_timestamp.t -> Script_timestamp.t -> Gas.cost
2019-10-17 13:45:27 +04:00
val empty_set : Gas.cost
2019-10-17 13:45:27 +04:00
val set_size : Gas.cost
2019-10-17 13:45:27 +04:00
val empty_map : Gas.cost
2019-10-17 13:45:27 +04:00
val int64_op : Gas.cost
2019-10-17 13:45:27 +04:00
val z_to_int64 : Gas.cost
2019-10-17 13:45:27 +04:00
val int64_to_z : Gas.cost
2019-10-17 13:45:27 +04:00
val logor : 'a Script_int.num -> 'b Script_int.num -> Gas.cost
2019-10-17 13:45:27 +04:00
val logand : 'a Script_int.num -> 'b Script_int.num -> Gas.cost
2019-10-17 13:45:27 +04:00
val logxor : 'a Script_int.num -> 'b Script_int.num -> Gas.cost
2019-10-17 13:45:27 +04:00
val lognot : 'a Script_int.num -> Gas.cost
2019-10-17 13:45:27 +04:00
val shift_left : 'a Script_int.num -> 'b Script_int.num -> Gas.cost
2019-10-17 13:45:27 +04:00
val shift_right : 'a Script_int.num -> 'b Script_int.num -> Gas.cost
2019-10-17 13:45:27 +04:00
val exec : Gas.cost
2019-10-17 13:45:27 +04:00
val push : Gas.cost
2019-10-17 13:45:27 +04:00
val compare_res : Gas.cost
2019-10-17 13:45:27 +04:00
val unpack_failed : MBytes.t -> Gas.cost
2019-10-17 13:45:27 +04:00
val address : Gas.cost
2019-10-17 13:45:27 +04:00
val contract : Gas.cost
2019-10-17 13:45:27 +04:00
val transfer : Gas.cost
2019-10-17 13:45:27 +04:00
val create_account : Gas.cost
2019-10-17 13:45:27 +04:00
val create_contract : Gas.cost
2019-10-17 13:45:27 +04:00
val implicit_account : Gas.cost
2019-10-17 13:45:27 +04:00
val set_delegate : Gas.cost
2019-10-17 13:45:27 +04:00
val balance : Gas.cost
2019-10-17 13:45:27 +04:00
val now : Gas.cost
2019-10-17 13:45:27 +04:00
val check_signature : public_key -> MBytes.t -> Gas.cost
2019-10-17 13:45:27 +04:00
val hash_key : Gas.cost
2019-10-17 13:45:27 +04:00
val hash_blake2b : MBytes.t -> Gas.cost
2019-10-17 13:45:27 +04:00
val hash_sha256 : MBytes.t -> Gas.cost
2019-10-17 13:45:27 +04:00
val hash_sha512 : MBytes.t -> Gas.cost
2019-10-17 13:45:27 +04:00
val steps_to_quota : Gas.cost
2019-10-17 13:45:27 +04:00
val source : Gas.cost
2019-10-17 13:45:27 +04:00
val self : Gas.cost
2019-10-17 13:45:27 +04:00
val amount : Gas.cost
2019-10-17 13:45:27 +04:00
val chain_id : Gas.cost
2019-10-17 13:45:27 +04:00
val wrap : Gas.cost
2019-10-17 13:45:27 +04:00
val compare : 'a Script_typed_ir.comparable_ty -> 'a -> 'a -> Gas.cost
2019-10-17 13:45:27 +04:00
val apply : Gas.cost
end
2019-09-05 17:21:01 +04:00
module Typechecking : sig
val cycle : Gas.cost
2019-09-05 17:21:01 +04:00
val unit : Gas.cost
2019-09-05 17:21:01 +04:00
val bool : Gas.cost
2019-09-05 17:21:01 +04:00
val tez : Gas.cost
2019-09-05 17:21:01 +04:00
val z : Z.t -> Gas.cost
2019-09-05 17:21:01 +04:00
val string : int -> Gas.cost
2019-09-05 17:21:01 +04:00
val bytes : int -> Gas.cost
2019-09-05 17:21:01 +04:00
val int_of_string : string -> Gas.cost
2019-09-05 17:21:01 +04:00
val string_timestamp : Gas.cost
2019-09-05 17:21:01 +04:00
val key : Gas.cost
2019-09-05 17:21:01 +04:00
val key_hash : Gas.cost
2019-09-05 17:21:01 +04:00
val signature : Gas.cost
2019-10-17 13:45:27 +04:00
val chain_id : Gas.cost
2019-09-05 17:21:01 +04:00
val contract : Gas.cost
(** Gas.Cost of getting the code for a contract *)
val get_script : Gas.cost
val contract_exists : Gas.cost
(** Additional Gas.cost of parsing a pair over the Gas.cost of parsing each type *)
val pair : Gas.cost
val union : Gas.cost
val lambda : Gas.cost
val some : Gas.cost
2019-09-05 17:21:01 +04:00
val none : Gas.cost
val list_element : Gas.cost
2019-09-05 17:21:01 +04:00
val set_element : int -> Gas.cost
2019-09-05 17:21:01 +04:00
val map_element : int -> Gas.cost
val primitive_type : Gas.cost
2019-09-05 17:21:01 +04:00
val one_arg_type : Gas.cost
2019-09-05 17:21:01 +04:00
val two_arg_type : Gas.cost
val operation : int -> Gas.cost
(** Cost of parsing a type *)
val type_ : int -> Gas.cost
(** Cost of parsing an instruction *)
val instr : ('a, 'b) Script_typed_ir.instr -> Gas.cost
end
module Unparse : sig
val prim_cost : int -> Script.annot -> Gas.cost
2019-09-05 17:21:01 +04:00
val seq_cost : int -> Gas.cost
2019-09-05 17:21:01 +04:00
val cycle : Gas.cost
2019-09-05 17:21:01 +04:00
val unit : Gas.cost
2019-09-05 17:21:01 +04:00
val bool : Gas.cost
2019-09-05 17:21:01 +04:00
val z : Z.t -> Gas.cost
2019-09-05 17:21:01 +04:00
val int : 'a Script_int.num -> Gas.cost
2019-09-05 17:21:01 +04:00
val tez : Gas.cost
2019-09-05 17:21:01 +04:00
val string : string -> Gas.cost
2019-09-05 17:21:01 +04:00
val bytes : MBytes.t -> Gas.cost
2019-09-05 17:21:01 +04:00
val timestamp : Script_timestamp.t -> Gas.cost
2019-09-05 17:21:01 +04:00
val key : Gas.cost
2019-09-05 17:21:01 +04:00
val key_hash : Gas.cost
2019-09-05 17:21:01 +04:00
val signature : Gas.cost
2019-09-05 17:21:01 +04:00
val operation : MBytes.t -> Gas.cost
2019-10-17 13:45:27 +04:00
val chain_id : MBytes.t -> Gas.cost
2019-09-05 17:21:01 +04:00
val contract : Gas.cost
(** Additional Gas.cost of parsing a pair over the Gas.cost of parsing each type *)
val pair : Gas.cost
val union : Gas.cost
val some : Gas.cost
2019-09-05 17:21:01 +04:00
val none : Gas.cost
val list_element : Gas.cost
2019-09-05 17:21:01 +04:00
val set_element : Gas.cost
2019-09-05 17:21:01 +04:00
val map_element : Gas.cost
val one_arg_type : Script.annot -> Gas.cost
2019-09-05 17:21:01 +04:00
val two_arg_type : Script.annot -> Gas.cost
2019-09-05 17:21:01 +04:00
val set_to_list : 'a Script_typed_ir.set -> Gas.cost
2019-09-05 17:21:01 +04:00
val map_to_list : ('a, 'b) Script_typed_ir.map -> Gas.cost
end
end