text stringlengths 0 601k |
|---|
type error += Inconsistent_type_sizes : int * int -> error |
type error += | Inconsistent_types : Script . location option * Script . expr * Script . expr -> error |
type error += | Inconsistent_memo_sizes : Sapling . Memo_size . t * Sapling . Memo_size . t -> error |
type error += Unordered_map_keys of Script . location * Script . expr |
type error += Unordered_set_values of Script . location * Script . expr |
type error += Duplicate_map_keys of Script . location * Script . expr |
type error += Duplicate_set_values of Script . location * Script . expr |
type error += | Ill_typed_data : string option * Script . expr * Script . expr -> error |
type error += Ill_formed_type of string option * Script . expr * Script . location |
type error += Ill_typed_contract : Script . expr * type_map -> error |
type error += Deprecated_instruction of prim |
type error += Unexpected_ticket of Script . location |
type error += Unexpected_forged_value of Script . location |
type error += Non_dupable_type of Script . location * Script . expr |
type inconsistent_types_fast_error = | Inconsistent_types_fast |
type _ error_details = | Informative : error trace error_details | Fast : inconsistent_types_fast_error error_details |
let stack_ty_enc = Data_encoding . list Script . expr_encoding |
let type_map_enc = let open Data_encoding in list ( conv ( fun ( loc , ( bef , aft ) ) -> ( loc , bef , aft ) ) ( fun ( loc , bef , aft ) -> ( loc , ( bef , aft ) ) ) ( obj3 ( req " location " Script . location_encoding ) ( req " stack_before " stack_ty_enc ) ( req " stack_after " stack_ty_enc ) ) ) |
let ( ) = let open Data_encoding in let located enc = merge_objs ( obj1 ( req " location " Script . location_encoding ) ) enc in let arity_enc = int8 in let namespace_enc = def " primitiveNamespace " ~ title " : Primitive namespace " ~ description : " One of the five possible namespaces of primitive ( data constructor ... |
type t = Timestamp_tag of repr [ @@ ocaml . unboxed ] |
let compare ( Timestamp_tag x ) ( Timestamp_tag y ) = Z . compare x y |
let of_int64 i = Timestamp_tag ( Z . of_int64 i ) |
let of_string x = match Time_repr . of_notation x with | None -> Option . catch ( fun ( ) -> Timestamp_tag ( Z . of_string x ) ) | Some time -> Some ( of_int64 ( Time_repr . to_seconds time ) ) |
let to_notation ( Timestamp_tag x ) = Option . catch ( fun ( ) -> Time_repr . to_notation ( Time . of_seconds ( Z . to_int64 x ) ) ) |
let to_num_str ( Timestamp_tag x ) = Z . to_string x |
let to_string x = match to_notation x with None -> to_num_str x | Some s -> s |
let diff ( Timestamp_tag x ) ( Timestamp_tag y ) = Script_int_repr . of_zint @@ Z . sub x y |
let sub_delta ( Timestamp_tag t ) delta = Timestamp_tag ( Z . sub t ( Script_int_repr . to_zint delta ) ) |
let add_delta ( Timestamp_tag t ) delta = Timestamp_tag ( Z . add t ( Script_int_repr . to_zint delta ) ) |
let to_zint ( Timestamp_tag x ) = x |
let of_zint x = Timestamp_tag x |
let encoding = Data_encoding . ( conv to_zint of_zint z ) |
type step_constants = { source : Contract . t ; payer : Contract . t ; self : Contract . t ; amount : Tez . t ; balance : Tez . t ; chain_id : Chain_id . t ; now : Script_timestamp . t ; level : Script_int . n Script_int . num ; } |
type address = { destination : Destination . t ; entrypoint : Entrypoint . t } |
module Script_signature = struct type t = Signature_tag of signature [ @@ ocaml . unboxed ] let make s = Signature_tag s let get ( Signature_tag s ) = s let encoding = Data_encoding . conv ( fun ( Signature_tag x ) -> x ) ( fun x -> Signature_tag x ) Signature . encoding let of_b58check_opt x = Option . map make ( Sign... |
type ( ' a , ' b ) pair = ' a * ' b |
type ( ' a , ' b ) union = L of ' a | R of ' b |
type operation = { piop : packed_internal_operation ; lazy_storage_diff : Lazy_storage . diffs option ; } |
module Script_chain_id = struct type t = Chain_id_tag of Chain_id . t [ @@ ocaml . unboxed ] let make x = Chain_id_tag x let compare ( Chain_id_tag x ) ( Chain_id_tag y ) = Chain_id . compare x y let size = Chain_id . size let encoding = Data_encoding . conv ( fun ( Chain_id_tag x ) -> x ) make Chain_id . encoding let ... |
module Script_bls = struct module type S = sig type t type fr val add : t -> t -> t val mul : t -> fr -> t val negate : t -> t val of_bytes_opt : Bytes . t -> t option val to_bytes : t -> Bytes . t end module Fr = struct type t = Fr_tag of Bls12_381 . Fr . t [ @@ ocaml . unboxed ] open Bls12_381 . Fr let add ( Fr_tag x... |
module Script_timelock = struct type chest_key = Chest_key_tag of Timelock . chest_key [ @@ ocaml . unboxed ] let make_chest_key chest_key = Chest_key_tag chest_key let chest_key_encoding = Data_encoding . conv ( fun ( Chest_key_tag x ) -> x ) ( fun x -> Chest_key_tag x ) Timelock . chest_key_encoding type chest = Ches... |
type ' a ticket = { ticketer : Contract . t ; contents : ' a ; amount : n num } |
module type TYPE_SIZE = sig type ' a t val merge : error_details ' : error_trace Script_tc_errors . error_details -> ' a t -> ' b t -> ( ' a t , ' error_trace ) result val to_int : ' a t -> Saturation_repr . mul_safe Saturation_repr . t val one : _ t val two : _ t val three : _ t val four : ( _ , _ ) pair option t val ... |
module Type_size : TYPE_SIZE = struct type ' a t = int let ( ) = let ( _ : Saturation_repr . mul_safe Saturation_repr . t ) = Saturation_repr . mul_safe_of_int_exn Constants . michelson_maximum_type_size in ( ) let to_int = Saturation_repr . mul_safe_of_int_exn let one = 1 let two = 2 let three = 3 let four = 4 let mer... |
type end_of_stack = empty_cell * empty_cell |
type ' a ty_metadata = { size : ' a Type_size . t } [ @@ unboxed ] |
type _ comparable_ty = | Unit_key : unit comparable_ty | Never_key : never comparable_ty | Int_key : z num comparable_ty | Nat_key : n num comparable_ty | Signature_key : signature comparable_ty | String_key : Script_string . t comparable_ty | Bytes_key : Bytes . t comparable_ty | Mutez_key : Tez . t comparable_ty | Bo... |
let meta_basic = { size = Type_size . one } |
let comparable_ty_metadata : type a . a comparable_ty -> a ty_metadata = function | Unit_key | Never_key | Int_key | Nat_key | Signature_key | String_key | Bytes_key | Mutez_key | Bool_key | Key_hash_key | Key_key | Timestamp_key | Chain_id_key | Address_key -> meta_basic | Pair_key ( _ , _ , meta ) -> meta | Union_key... |
let comparable_ty_size t = ( comparable_ty_metadata t ) . size |
let pair_key loc l r = Type_size . compound2 loc ( comparable_ty_size l ) ( comparable_ty_size r ) >|? fun size -> Pair_key ( l , r , { size } ) |
let pair_3_key loc l m r = pair_key loc m r >>? fun r -> pair_key loc l r |
let union_key loc l r = Type_size . compound2 loc ( comparable_ty_size l ) ( comparable_ty_size r ) >|? fun size -> Union_key ( l , r , { size } ) |
let option_key loc t = Type_size . compound1 loc ( comparable_ty_size t ) >|? fun size -> Option_key ( t , { size } ) |
module type Boxed_set_OPS = sig type t type elt val empty : t val add : elt -> t -> t val mem : elt -> t -> bool val remove : elt -> t -> t val fold : ( elt -> ' a -> ' a ) -> t -> ' a -> ' a end |
module type Boxed_set = sig type elt val elt_ty : elt comparable_ty module OPS : Boxed_set_OPS with type elt = elt val boxed : OPS . t val size : int end |
type ' elt set = Set_tag of ( module Boxed_set with type elt = ' elt ) [ @@ ocaml . unboxed ] |
module type Boxed_map_OPS = sig type t type key type value val empty : t val add : key -> value -> t -> t val remove : key -> t -> t val find : key -> t -> value option val fold : ( key -> value -> ' a -> ' a ) -> t -> ' a -> ' a end |
module type Boxed_map = sig type key type value val key_ty : key comparable_ty module OPS : Boxed_map_OPS with type key = key and type value = value val boxed : OPS . t val size : int end |
type ( ' key , ' value ) map = | Map_tag of ( module Boxed_map with type key = ' key and type value = ' value ) [ @@ ocaml . unboxed ] |
module Big_map_overlay = Map . Make ( struct type t = Script_expr_hash . t let compare = Script_expr_hash . compare end ) |
type ( ' key , ' value ) big_map_overlay = { map : ( ' key * ' value option ) Big_map_overlay . t ; size : int ; } |
type ' elt boxed_list = { elements : ' elt list ; length : int } |
module SMap = Map . Make ( Script_string ) |
type view = { input_ty : Script . node ; output_ty : Script . node ; view_code : Script . node ; } |
type ' arg entrypoints = { name : Entrypoint . t option ; nested : ' arg nested_entrypoints ; } | Entrypoints_Union : { left : ' l entrypoints ; right : ' r entrypoints ; } -> ( ' l , ' r ) union nested_entrypoints | Entrypoints_None : _ nested_entrypoints |
let no_entrypoints = { name = None ; nested = Entrypoints_None } |
type ( ' arg , ' storage ) script = { code : ( ( ' arg , ' storage ) pair , ( operation boxed_list , ' storage ) pair ) lambda ; arg_type : ' arg ty ; storage : ' storage ; storage_type : ' storage ty ; views : view SMap . t ; entrypoints : ' arg entrypoints ; code_size : Cache_memory_helpers . sint ; } | IDrop : ( ' a... |
let kinfo_of_kinstr : type a s b f . ( a , s , b , f ) kinstr -> ( a , s ) kinfo = fun i -> match i with | IDrop ( kinfo , _ ) -> kinfo | IDup ( kinfo , _ ) -> kinfo | ISwap ( kinfo , _ ) -> kinfo | IConst ( kinfo , _ , _ ) -> kinfo | ICons_pair ( kinfo , _ ) -> kinfo | ICar ( kinfo , _ ) -> kinfo | ICdr ( kinfo , _ ) ... |
type kinstr_rewritek = { apply : ' b ' u ' r ' f . ( ' b , ' u , ' r , ' f ) kinstr -> ( ' b , ' u , ' r , ' f ) kinstr ; } |
let kinstr_rewritek : type a s r f . ( a , s , r , f ) kinstr -> kinstr_rewritek -> ( a , s , r , f ) kinstr = fun i f -> match i with | IDrop ( kinfo , k ) -> IDrop ( kinfo , f . apply k ) | IDup ( kinfo , k ) -> IDup ( kinfo , f . apply k ) | ISwap ( kinfo , k ) -> ISwap ( kinfo , f . apply k ) | IConst ( kinfo , x ,... |
let ty_metadata : type a . a ty -> a ty_metadata = function | Unit_t | Never_t | Int_t | Nat_t | Signature_t | String_t | Bytes_t | Mutez_t | Bool_t | Key_hash_t | Key_t | Timestamp_t | Chain_id_t | Address_t -> meta_basic | Pair_t ( _ , _ , meta ) -> meta | Union_t ( _ , _ , meta ) -> meta | Option_t ( _ , meta ) -> m... |
let ty_size t = ( ty_metadata t ) . size |
let pair_t loc l r = Type_size . compound2 loc ( ty_size l ) ( ty_size r ) >|? fun size -> Pair_t ( l , r , { size } ) |
let union_t loc l r = Type_size . compound2 loc ( ty_size l ) ( ty_size r ) >|? fun size -> Union_t ( l , r , { size } ) |
let union_bytes_bool_t = Union_t ( bytes_t , bool_t , { size = Type_size . three } ) |
let lambda_t loc l r = Type_size . compound2 loc ( ty_size l ) ( ty_size r ) >|? fun size -> Lambda_t ( l , r , { size } ) |
let option_t loc t = Type_size . compound1 loc ( ty_size t ) >|? fun size -> Option_t ( t , { size } ) |
let option_mutez_t = Option_t ( mutez_t , { size = Type_size . two } ) |
let option_string_t = Option_t ( string_t , { size = Type_size . two } ) |
let option_bytes_t = Option_t ( bytes_t , { size = Type_size . two } ) |
let option_nat_t = Option_t ( nat_t , { size = Type_size . two } ) |
let option_pair_nat_nat_t = Option_t ( Pair_t ( nat_t , nat_t , { size = Type_size . three } ) , { size = Type_size . four } ) |
let option_pair_nat_mutez_t = Option_t ( Pair_t ( nat_t , mutez_t , { size = Type_size . three } ) , { size = Type_size . four } ) |
let option_pair_mutez_mutez_t = Option_t ( Pair_t ( mutez_t , mutez_t , { size = Type_size . three } ) , { size = Type_size . four } ) |
let option_pair_int_nat_t = Option_t ( Pair_t ( int_t , nat_t , { size = Type_size . three } ) , { size = Type_size . four } ) |
let list_t loc t = Type_size . compound1 loc ( ty_size t ) >|? fun size -> List_t ( t , { size } ) |
let list_operation_t = List_t ( operation_t , { size = Type_size . two } ) |
let set_t loc t = Type_size . compound1 loc ( comparable_ty_size t ) >|? fun size -> Set_t ( t , { size } ) |
let map_t loc l r = Type_size . compound2 loc ( comparable_ty_size l ) ( ty_size r ) >|? fun size -> Map_t ( l , r , { size } ) |
let big_map_t loc l r = Type_size . compound2 loc ( comparable_ty_size l ) ( ty_size r ) >|? fun size -> Big_map_t ( l , r , { size } ) |
let contract_t loc t = Type_size . compound1 loc ( ty_size t ) >|? fun size -> Contract_t ( t , { size } ) |
let contract_unit_t = Contract_t ( unit_t , { size = Type_size . two } ) |
let sapling_transaction_t ~ memo_size = Sapling_transaction_t memo_size |
let sapling_state_t ~ memo_size = Sapling_state_t memo_size |
let ticket_t loc t = Type_size . compound1 loc ( comparable_ty_size t ) >|? fun size -> Ticket_t ( t , { size } ) |
type ' a kinstr_traverse = { apply : ' b ' u ' r ' f . ' a -> ( ' b , ' u , ' r , ' f ) kinstr -> ' a ; } |
let kinstr_traverse i init f = let rec aux : type ret a s r f . ' accu -> ( a , s , r , f ) kinstr -> ( ' accu -> ret ) -> ret = fun accu t continue -> let accu = f . apply accu t in let next k = ( aux [ @ ocaml . tailcall ] ) accu k @@ fun accu -> ( continue [ @ ocaml . tailcall ] ) accu in let next2 k1 k2 = ( aux [ @... |
type ' a ty_traverse = { apply : ' t . ' a -> ' t ty -> ' a ; apply_comparable : ' t . ' a -> ' t comparable_ty -> ' a ; } |
let ( ty_traverse , comparable_ty_traverse ) = let rec aux : type t ret accu . accu ty_traverse -> accu -> t comparable_ty -> ( accu -> ret ) -> ret = fun f accu ty continue -> let accu = f . apply_comparable accu ty in let next2 ty1 ty2 = ( aux [ @ ocaml . tailcall ] ) f accu ty1 @@ fun accu -> ( aux [ @ ocaml . tailc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.