test passed

This commit is contained in:
Pierre-Emmanuel Wulfman 2020-03-12 23:24:10 +01:00
parent 2abd737ed3
commit 6dfd2dac32
12 changed files with 66 additions and 46 deletions

View File

@ -4,7 +4,9 @@ open Trace
open Test_helpers open Test_helpers
let type_file f = let type_file f =
let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in let%bind abstracted = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in
let%bind complex = Ligo.Compile.Of_abstracted.compile abstracted in
let%bind simplified = Ligo.Compile.Of_complex.compile complex in
let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
ok @@ (typed,state) ok @@ (typed,state)
@ -20,8 +22,7 @@ let get_program =
) )
let compile_main () = let compile_main () =
let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/coase.ligo" (Syntax_name "pascaligo") in let%bind typed_prg = get_program () in
let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in
let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in
let%bind (_contract: Tezos_utils.Michelson.michelson) = let%bind (_contract: Tezos_utils.Michelson.michelson) =

View File

@ -3,7 +3,9 @@ open Test_helpers
open Ast_simplified open Ast_simplified
let type_file f = let type_file f =
let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in let%bind abstracted = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in
let%bind complex = Ligo.Compile.Of_abstracted.compile abstracted in
let%bind simplified = Ligo.Compile.Of_complex.compile complex in
let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
ok @@ (typed,state) ok @@ (typed,state)
@ -18,8 +20,7 @@ let get_program =
) )
let compile_main () = let compile_main () =
let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/hashlock.mligo" (Syntax_name "cameligo") in let%bind typed_prg,_ = get_program () in
let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in
let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in
let%bind (_contract: Tezos_utils.Michelson.michelson) = let%bind (_contract: Tezos_utils.Michelson.michelson) =

View File

@ -4,7 +4,9 @@ open Ast_simplified
let mtype_file f = let mtype_file f =
let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in let%bind abstracted = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in
let%bind complex = Ligo.Compile.Of_abstracted.compile abstracted in
let%bind simplified = Ligo.Compile.Of_complex.compile complex in
let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
ok (typed,state) ok (typed,state)
@ -19,8 +21,7 @@ let get_program =
) )
let compile_main () = let compile_main () =
let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/id.mligo" (Syntax_name "cameligo") in let%bind typed_prg,_ = get_program () in
let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in
let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in
let%bind (_contract: Tezos_utils.Michelson.michelson) = let%bind (_contract: Tezos_utils.Michelson.michelson) =

View File

@ -4,18 +4,24 @@ open Test_helpers
open Ast_simplified.Combinators open Ast_simplified.Combinators
let retype_file f = let retype_file f =
let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "reasonligo") in let%bind abstracted = Ligo.Compile.Of_source.compile f (Syntax_name "reasonligo") in
let%bind complex = Ligo.Compile.Of_abstracted.compile abstracted in
let%bind simplified = Ligo.Compile.Of_complex.compile complex in
let%bind typed,state = Ligo.Compile.Of_simplified.compile Env simplified in let%bind typed,state = Ligo.Compile.Of_simplified.compile Env simplified in
let () = Typer.Solver.discard_state state in let () = Typer.Solver.discard_state state in
let () = Typer.Solver.discard_state state in let () = Typer.Solver.discard_state state in
ok typed ok typed
let mtype_file f = let mtype_file f =
let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in let%bind abstracted = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in
let%bind complex = Ligo.Compile.Of_abstracted.compile abstracted in
let%bind simplified = Ligo.Compile.Of_complex.compile complex in
let%bind typed,state = Ligo.Compile.Of_simplified.compile Env simplified in let%bind typed,state = Ligo.Compile.Of_simplified.compile Env simplified in
let () = Typer.Solver.discard_state state in let () = Typer.Solver.discard_state state in
ok typed ok typed
let type_file f = let type_file f =
let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in let%bind abstracted = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in
let%bind complex = Ligo.Compile.Of_abstracted.compile abstracted in
let%bind simplified = Ligo.Compile.Of_complex.compile complex in
let%bind typed,state = Ligo.Compile.Of_simplified.compile Env simplified in let%bind typed,state = Ligo.Compile.Of_simplified.compile Env simplified in
let () = Typer.Solver.discard_state state in let () = Typer.Solver.discard_state state in
ok typed ok typed

View File

