Fix minor typos in wrong michelson contract parameter/storage msgs

This commit is contained in:
John David Pressman 2020-01-01 14:15:49 -08:00 committed by Lesenechal Remi
parent e834e2ac20
commit 5108b820cf

View File

@ -6,15 +6,15 @@ module Errors = struct
let title_type_check_msg () = "Invalid contract" let title_type_check_msg () = "Invalid contract"
let bad_parameter () = let bad_parameter () =
let message () = let message () =
"bad contract parameter type (some michelson type are forbidden as contract parameter)" in "bad contract parameter type (some michelson types are forbidden as contract parameter)" in
error title_type_check_msg message error title_type_check_msg message
let bad_storage () = let bad_storage () =
let message () = let message () =
"bad storage type (some michelson type are forbidden as contract storage)" in "bad storage type (some michelson types are forbidden as contract storage)" in
error title_type_check_msg message error title_type_check_msg message
let bad_contract () = let bad_contract () =
let message () = let message () =
"bad contract type (contract entry point is expected to be of the form `parameter * storage -> list(operation) * storage`)" in "bad contract type (contract entry point is expected to be of the form \"parameter * storage -> list(operation) * storage\")" in
error title_type_check_msg message error title_type_check_msg message
let unknown () = let unknown () =
let message () = let message () =
@ -32,7 +32,7 @@ let build_contract : Compiler.compiled_expression -> Michelson.michelson result
Trace.trace_tzresult_lwt (simple_error "Could not unparse storage") @@ Trace.trace_tzresult_lwt (simple_error "Could not unparse storage") @@
Proto_alpha_utils.Memory_proto_alpha.unparse_ty_michelson _storage_ty in Proto_alpha_utils.Memory_proto_alpha.unparse_ty_michelson _storage_ty in
let contract = Michelson.contract param_michelson storage_michelson compiled.expr in let contract = Michelson.contract param_michelson storage_michelson compiled.expr in
let%bind res = let%bind res =
Trace.trace_tzresult_lwt (simple_error "Could not typecheck the code") @@ Trace.trace_tzresult_lwt (simple_error "Could not typecheck the code") @@
Proto_alpha_utils.Memory_proto_alpha.typecheck_contract contract in Proto_alpha_utils.Memory_proto_alpha.typecheck_contract contract in
match res with match res with
@ -54,4 +54,4 @@ let assert_equal_contract_type : check_type -> Compiler.compiled_expression -> C
let%bind _ = let%bind _ =
Trace.trace_tzresult (simple_error "Passed parameter does not match the contract type") @@ Trace.trace_tzresult (simple_error "Passed parameter does not match the contract type") @@
Proto_alpha_utils.Memory_proto_alpha.assert_equal_michelson_type expected_ty actual_ty in Proto_alpha_utils.Memory_proto_alpha.assert_equal_michelson_type expected_ty actual_ty in
ok () ok ()