text
stringlengths
0
601k
let foooooooooooo = let foooooooooooooo = let woooooooooooooooo = koooooooooooooooo in baaaaaar in hooohoooo } | ; make_test " with parens and begin / end " ~ source : { | let x = begin let y = ( if ( k = x ) then begin match k , v with [ x ; y ] -> ( foo ; ( if ( z ) then foo else bar ) ) end else foo ) in foooooo end...
let foooooooooooo = ( [ foooooo } | ~ range ( : 1 , 6 ) { | let foooooo = let foooooooooooo = ( [ fun x -> foooooo } | ; make_test " already formatted function " ~ source : { | let fmt_expressions c width sub_exp exprs fmt_expr ( p : Params . elements_collection ) = match c . conf . break_collection_expressions with | ...
let x = 3 in x + y } | { |
let x = 3 in
let read_file f = Stdio . In_channel . with_file f ~ f : Stdio . In_channel . input_all
let test_numeric_file = let _fmt_ast_source = read_file " . . . . // lib / Fmt_ast . ml " in let partial_source = read_file " . . / passing / tests / partial . ml " in let inv_with_loc_source = read_file " . . / passing / tests / format_invalid_files_with_locations . ml " in let make_test name ~ source ~ range ~ expect...
let tests = List . concat [ test_parse_and_format_signature @ test_parse_and_format_use_file @ test_parse_and_format_core_type @ test_parse_and_format_module_type @ test_parse_and_format_expression @ test_numeric @ test_numeric_file ]
module T = Transport object val mutable _opened = true val mutable _current_idx_input = 0 inherit Transport . t method isOpen = _opened method opn = ( ) method close = _opened <- false method read buf off len = let input_buf_length = Buffer . length i in if len + _current_idx_input > input_buf_length then raise ( T . E...
let medium_list x = QCheck . ( list_of_size ( Gen . int_bound 100 ) x )
let list_values_are_unique l = List . length ( List . sort_uniq compare l ) = List . length l
let assume_unique_keys ( type a ) : ( char list * a ) list -> unit = fun kv_list -> let keys = List . map fst kv_list in QCheck . assume ( list_values_are_unique keys )
let make_tests m = let module Char_trie = ( val m : Trie . S with type key = char list ) in let trie_of_key_value_list ( type a ) : ( Char_trie . key * a ) list -> a Char_trie . t = fun l -> List . fold_left ( fun acc ( key , value ) -> Char_trie . add key value acc ) Char_trie . empty l in let trie_key_with_size max =...
let ( ) = let tests = [ ( module Char_trie : Trie . S with type key = char list ) ; ( module Array_char_trie : Trie . S with type key = char list ) ] |> List . map make_tests |> List . concat in QCheck_runner . run_tests_main tests
let fmt_list to_string l = sprintf " [ % s ] " ( l |> List . map to_string |> String . concat " " )
let fmt_graph l = sprintf " [ % s ] " ( l |> List . map ( fun ( v , vl ) -> sprintf " % i ->% s " v ( fmt_list string_of_int vl ) ) |> String . concat " " )
let fmt_partition l = fmt_list ( fmt_list string_of_int ) l
let fmt_tsort_result res = match res with | Tsort . Sorted l -> sprintf " Sorted % s " ( fmt_list string_of_int l ) | Tsort . ErrorCycle l -> sprintf " ErrorCycle % s " ( fmt_list string_of_int l )
let test_find_nonexistent_nodes ( ) = assert ( ( Tsort . find_nonexistent_nodes [ 1 , [ ] ; 2 , [ 3 ] ] ) = [ 2 , [ 3 ] ] ) ; assert ( ( Tsort . find_nonexistent_nodes [ 1 , [ ] ; 2 , [ 3 ] ; 4 , [ 5 ; 6 ; 7 ; 5 ] ; 6 , [ 2 ] ] ) = [ 2 , [ 3 ] ; 4 , [ 5 ; 7 ] ] )
let test_tsort ( ) = let sort graph = printf " input : % s \ n " %! ( fmt_graph graph ) ; let res = Tsort . sort graph in printf " output : % s \ n " %! ( fmt_tsort_result res ) ; res in assert ( sort [ ] = Sorted [ ] ) ; assert ( sort [ 1 , [ 2 ] ; 2 , [ 3 ; 4 ] ; 3 , [ 4 ; 5 ] ; 4 , [ 6 ] ; 5 , [ 6 ] ; 6 , [ 7 ] ; 7 ...
let test_find_sc_components ( ) = let p graph = printf " input : % s \ n " %! ( fmt_graph graph ) ; let partition = Tsort . find_strongly_connected_components graph in printf " output : % s \ n " %! ( fmt_partition partition ) ; partition in assert ( p [ ] = [ ] ) ; assert ( p [ 0 , [ ] ] = [ [ 0 ] ] ) ; assert ( p [ 0...
let test_sort_sc_components ( ) = let sort graph = printf " input : % s \ n " %! ( fmt_graph graph ) ; let components = Tsort . sort_strongly_connected_components graph in printf " output : % s \ n " %! ( fmt_partition components ) ; components in assert ( sort [ ] = [ ] ) ; assert ( sort [ 0 , [ ] ] = [ [ 0 ] ] ) ; as...
let main ( ) = Alcotest . run " Tsort " [ " Tsort " , [ " find nonexistent nodes " , ` Quick , test_find_nonexistent_nodes ; " sort " , ` Quick , test_tsort ; " find s . c . components " , ` Quick , test_find_sc_components ; " sort s . c . components " , ` Quick , test_sort_sc_components ; ] ; ]
let ( ) = main ( )
type a = char [ @ gen QCheck . Gen . pure ' a ' ] ' a '
type b = char [ @ gen QCheck . Gen . pure ' b ' ] ' b '
type c = char [ @ gen QCheck . Gen . pure ' c ' ] ' c '
type d = char [ @ gen QCheck . Gen . pure ' d ' ] ' d '
type e = char [ @ gen QCheck . Gen . pure ' e ' ] ' e '
type f = char [ @ gen QCheck . Gen . pure ' f ' ] ' f '
type g = char [ @ gen QCheck . Gen . pure ' g ' ] ' g '
type h = char [ @ gen QCheck . Gen . pure ' h ' ] ' h '
type i = char [ @ gen QCheck . Gen . pure ' i ' ] ' i '
type tup2 = a * b
type tup3 = a * b * c
type tup4 = a * b * c * d
type tup5 = a * b * c * d * e
type tup6 = a * b * c * d * e * f
type tup7 = a * b * c * d * e * f * g
type tup8 = a * b * c * d * e * f * g * h
let test_tup2 = Test . make ~ count : 10 ~ name " : forall x in ( ' a ' , ' b ' ) ' b ' : x = ( ' a ' , ' b ' ) ' b ' " ( make gen_tup2 ) gen_tup2 ( fun x -> x = ( ' a ' , ' b ' ) ' b ' ) ' b '
let test_tup3 = Test . make ~ count : 10 ~ name " : forall x in ( ' a ' , ' b ' , ' c ' ) ' c ' : x = ( ' a ' , ' b ' , ' c ' ) ' c ' " ( make gen_tup3 ) gen_tup3 ( fun x -> x = ( ' a ' , ' b ' , ' c ' ) ' c ' ) ' c '
let test_tup4 = Test . make ~ count : 10 ~ name " : forall x in ( ' a ' , ' b ' , ' c ' , ' d ' ) ' d ' : x = ( ' a ' , ' b ' , ' c ' , ' d ' ) ' d ' " ( make gen_tup4 ) gen_tup4 ( fun x -> x = ( ' a ' , ' b ' , ' c ' , ' d ' ) ' d ' ) ' d '
let test_tup5 = Test . make ~ count : 10 ~ name " : forall x in ( ' a ' , ' b ' , ' c ' , ' d ' , ' e ' ) ' e ' : x = ( ' a ' , ' b ' , ' c ' , ' d ' , ' e ' ) ' e ' " ( make gen_tup5 ) gen_tup5 ( fun x -> x = ( ' a ' , ' b ' , ' c ' , ' d ' , ' e ' ) ' e ' ) ' e '
let test_tup6 = Test . make ~ count : 10 ~ name " : forall x in ( ' a ' , ' b ' , ' c ' , ' d ' , ' e ' , ' f ' ) ' f ' : x = ( ' a ' , ' b ' , ' c ' , ' d ' , ' e ' , ' f ' ) ' f ' " ( make gen_tup6 ) gen_tup6 ( fun x -> x = ( ' a ' , ' b ' , ' c ' , ' d ' , ' e ' , ' f ' ) ' f ' ) ' f '
let test_tup7 = Test . make ~ count : 10 ~ name " : forall x in ( ' a ' , ' b ' , ' c ' , ' d ' , ' e ' , ' f ' , ' g ' ) ' g ' : x = ( ' a ' , ' b ' , ' c ' , ' d ' , ' e ' , ' f ' , ' g ' ) ' g ' " ( make gen_tup7 ) gen_tup7 ( fun x -> x = ( ' a ' , ' b ' , ' c ' , ' d ' , ' e ' , ' f ' , ' g ' ) ' g ' ) ' g '
let test_tup8 = Test . make ~ count : 10 ~ name " : forall x in ( ' a ' , ' b ' , ' c ' , ' d ' , ' e ' , ' f ' , ' g ' , ' h ' ) ' h ' : x = ( ' a ' , ' b ' , ' c ' , ' d ' , ' e ' , ' f ' , ' g ' , ' h ' ) ' h ' " ( make gen_tup8 ) gen_tup8 ( fun x -> x = ( ' a ' , ' b ' , ' c ' , ' d ' , ' e ' , ' f ' , ' g ' , ' h ...
let tests = [ test_tup2 ; test_tup3 ; test_tup4 ; test_tup5 ; test_tup6 ; test_tup7 ; test_tup8 ; ]
let tests = List . map ( QCheck_alcotest . to_alcotest ) to_alcotest tests
let ( ) = Alcotest . run " Test_Tuple " [ ( " Tuple " , tests ) tests ] tests
let _make_sure_pool_pointer_is_an_int x = ( x : _ Pool . Pointer . t :> int )
module Make ( Pool : Pool . S ) = struct module Pointer = Pool . Pointer let % test_unit " get_tuple with length = 1 " = let pool = Pool . create Pool . Slots . t1 ~ capacity : 10 ~ dummy : 0 in let ptr = Pool . new1 pool 42 in let tuple = Pool . get_tuple pool ptr in assert ( tuple = 42 ) ; ; let % test_unit " get_tup...
module Error_checked_pool = Pool . Error_check ( Pool ) let t = create Slots . t1 ~ capacity : 1 ~ dummy : 13 in let pointer = new1 t 15 in let show_pointer ( ) = print_s [ % sexp ( pointer_is_valid t pointer : bool ) , ( get t pointer Slot . t0 : int ) ] in show_pointer ( ) ; [ % expect { | ( true 15 ) } ] ; | ignore ...
let check_tx_rollup_exists ctxt tx_rollup = Context . Tx_rollup . state ctxt tx_rollup >|=? fun _ -> ( )
let check_proto_error f t = match t with | Environment . Ecoproto_error e :: _ when f e -> Assert . test_error_encodings e ; return_unit | _ -> failwith " Unexpected error : % a " Error_monad . pp_print_trace t
let test_disable_feature_flag ( ) = Context . init 1 >>=? fun ( b , contracts ) -> let contract = WithExceptions . Option . get ~ loc : __LOC__ @@ List . nth contracts 0 in Incremental . begin_construction b >>=? fun i -> Op . tx_rollup_origination ( I i ) contract >>=? fun ( op , _tx_rollup ) -> Incremental . add_oper...
let message_hash_testable : Tx_rollup_message . hash Alcotest . testable = Alcotest . testable Tx_rollup_message . pp_hash ( = )
let wrap m = m >|= Environment . wrap_tzresult
let inbox_fees state size = Environment . wrap_tzresult ( Tx_rollup_state . fees state size )
let fees_per_byte state = inbox_fees state 1
let check_batch_in_inbox : Tx_rollup_inbox . t -> int -> string -> unit tzresult Lwt . t = fun inbox n expected -> let ( expected_batch , _ ) = Tx_rollup_message . make_batch expected in let expected_hash = Tx_rollup_message . hash expected_batch in match List . nth inbox . contents n with | Some content -> Alcotest . ...
let context_init n = Context . init ~ consensus_threshold : 0 ~ tx_rollup_enable : true ~ endorsing_reward_per_slot : Tez . zero ~ baking_reward_bonus_per_slot : Tez . zero ~ baking_reward_fixed_portion : Tez . zero n
let originate b contract = Op . tx_rollup_origination ( B b ) contract >>=? fun ( operation , tx_rollup ) -> Block . bake ~ operation b >>=? fun b -> return ( b , tx_rollup )
let init_originate_and_submit ( ? batch = String . make 5 ' c ' ) ( ) = context_init 1 >>=? fun ( b , contracts ) -> let contract = WithExceptions . Option . get ~ loc : __LOC__ @@ List . nth contracts 0 in originate b contract >>=? fun ( b , tx_rollup ) -> Context . Contract . balance ( B b ) contract >>=? fun balance...
let assert_ok res = match res with Ok r -> r | Error _ -> assert false
let raw_level level = assert_ok @@ Raw_level . of_int32 level
let test_origination ( ) = Context . init ~ tx_rollup_enable : true 1 >>=? fun ( b , contracts ) -> let contract = WithExceptions . Option . get ~ loc : __LOC__ @@ List . nth contracts 0 in Context . get_constants ( B b ) >>=? fun { parametric = { tx_rollup_origination_size ; cost_per_byte ; _ } ; _ } -> Context . Cont...
let test_two_originations ( ) = Context . init ~ tx_rollup_enable : true 1 >>=? fun ( b , contracts ) -> let contract = WithExceptions . Option . get ~ loc : __LOC__ @@ List . nth contracts 0 in Incremental . begin_construction b >>=? fun i -> Op . tx_rollup_origination ( I i ) contract >>=? fun ( op1 , _false_tx_rollu...
let test_fees_per_byte_update ( ) = let test ~ inbox_ema ~ fees_per_byte ~ final_size ~ hard_limit ~ result = let fees_per_byte = Tez . of_mutez_exn fees_per_byte in let result = Tez . of_mutez_exn result in let state = Alpha_context . Tx_rollup_state . Internal_for_tests . make ~ fees_per_byte ~ inbox_ema ~ last_inbox...
let test_add_batch ( ) = let contents_size = 5 in let contents = String . make contents_size ' c ' in init_originate_and_submit ~ batch : contents ( ) >>=? fun ( ( contract , balance ) , state , tx_rollup , b ) -> Context . Tx_rollup . inbox ( B b ) tx_rollup >>=? fun { contents ; cumulated_size } -> let length = List ...
let test_add_two_batches ( ) = let contents_size1 = 5 in let contents1 = String . make contents_size1 ' c ' in init_originate_and_submit ~ batch : contents1 ( ) >>=? fun ( ( contract , balance ) , state , tx_rollup , b ) -> Op . tx_rollup_submit_batch ( B b ) contract tx_rollup contents1 >>=? fun op1 -> Context . Contr...
let test_batch_too_big ( ) = context_init 1 >>=? fun ( b , contracts ) -> let contract = WithExceptions . Option . get ~ loc : __LOC__ @@ List . nth contracts 0 in originate b contract >>=? fun ( b , tx_rollup ) -> Context . get_constants ( B b ) >>=? fun constant -> let contents = String . make constant . parametric ....
let fill_inbox b tx_rollup contract contents k = let message_size = String . length contents in Context . get_constants ( B b ) >>=? fun constant -> let tx_rollup_inbox_limit = constant . parametric . tx_rollup_hard_size_limit_per_inbox in Context . Contract . counter ( B b ) contract >>=? fun counter -> Incremental . ...
let test_inbox_too_big ( ) = context_init 1 >>=? fun ( b , contracts ) -> let contract = WithExceptions . Option . get ~ loc : __LOC__ @@ List . nth contracts 0 in Context . get_constants ( B b ) >>=? fun constant -> let tx_rollup_batch_limit = constant . parametric . tx_rollup_hard_size_limit_per_message - 1 in let co...
let test_finalization ( ) = context_init 2 >>=? fun ( b , contracts ) -> let filler = WithExceptions . Option . get ~ loc : __LOC__ @@ List . nth contracts 0 in let contract = WithExceptions . Option . get ~ loc : __LOC__ @@ List . nth contracts 0 in originate b contract >>=? fun ( b , tx_rollup ) -> Context . get_cons...
let test_inbox_linked_list ( ) = let assert_level_equals ~ loc expected actual = match actual with | None -> assert false | Some level -> Assert . equal ~ loc Raw_level . equal " expected same level " Raw_level . pp expected level in context_init 1 >>=? fun ( b , contracts ) -> let contract = WithExceptions . Option . ...
let tests = [ Tztest . tztest " check feature flag is disabled " ` Quick test_disable_feature_flag ; Tztest . tztest " check tx rollup origination and burn " ` Quick test_origination ; Tztest . tztest " check two originated tx rollup in one operation have different address " ` Quick test_two_originations ; Tztest . tzt...
let wrap_error_lwt x = x >>= fun x -> Lwt . return @@ Environment . wrap_tzresult x
let test_unparse_view ( ) = let dummy_contract = " { parameter unit ; storage unit ; code { CAR ; NIL operation ; PAIR } ; view \ " \ v0 " \ unit unit { DROP ; UNIT } ; view " \ v1 " \ nat nat { CAR } } " in let contract_expr = Expr . from_string dummy_contract in let storage_expr = Expr . from_string " Unit " in let b...
let test_context ( ) = Context . init ~ consensus_threshold : 0 3 >>=? fun ( b , _cs ) -> Incremental . begin_construction b >>=? fun v -> return ( Incremental . alpha_ctxt v )
let test_context_with_nat_nat_big_map ( ) = Context . init 3 >>=? fun ( b , contracts ) -> let source = WithExceptions . Option . get ~ loc : __LOC__ @@ List . hd contracts in Op . contract_origination ( B b ) source ~ script : Op . dummy_script >>=? fun ( operation , originated ) -> Block . bake ~ operation b >>=? fun...
let read_file filename = let ch = open_in filename in let s = really_input_string ch ( in_channel_length ch ) in close_in ch ; s
let test_typecheck_stack_overflow ( ) = test_context ( ) >>=? fun ctxt -> let storage = " Unit " in let parameter = " Unit " in let script = read_file " . / contracts / big_interpreter_stack . tz " in Contract_helpers . run_script ctxt script ~ storage ~ parameter ( ) >>= function | Ok _ -> Alcotest . fail " expected a...
let _test_unparse_stack_overflow ( ) = test_context ( ) >>=? fun ctxt -> let enorme_et_seq n = let rec aux n acc = aux ( n - 1 ) @@ Micheline . Seq ( 0 , [ acc ] ) in aux n ( Micheline . Int ( 0 , Z . zero ) ) in Script_ir_translator . ( unparse_code ctxt Readable ( enorme_et_seq 10_001 ) ) >>= function | Ok _ -> Alcot...
let location = function | Prim ( loc , _ , _ , _ ) | Int ( loc , _ ) | String ( loc , _ ) | Bytes ( loc , _ ) | Seq ( loc , _ ) -> loc
let test_parse_ty ctxt node expected = let legacy = false in let allow_lazy_storage = true in let allow_operation = true in let allow_contract = true in let allow_ticket = true in Environment . wrap_tzresult ( Script_ir_translator . parse_ty ctxt ~ legacy ~ allow_lazy_storage ~ allow_operation ~ allow_contract ~ allow_...
let test_parse_comb_type ( ) = let open Script in let open Script_typed_ir in let nat_prim = Prim ( - 1 , T_nat , [ ] , [ ] ) in let nat_prim_a = Prim ( - 1 , T_nat , [ ] , [ " % a " ] ) in let nat_prim_b = Prim ( - 1 , T_nat , [ ] , [ " % b " ] ) in let nat_prim_c = Prim ( - 1 , T_nat , [ ] , [ " % c " ] ) in let nat_...
let test_unparse_ty loc ctxt expected ty = Environment . wrap_tzresult ( Script_ir_translator . unparse_ty ~ loc ( ) : ctxt ty >>? fun ( actual , ctxt ) -> if actual = expected then ok ctxt else Alcotest . failf " Unexpected error : % s " loc )
let test_unparse_comb_type ( ) = let open Script in let open Script_typed_ir in let nat_prim = Prim ( ( ) , T_nat , [ ] , [ ] ) in let nat_ty = nat_t in let pair_prim l = Prim ( ( ) , T_pair , l , [ ] ) in let pair_ty ty1 ty2 = pair_t ( - 1 ) ty1 ty2 in let pair_prim2 a b = pair_prim [ a ; b ] in let pair_nat_nat_prim ...
let test_unparse_comparable_ty loc ctxt expected ty = let open Script_typed_ir in Environment . wrap_tzresult ( set_t ( - 1 ) ty >>? fun set_ty_ty -> Script_ir_translator . unparse_ty ~ loc ( ) : ctxt set_ty_ty >>? fun ( actual , ctxt ) -> if actual = Prim ( ( ) , T_set , [ expected ] , [ ] ) then ok ctxt else Alcotest...
let test_unparse_comb_comparable_type ( ) = let open Script in let open Script_typed_ir in let nat_prim = Prim ( ( ) , T_nat , [ ] , [ ] ) in let nat_ty = nat_key in let pair_prim l = Prim ( ( ) , T_pair , l , [ ] ) in let pair_ty ty1 ty2 = pair_key ( - 1 ) ty1 ty2 in let pair_prim2 a b = pair_prim [ a ; b ] in let pai...
let test_parse_data ( ? equal = Stdlib . ( = ) ) loc ctxt ty node expected = let legacy = false in let allow_forged = true in wrap_error_lwt ( Script_ir_translator . parse_data ctxt ~ legacy ~ allow_forged ty node >>=? fun ( actual , ctxt ) -> if equal actual expected then return ctxt else Alcotest . failf " Unexpected...
let test_parse_data_fails loc ctxt ty node = let legacy = false in let allow_forged = false in wrap_error_lwt ( Script_ir_translator . parse_data ctxt ~ legacy ~ allow_forged ty node >>= function | Ok _ -> Alcotest . failf " Unexpected typechecking success : % s " loc | Error trace -> let trace_string = Format . asprin...
let test_parse_comb_data ( ) = let open Script in let open Script_typed_ir in let z = Script_int . zero_n in let z_prim = Micheline . Int ( - 1 , Z . zero ) in let nat_ty = nat_t in let pair_prim l = Prim ( - 1 , D_Pair , l , [ ] ) in let pair_ty ty1 ty2 = pair_t ( - 1 ) ty1 ty2 in pair_ty nat_ty nat_ty >>??= fun pair_...
let test_parse_address ( ) = let open Script_typed_ir in test_context_with_nat_nat_big_map ( ) >>=? fun ( ctxt , _big_map_id ) -> wrap_error_lwt ( Lwt . return ( Contract . of_b58check " KT1FAKEFAKEFAKEFAKEFAKEFAKEFAKGGSE2x " ) ) >>=? fun kt1fake -> test_parse_data __LOC__ ctxt address_t ( String ( - 1 , " KT1FAKEFAKEF...
let test_unparse_data loc ctxt ty x ~ expected_readable ~ expected_optimized = wrap_error_lwt ( Script_ir_translator . unparse_data ctxt Script_ir_translator . Readable ty x >>=? fun ( actual_readable , ctxt ) -> ( if actual_readable = expected_readable then return ctxt else Alcotest . failf " Error in readable unparsi...
let test_unparse_comb_data ( ) = let open Script in let open Script_typed_ir in let z = Script_int . zero_n in let z_prim = Micheline . Int ( - 1 , Z . zero ) in let nat_ty = nat_t in let pair_prim l = Prim ( - 1 , D_Pair , l , [ ] ) in let pair_ty ty1 ty2 = pair_t ( - 1 ) ty1 ty2 in pair_ty nat_ty nat_ty >>??= fun pai...
let gen_pairs left right = [ Prim ( ( ) , Script . D_Pair , [ left ; right ] , [ ] ) ; Seq ( ( ) , [ left ; right ] ) ]
let rec gen_combs leaf arity = assert ( arity >= 2 ) ; if arity = 2 then gen_pairs leaf leaf else gen_combs leaf ( arity - 1 ) |> List . map ( fun smaller -> ( match smaller with | Prim ( loc , Script . D_Pair , vs , [ ] ) -> Prim ( loc , Script . D_Pair , leaf :: vs , [ ] ) | Seq ( loc , vs ) -> Seq ( loc , leaf :: vs...
let test_optimal_comb ( ) = let open Script_typed_ir in let leaf_ty = nat_t in let leaf_mich = Int ( ( ) , Z . zero ) in let leaf_v = Script_int . zero_n in let size_of_micheline mich = let canonical = Micheline . strip_locations mich in ( canonical , Bytes . length @@ Data_encoding . Binary . to_bytes_exn Script . exp...
let test_contract_not_packable ( ) = let contract_unit = Prim ( 0 , Script . T_contract , [ Prim ( 0 , T_unit , [ ] , [ ] ) ] , [ ] ) in test_context ( ) >>=? fun ctxt -> ( match Script_ir_translator . parse_any_ty ctxt ~ legacy : false contract_unit with | Ok _ -> return_unit | Error _ -> Alcotest . failf " Could not ...