@ -68,7 +68,9 @@ let compile_groups _filename grp_list =
(fun ((s,grp),contents) -> (fun ((s,grp),contents) ->
trace (failed_to_compile_md_file _filename (s,grp,contents)) @@ trace (failed_to_compile_md_file _filename (s,grp,contents)) @@
let%bind v_syntax = Compile.Helpers.syntax_to_variant (Syntax_name s) None in let%bind v_syntax = Compile.Helpers.syntax_to_variant (Syntax_name s) None in
let%bind simplified = Compile.Of_source.compile_string contents v_syntax in let%bind abstracted = Compile.Of_source.compile_string contents v_syntax in
let%bind complex = Ligo.Compile.Of_abstracted.compile abstracted in
let%bind simplified = Ligo.Compile.Of_complex.compile complex in
let%bind typed,_ = Compile.Of_simplified.compile Env simplified in let%bind typed,_ = Compile.Of_simplified.compile Env simplified in
let%bind mini_c = Compile.Of_typed.compile typed in let%bind mini_c = Compile.Of_typed.compile typed in
bind_map_list bind_map_list

View File

@ -6,7 +6,9 @@ let mfile = "./contracts/multisig.mligo"
let refile = "./contracts/multisig.religo" let refile = "./contracts/multisig.religo"
let type_file f s = let type_file f s =
let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name s) in let%bind abstracted = Ligo.Compile.Of_source.compile f (Syntax_name s) in
let%bind complex = Ligo.Compile.Of_abstracted.compile abstracted in
let%bind simplified = Ligo.Compile.Of_complex.compile complex in
let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
ok @@ (typed,state) ok @@ (typed,state)

View File

@ -2,7 +2,9 @@ open Trace
open Test_helpers open Test_helpers
let type_file f = let type_file f =
let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in let%bind abstracted = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in
let%bind complex = Ligo.Compile.Of_abstracted.compile abstracted in
let%bind simplified = Ligo.Compile.Of_complex.compile complex in
let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
ok @@ (typed,state) ok @@ (typed,state)
@ -17,8 +19,7 @@ let get_program =
) )
let compile_main () = let compile_main () =
let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/multisig-v2.ligo" (Syntax_name "pascaligo") in let%bind typed_prg,_ = get_program () in
let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in
let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in
let%bind (_contract: Tezos_utils.Michelson.michelson) = let%bind (_contract: Tezos_utils.Michelson.michelson) =
@ -35,7 +36,7 @@ let empty_message = e_lambda (Var.of_name "arguments")
empty_op_list empty_op_list
let empty_message2 = e_lambda (Var.of_name "arguments") let empty_message2 = e_lambda (Var.of_name "arguments")
(Some t_bytes) (Some (t_list t_operation)) (Some t_bytes) (Some (t_list t_operation))
( e_let_in ((Var.of_name "foo"),Some t_unit) false false (e_unit ()) empty_op_list) ( e_let_in ((Var.of_name "foo"),Some t_unit) false (e_unit ()) empty_op_list)
let send_param msg = e_constructor "Send" msg let send_param msg = e_constructor "Send" msg
let withdraw_param = e_constructor "Withdraw" empty_message let withdraw_param = e_constructor "Withdraw" empty_message

View File

@ -4,7 +4,9 @@ open Ast_simplified
let retype_file f = let retype_file f =
let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "reasonligo") in let%bind abstracted = Ligo.Compile.Of_source.compile f (Syntax_name "reasonligo") in
let%bind complex = Ligo.Compile.Of_abstracted.compile abstracted in
let%bind simplified = Ligo.Compile.Of_complex.compile complex in
let%bind typed,state = Ligo.Compile.Of_simplified.compile Env simplified in let%bind typed,state = Ligo.Compile.Of_simplified.compile Env simplified in
ok (typed,state) ok (typed,state)
@ -19,8 +21,7 @@ let get_program =
) )
let compile_main () = let compile_main () =
let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/pledge.religo" (Syntax_name "reasonligo") in let%bind typed_prg,_ = get_program () in
let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile Env simplified in
let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in
let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in
let%bind (_contract: Tezos_utils.Michelson.michelson) = let%bind (_contract: Tezos_utils.Michelson.michelson) =

View File

@ -2,7 +2,9 @@ open Trace
open Test_helpers open Test_helpers
let type_file f = let type_file f =
let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in let%bind abstracted = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in
let%bind complex = Ligo.Compile.Of_abstracted.compile abstracted in
let%bind simplified = Ligo.Compile.Of_complex.compile complex in
let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
ok @@ (typed,state) ok @@ (typed,state)
@ -17,8 +19,7 @@ let get_program =
) )
let compile_main () = let compile_main () =
let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/replaceable_id.ligo" (Syntax_name "pascaligo") in let%bind typed_prg,_ = get_program () in
let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in
let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in
let%bind (_contract: Tezos_utils.Michelson.michelson) = let%bind (_contract: Tezos_utils.Michelson.michelson) =

View File

@ -3,7 +3,9 @@ open Test_helpers
open Ast_simplified open Ast_simplified
let type_file f = let type_file f =
let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in let%bind abstracted = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in
let%bind complex = Ligo.Compile.Of_abstracted.compile abstracted in
let%bind simplified = Ligo.Compile.Of_complex.compile complex in
let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
ok @@ (typed,state) ok @@ (typed,state)
@ -18,8 +20,7 @@ let get_program =
) )
let compile_main () = let compile_main () =
let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/timelock_repeat.mligo" (Syntax_name "cameligo") in let%bind typed_prg,_ = type_file "./contracts/timelock_repeat.mligo" in
let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in
let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in
let%bind (_contract: Tezos_utils.Michelson.michelson) = let%bind (_contract: Tezos_utils.Michelson.michelson) =

View File

@ -2,7 +2,9 @@ open Trace
open Test_helpers open Test_helpers
let type_file f = let type_file f =
let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in let%bind abstracted = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in
let%bind complex = Ligo.Compile.Of_abstracted.compile abstracted in
let%bind simplified = Ligo.Compile.Of_complex.compile complex in
let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
ok @@ (typed,state) ok @@ (typed,state)
@ -17,8 +19,7 @@ let get_program =
) )
let compile_main () = let compile_main () =
let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/time-lock.ligo" (Syntax_name "pascaligo") in let%bind typed_prg,_ = type_file "./contracts/time-lock.ligo" in
let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in
let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in
let%bind (_contract: Tezos_utils.Michelson.michelson) = let%bind (_contract: Tezos_utils.Michelson.michelson) =

View File

@ -2,7 +2,9 @@ open Trace
open Test_helpers open Test_helpers
let type_file f = let type_file f =
let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in let%bind abstracted = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in
let%bind complex = Ligo.Compile.Of_abstracted.compile abstracted in
let%bind simplified = Ligo.Compile.Of_complex.compile complex in
let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in
ok @@ (typed,state) ok @@ (typed,state)