Verified Commit 94cfcfd2 authored by Dan's avatar Dan Committed by Marco Stronati

Alpha/RPCs: rename Michelson interpreter diagnostics field names

This patch changes some error IDs and error attributes to make it
consistent with the rest of the codebase.

Third party development tools that recognise errors based on this
should be updated.As errors are only read, a simple solution is to
support both during the protocol change period.
parent 7b4fe1b9
......@@ -554,12 +554,12 @@ let prim_encoding =
let () =
register_error_kind
`Permanent
~id:"unknownPrimitiveNameTypeError"
~title: "Unknown primitive name (typechecking error)"
~id:"michelson_v1.unknown_primitive_name"
~title: "Unknown primitive name"
~description:
"In a script or data expression, a primitive was unknown."
~pp:(fun ppf n -> Format.fprintf ppf "Unknown primitive %s." n)
Data_encoding.(obj1 (req "wrongPrimitiveName" string))
Data_encoding.(obj1 (req "wrong_primitive_name" string))
(function
| Unknown_primitive_name got -> Some got
| _ -> None)
......@@ -567,13 +567,13 @@ let () =
Unknown_primitive_name got) ;
register_error_kind
`Permanent
~id:"invalidPrimitiveNameCaseTypeError"
~title: "Invalid primitive name case (typechecking error)"
~id:"michelson_v1.invalid_primitive_name_case"
~title: "Invalid primitive name case"
~description:
"In a script or data expression, a primitive name is \
neither uppercase, lowercase or capitalized."
~pp:(fun ppf n -> Format.fprintf ppf "Primitive %s has invalid case." n)
Data_encoding.(obj1 (req "wrongPrimitiveName" string))
Data_encoding.(obj1 (req "wrong_primitive_name" string))
(function
| Invalid_case name -> Some name
| _ -> None)
......@@ -581,8 +581,8 @@ let () =
Invalid_case name) ;
register_error_kind
`Permanent
~id:"invalidPrimitiveNameTypeErro"
~title: "Invalid primitive name (typechecking error)"
~id:"michelson_v1.invalid_primitive_name"
~title: "Invalid primitive name"
~description:
"In a script or data expression, a primitive name is \
unknown or has a wrong case."
......
......@@ -55,8 +55,8 @@ let () =
(* Reject *)
register_error_kind
`Temporary
~id:"scriptRejectedRuntimeError"
~title: "Script failed (runtime script error)"
~id:"michelson_v1.script_rejected"
~title: "Script failed"
~description: "A FAILWITH instruction was reached"
(obj3
(req "location" Script.location_encoding)
......@@ -67,7 +67,7 @@ let () =
(* Overflow *)
register_error_kind
`Temporary
~id:"scriptOverflowRuntimeError"
~id:"michelson_v1.script_overflow"
~title: "Script failed (overflow error)"
~description: "A FAIL instruction was reached due to the detection of an overflow"
(obj2
......@@ -78,12 +78,12 @@ let () =
(* Runtime contract error *)
register_error_kind
`Temporary
~id:"scriptRuntimeError"
~id:"michelson_v1.runtime_error"
~title: "Script runtime error"
~description: "Toplevel error for all runtime script errors"
(obj2
(req "contractHandle" Contract.encoding)
(req "contractCode" Script.expr_encoding))
(req "contract_handle" Contract.encoding)
(req "contract_code" Script.expr_encoding))
(function
| Runtime_contract_error (contract, expr) ->
Some (contract, expr)
......@@ -93,7 +93,7 @@ let () =
(* Bad contract parameter *)
register_error_kind
`Permanent
~id:"badContractParameter"
~id:"michelson_v1.bad_contract_parameter"
~title:"Contract supplied an invalid parameter"
~description:"Either no parameter was supplied to a contract with \
a non-unit parameter type, a non-unit parameter was \
......@@ -105,7 +105,7 @@ let () =
(* Cannot serialize log *)
register_error_kind
`Temporary
~id:"cannotSerializeLog"
~id:"michelson_v1.cannot_serialize_log"
~title:"Not enough gas to serialize execution trace"
~description:"Execution trace with stacks was to big to be serialized with \
the provided gas"
......@@ -115,7 +115,7 @@ let () =
(* Cannot serialize failure *)
register_error_kind
`Temporary
~id:"cannotSerializeFailure"
~id:"michelson_v1.cannot_serialize_failure"
~title:"Not enough gas to serialize argument of FAILWITH"
~description:"Argument of FAILWITH was too big to be serialized with \
the provided gas"
......@@ -125,7 +125,7 @@ let () =
(* Cannot serialize storage *)
register_error_kind
`Temporary
~id:"cannotSerializeStorage"
~id:"michelson_v1.cannot_serialize_storage"
~title:"Not enough gas to serialize execution storage"
~description:"The returned storage was too big to be serialized with \
the provided gas"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment