From 6f07a25a3c3056c6ff474a0df10c5c99c34b6200 Mon Sep 17 00:00:00 2001 From: Benjamin Canou Date: Mon, 7 Jan 2019 14:46:04 -0500 Subject: [PATCH] Revert protocol Alpha to 003-PsddFKi3 --- src/proto_alpha/lib_protocol/src/amendment.ml | 2 +- .../src/michelson_v1_primitives.ml | 16 +- .../lib_protocol/src/operation_repr.ml | 2 +- .../lib_protocol/src/roll_storage.ml | 2 +- .../lib_protocol/src/script_interpreter.ml | 20 +- .../lib_protocol/src/script_ir_translator.ml | 4 +- .../src/script_tc_errors_registration.ml | 196 +++++++++--------- .../lib_protocol/src/voting_services.ml | 4 +- 8 files changed, 123 insertions(+), 123 deletions(-) diff --git a/src/proto_alpha/lib_protocol/src/amendment.ml b/src/proto_alpha/lib_protocol/src/amendment.ml index af87c3b33..75ad7c65e 100644 --- a/src/proto_alpha/lib_protocol/src/amendment.ml +++ b/src/proto_alpha/lib_protocol/src/amendment.ml @@ -212,7 +212,7 @@ let rec longer_than l n = let record_proposals ctxt delegate proposals = begin match proposals with | [] -> fail Empty_proposal - | _ :: _ -> return_unit + | _ :: _ -> return () end >>=? fun () -> Vote.get_current_period_kind ctxt >>=? function | Proposal -> diff --git a/src/proto_alpha/lib_protocol/src/michelson_v1_primitives.ml b/src/proto_alpha/lib_protocol/src/michelson_v1_primitives.ml index d80f5f7eb..29c2db441 100644 --- a/src/proto_alpha/lib_protocol/src/michelson_v1_primitives.ml +++ b/src/proto_alpha/lib_protocol/src/michelson_v1_primitives.ml @@ -554,12 +554,12 @@ let prim_encoding = let () = register_error_kind `Permanent - ~id:"michelson_v1.unknown_primitive_name" - ~title: "Unknown primitive name" + ~id:"unknownPrimitiveNameTypeError" + ~title: "Unknown primitive name (typechecking error)" ~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 "wrong_primitive_name" string)) + Data_encoding.(obj1 (req "wrongPrimitiveName" string)) (function | Unknown_primitive_name got -> Some got | _ -> None) @@ -567,13 +567,13 @@ let () = Unknown_primitive_name got) ; register_error_kind `Permanent - ~id:"michelson_v1.invalid_primitive_name_case" - ~title: "Invalid primitive name case" + ~id:"invalidPrimitiveNameCaseTypeError" + ~title: "Invalid primitive name case (typechecking error)" ~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 "wrong_primitive_name" string)) + Data_encoding.(obj1 (req "wrongPrimitiveName" string)) (function | Invalid_case name -> Some name | _ -> None) @@ -581,8 +581,8 @@ let () = Invalid_case name) ; register_error_kind `Permanent - ~id:"michelson_v1.invalid_primitive_name" - ~title: "Invalid primitive name" + ~id:"invalidPrimitiveNameTypeErro" + ~title: "Invalid primitive name (typechecking error)" ~description: "In a script or data expression, a primitive name is \ unknown or has a wrong case." diff --git a/src/proto_alpha/lib_protocol/src/operation_repr.ml b/src/proto_alpha/lib_protocol/src/operation_repr.ml index 17a62d71c..f6302e130 100644 --- a/src/proto_alpha/lib_protocol/src/operation_repr.ml +++ b/src/proto_alpha/lib_protocol/src/operation_repr.ml @@ -253,7 +253,7 @@ module Encoding = struct name = "origination" ; encoding = (obj6 - (req "manager_pubkey" Signature.Public_key_hash.encoding) + (req "managerPubkey" Signature.Public_key_hash.encoding) (req "balance" Tez_repr.encoding) (dft "spendable" bool true) (dft "delegatable" bool true) diff --git a/src/proto_alpha/lib_protocol/src/roll_storage.ml b/src/proto_alpha/lib_protocol/src/roll_storage.ml index 5e23d4ece..0f1075f16 100644 --- a/src/proto_alpha/lib_protocol/src/roll_storage.ml +++ b/src/proto_alpha/lib_protocol/src/roll_storage.ml @@ -297,7 +297,7 @@ module Delegate = struct | None -> (* This case is only when called from `set_active`, when creating a contract. *) - return_false + return false let add_amount c delegate amount = ensure_inited c delegate >>=? fun c -> diff --git a/src/proto_alpha/lib_protocol/src/script_interpreter.ml b/src/proto_alpha/lib_protocol/src/script_interpreter.ml index 04229a1aa..5229e542f 100644 --- a/src/proto_alpha/lib_protocol/src/script_interpreter.ml +++ b/src/proto_alpha/lib_protocol/src/script_interpreter.ml @@ -55,8 +55,8 @@ let () = (* Reject *) register_error_kind `Temporary - ~id:"michelson_v1.script_rejected" - ~title: "Script failed" + ~id:"scriptRejectedRuntimeError" + ~title: "Script failed (runtime script error)" ~description: "A FAILWITH instruction was reached" (obj3 (req "location" Script.location_encoding) @@ -67,7 +67,7 @@ let () = (* Overflow *) register_error_kind `Temporary - ~id:"michelson_v1.script_overflow" + ~id:"scriptOverflowRuntimeError" ~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:"michelson_v1.runtime_error" + ~id:"scriptRuntimeError" ~title: "Script runtime error" ~description: "Toplevel error for all runtime script errors" (obj2 - (req "contract_handle" Contract.encoding) - (req "contract_code" Script.expr_encoding)) + (req "contractHandle" Contract.encoding) + (req "contractCode" 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:"michelson_v1.bad_contract_parameter" + ~id:"badContractParameter" ~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:"michelson_v1.cannot_serialize_log" + ~id:"cannotSerializeLog" ~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:"michelson_v1.cannot_serialize_failure" + ~id:"cannotSerializeFailure" ~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:"michelson_v1.cannot_serialize_storage" + ~id:"cannotSerializeStorage" ~title:"Not enough gas to serialize execution storage" ~description:"The returned storage was too big to be serialized with \ the provided gas" diff --git a/src/proto_alpha/lib_protocol/src/script_ir_translator.ml b/src/proto_alpha/lib_protocol/src/script_ir_translator.ml index ad3a283df..d2e3d7b74 100644 --- a/src/proto_alpha/lib_protocol/src/script_ir_translator.ml +++ b/src/proto_alpha/lib_protocol/src/script_ir_translator.ml @@ -1617,7 +1617,7 @@ and parse_instr let log_stack ctxt loc stack_ty aft = match type_logger, script_instr with | None, _ - | Some _, (Seq (-1, _) | Int _ | String _ | Bytes _) -> return_unit + | Some _, (Seq (-1, _) | Int _ | String _ | Bytes _) -> return () | Some log, (Prim _ | Seq _) -> (* Unparsing for logging done in an unlimited context as this is used only by the client and not the protocol *) @@ -1625,7 +1625,7 @@ and parse_instr unparse_stack ctxt stack_ty >>=? fun (stack_ty, _) -> unparse_stack ctxt aft >>=? fun (aft, _) -> log loc stack_ty aft; - return_unit + return () in let return : context -> bef judgement -> (bef judgement * context) tzresult Lwt.t = fun ctxt judgement -> diff --git a/src/proto_alpha/lib_protocol/src/script_tc_errors_registration.ml b/src/proto_alpha/lib_protocol/src/script_tc_errors_registration.ml index 10347b6a7..43f874c98 100644 --- a/src/proto_alpha/lib_protocol/src/script_tc_errors_registration.ml +++ b/src/proto_alpha/lib_protocol/src/script_tc_errors_registration.ml @@ -37,8 +37,8 @@ let type_map_enc = (fun (loc, bef, aft) -> (loc, (bef, aft))) (obj3 (req "location" Script.location_encoding) - (req "stack_before" stack_enc) - (req "stack_after" stack_enc))) + (req "stackBefore" stack_enc) + (req "stackAfter" stack_enc))) let stack_ty_enc = let open Data_encoding in @@ -80,15 +80,15 @@ let () = (* Invalid arity *) register_error_kind `Permanent - ~id:"michelson_v1.invalid_arity" - ~title: "Invalid arity" + ~id:"invalidArityTypeError" + ~title: "Invalid arity (typechecking error)" ~description: "In a script or data expression, a primitive was applied \ to an unsupported number of arguments." (located (obj3 - (req "primitive_name" Script.prim_encoding) - (req "expected_arity" arity_enc) - (req "wrong_arity" arity_enc))) + (req "primitiveName" Script.prim_encoding) + (req "expectedArity" arity_enc) + (req "wrongArity" arity_enc))) (function | Invalid_arity (loc, name, exp, got) -> Some (loc, (name, exp, got)) @@ -98,7 +98,7 @@ let () = (* Missing field *) register_error_kind `Permanent - ~id:"michelson_v1.missing_script_field" + ~id:"missingScriptField" ~title:"Script is missing a field (parse error)" ~description: "When parsing script, a field was expected, but not provided" @@ -108,13 +108,13 @@ let () = (* Invalid primitive *) register_error_kind `Permanent - ~id:"michelson_v1.invalid_primitive" - ~title: "Invalid primitive" + ~id:"invalidPrimitiveTypeError" + ~title: "Invalid primitive (typechecking error)" ~description: "In a script or data expression, a primitive was unknown." (located (obj2 - (dft "expected_primitive_names" (list prim_encoding) []) - (req "wrong_primitive_name" prim_encoding))) + (dft "expectedPrimitiveNames" (list prim_encoding) []) + (req "wrongPrimitiveName" prim_encoding))) (function | Invalid_primitive (loc, exp, got) -> Some (loc, (exp, got)) | _ -> None) @@ -123,14 +123,14 @@ let () = (* Invalid kind *) register_error_kind `Permanent - ~id:"michelson_v1.invalid_expression_kind" - ~title: "Invalid expression kind" + ~id:"invalidExpressionKindTypeError" + ~title: "Invalid expression kind (typechecking error)" ~description: "In a script or data expression, an expression was of the wrong kind \ (for instance a string where only a primitive applications can appear)." (located (obj2 - (req "expected_kinds" (list kind_enc)) - (req "wrong_kind" kind_enc))) + (req "expectedKinds" (list kind_enc)) + (req "wrongKind" kind_enc))) (function | Invalid_kind (loc, exp, got) -> Some (loc, (exp, got)) | _ -> None) @@ -139,14 +139,14 @@ let () = (* Invalid namespace *) register_error_kind `Permanent - ~id:"michelson_v1.invalid_primitive_namespace" - ~title: "Invalid primitive namespace" + ~id:"invalidPrimitiveNamespaceTypeError" + ~title: "Invalid primitive namespace (typechecking error)" ~description: "In a script or data expression, a primitive was of the wrong namespace." (located (obj3 - (req "primitive_name" prim_encoding) - (req "expected_namespace" namespace_enc) - (req "wrong_namespace" namespace_enc))) + (req "primitiveName" prim_encoding) + (req "expectedNamespace" namespace_enc) + (req "wrongNamespace" namespace_enc))) (function | Invalid_namespace (loc, name, exp, got) -> Some (loc, (name, exp, got)) | _ -> None) @@ -155,7 +155,7 @@ let () = (* Duplicate field *) register_error_kind `Permanent - ~id:"michelson_v1.duplicate_script_field" + ~id:"duplicateScriptField" ~title: "Script has a duplicated field (parse error)" ~description: "When parsing script, a field was found more than once" @@ -167,7 +167,7 @@ let () = (* Unexpected big_map *) register_error_kind `Permanent - ~id:"michelson_v1.unexpected_bigmap" + ~id:"unexpectedBigMap" ~title: "Big map in unauthorized position (type error)" ~description: "When parsing script, a big_map type was found somewhere else \ @@ -179,7 +179,7 @@ let () = (* Unexpected operation *) register_error_kind `Permanent - ~id:"michelson_v1.unexpected_operation" + ~id:"unexpectedOperation" ~title: "Big map in unauthorized position (type error)" ~description: "When parsing script, a operation type was found \ @@ -192,7 +192,7 @@ let () = (* Unordered map keys *) register_error_kind `Permanent - ~id:"michelson_v1.unordered_map_literal" + ~id:"unorderedMapLiteral" ~title:"Invalid map key order" ~description:"Map keys must be in strictly increasing order" (obj2 @@ -205,7 +205,7 @@ let () = (* Duplicate map keys *) register_error_kind `Permanent - ~id:"michelson_v1.duplicate_map_keys" + ~id:"duplicateMapKeys" ~title:"Duplicate map keys" ~description:"Map literals cannot contain duplicated keys" (obj2 @@ -218,7 +218,7 @@ let () = (* Unordered set values *) register_error_kind `Permanent - ~id:"michelson_v1.unordered_set_literal" + ~id:"unorderedSetLiteral" ~title:"Invalid set value order" ~description:"Set values must be in strictly increasing order" (obj2 @@ -231,7 +231,7 @@ let () = (* Duplicate set values *) register_error_kind `Permanent - ~id:"michelson_v1.duplicate_set_values_in_literal" + ~id:"duplicateSetValuesInLiteral" ~title:"Sets literals cannot contain duplicate elements" ~description:"Set literals cannot contain duplicate elements, \ but a duplicae was found while parsing." @@ -246,8 +246,8 @@ let () = (* Fail not in tail position *) register_error_kind `Permanent - ~id:"michelson_v1.fail_not_in_tail_position" - ~title: "FAIL not in tail position" + ~id:"failNotInTailPositionTypeError" + ~title: "FAIL not in tail position (typechecking error)" ~description: "There is non trivial garbage code after a FAIL instruction." (located empty) @@ -259,15 +259,15 @@ let () = (* Undefined binary operation *) register_error_kind `Permanent - ~id:"michelson_v1.undefined_binop" - ~title: "Undefined binop" + ~id:"undefinedBinopTypeError" + ~title: "Undefined binop (typechecking error)" ~description: "A binary operation is called on operands of types \ over which it is not defined." (located (obj3 - (req "operator_name" prim_encoding) - (req "wrong_left_operand_type" Script.expr_encoding) - (req "wrong_right_operand_type" Script.expr_encoding))) + (req "operatorName" prim_encoding) + (req "wrongLeftOperandType" Script.expr_encoding) + (req "wrongRightOperandType" Script.expr_encoding))) (function | Undefined_binop (loc, n, tyl, tyr) -> Some (loc, (n, tyl, tyr)) @@ -277,14 +277,14 @@ let () = (* Undefined unary operation *) register_error_kind `Permanent - ~id:"michelson_v1.undefined_unop" - ~title: "Undefined unop" + ~id:"undefinedUnopTypeError" + ~title: "Undefined unop (typechecking error)" ~description: "A unary operation is called on an operand of type \ over which it is not defined." (located (obj2 - (req "operator_name" prim_encoding) - (req "wrong_operand_type" Script.expr_encoding))) + (req "operatorName" prim_encoding) + (req "wrongOperandType" Script.expr_encoding))) (function | Undefined_unop (loc, n, ty) -> Some (loc, (n, ty)) @@ -294,13 +294,13 @@ let () = (* Bad return *) register_error_kind `Permanent - ~id:"michelson_v1.bad_return" - ~title: "Bad return" + ~id:"badReturnTypeError" + ~title: "Bad return (typechecking error)" ~description: "Unexpected stack at the end of a lambda or script." (located (obj2 - (req "expected_return_type" Script.expr_encoding) - (req "wrong_stack_type" stack_ty_enc))) + (req "expectedReturnType" Script.expr_encoding) + (req "wrongStackType" stack_ty_enc))) (function | Bad_return (loc, sty, ty) -> Some (loc, (ty, sty)) | _ -> None) @@ -309,14 +309,14 @@ let () = (* Bad stack *) register_error_kind `Permanent - ~id:"michelson_v1.bad_stack" - ~title: "Bad stack" + ~id:"badStackTypeError" + ~title: "Bad stack (typechecking error)" ~description: "The stack has an unexpected length or contents." (located (obj3 - (req "primitive_name" prim_encoding) - (req "relevant_stack_portion" int16) - (req "wrong_stack_type" stack_ty_enc))) + (req "primitiveName" prim_encoding) + (req "relevantStackPortion" int16) + (req "wrongStackType" stack_ty_enc))) (function | Bad_stack (loc, name, s, sty) -> Some (loc, (name, s, sty)) | _ -> None) @@ -325,7 +325,7 @@ let () = (* Inconsistent annotations *) register_error_kind `Permanent - ~id:"michelson_v1.inconsistent_annotations" + ~id:"inconsistentAnnotations" ~title:"Annotations inconsistent between branches" ~description:"The annotations on two types could not be merged" (obj2 @@ -337,7 +337,7 @@ let () = (* Inconsistent field annotations *) register_error_kind `Permanent - ~id:"michelson_v1.inconsistent_field_annotations" + ~id:"inconsistentFieldAnnotations" ~title:"Annotations for field accesses is inconsistent" ~description:"The specified field does not match the field annotation in the type" (obj2 @@ -349,7 +349,7 @@ let () = (* Inconsistent type annotations *) register_error_kind `Permanent - ~id:"michelson_v1.inconsistent_type_annotations" + ~id:"inconsistentTypeAnnotations" ~title:"Types contain inconsistent annotations" ~description:"The two types contain annotations that do not match" (located (obj2 @@ -362,7 +362,7 @@ let () = (* Unexpected annotation *) register_error_kind `Permanent - ~id:"michelson_v1.unexpected_annotation" + ~id:"unexpectedAnnotation" ~title:"An annotation was encountered where no annotation is expected" ~description:"A node in the syntax tree was impropperly annotated" (located empty) @@ -372,7 +372,7 @@ let () = (* Ungrouped annotations *) register_error_kind `Permanent - ~id:"michelson_v1.ungrouped_annotations" + ~id:"ungroupedAnnotations" ~title:"Annotations of the same kind were found spread apart" ~description:"Annotations of the same kind must be grouped" (located empty) @@ -382,14 +382,14 @@ let () = (* Unmatched branches *) register_error_kind `Permanent - ~id:"michelson_v1.unmatched_branches" - ~title: "Unmatched branches" + ~id:"unmatchedBranchesTypeError" + ~title: "Unmatched branches (typechecking error)" ~description: "At the join point at the end of two code branches \ the stacks have inconsistent lengths or contents." (located (obj2 - (req "first_stack_type" stack_ty_enc) - (req "other_stack_type" stack_ty_enc))) + (req "firstStackType" stack_ty_enc) + (req "otherStackType" stack_ty_enc))) (function | Unmatched_branches (loc, stya, styb) -> Some (loc, (stya, styb)) @@ -399,12 +399,12 @@ let () = (* Bad stack item *) register_error_kind `Permanent - ~id:"michelson_v1.bad_stack_item" - ~title: "Bad stack item" + ~id:"badStackItemTypeError" + ~title: "Bad stack item (typechecking error)" ~description: "The type of a stack item is unexpected \ (this error is always accompanied by a more precise one)." - (obj1 (req "item_level" int16)) + (obj1 (req "itemLevel" int16)) (function | Bad_stack_item n -> Some n | _ -> None) @@ -413,8 +413,8 @@ let () = (* SELF in lambda *) register_error_kind `Permanent - ~id:"michelson_v1.self_in_lambda" - ~title: "SELF instruction in lambda" + ~id:"selfInLambda" + ~title: "SELF instruction in lambda (typechecking error)" ~description: "A SELF instruction was encountered in a lambda expression." (located empty) @@ -426,8 +426,8 @@ let () = (* Bad stack length *) register_error_kind `Permanent - ~id:"michelson_v1.inconsistent_stack_lengths" - ~title: "Inconsistent stack lengths" + ~id:"inconsistentStackLengthsTypeError" + ~title: "Inconsistent stack lengths (typechecking error)" ~description: "A stack was of an unexpected length \ (this error is always in the context of a located error)." @@ -441,13 +441,13 @@ let () = (* Invalid constant *) register_error_kind `Permanent - ~id:"michelson_v1.invalid_constant" - ~title: "Invalid constant" + ~id:"invalidConstantTypeError" + ~title: "Invalid constant (typechecking error)" ~description: "A data expression was invalid for its expected type." (located (obj2 - (req "expected_type" Script.expr_encoding) - (req "wrong_expression" Script.expr_encoding))) + (req "expectedType" Script.expr_encoding) + (req "wrongExpression" Script.expr_encoding))) (function | Invalid_constant (loc, expr, ty) -> Some (loc, (ty, expr)) @@ -457,8 +457,8 @@ let () = (* Invalid contract *) register_error_kind `Permanent - ~id:"michelson_v1.invalid_contract" - ~title: "Invalid contract" + ~id:"invalidContractTypeError" + ~title: "Invalid contract (typechecking error)" ~description: "A script or data expression references a contract that does not \ exist or assumes a wrong type for an existing contract." @@ -472,12 +472,12 @@ let () = (* Comparable type expected *) register_error_kind `Permanent - ~id:"michelson_v1.comparable_type_expected" - ~title: "Comparable type expected" + ~id:"comparableTypeExpectedTypeError" + ~title: "Comparable type expected (typechecking error)" ~description: "A non comparable type was used in a place where \ only comparable types are accepted." - (located (obj1 (req "wrong_type" Script.expr_encoding))) + (located (obj1 (req "wrongType" Script.expr_encoding))) (function | Comparable_type_expected (loc, ty) -> Some (loc, ty) | _ -> None) @@ -486,16 +486,16 @@ let () = (* Inconsistent types *) register_error_kind `Permanent - ~id:"michelson_v1.inconsistent_types" - ~title: "Inconsistent types" + ~id:"InconsistentTypesTypeError" + ~title: "Inconsistent types (typechecking error)" ~description: "This is the basic type clash error, \ that appears in several places where the equality of \ two types have to be proven, it is always accompanied \ with another error that provides more context." (obj2 - (req "first_type" Script.expr_encoding) - (req "other_type" Script.expr_encoding)) + (req "firstType" Script.expr_encoding) + (req "otherType" Script.expr_encoding)) (function | Inconsistent_types (tya, tyb) -> Some (tya, tyb) | _ -> None) @@ -504,13 +504,13 @@ let () = (* Invalid map body *) register_error_kind `Permanent - ~id:"michelson_v1.invalid_map_body" + ~id:"invalidMapBody" ~title: "Invalid map body" ~description: "The body of a map block did not match the expected type" (obj2 (req "loc" Script.location_encoding) - (req "body_type" stack_ty_enc)) + (req "bodyType" stack_ty_enc)) (function | Invalid_map_body (loc, stack) -> Some (loc, stack) | _ -> None) @@ -518,7 +518,7 @@ let () = (* Invalid map block FAIL *) register_error_kind `Permanent - ~id:"michelson_v1.invalid_map_block_fail" + ~id:"invalidMapBlockFail" ~title:"FAIL instruction occurred as body of map block" ~description:"FAIL cannot be the only instruction in the body. \ The propper type of the return list cannot be inferred." @@ -530,15 +530,15 @@ let () = (* Invalid ITER body *) register_error_kind `Permanent - ~id:"michelson_v1.invalid_iter_body" + ~id:"invalidIterBody" ~title:"ITER body returned wrong stack type" ~description:"The body of an ITER instruction \ must result in the same stack type as before \ the ITER." (obj3 (req "loc" Script.location_encoding) - (req "bef_stack" stack_ty_enc) - (req "aft_stack" stack_ty_enc)) + (req "befStack" stack_ty_enc) + (req "aftStack" stack_ty_enc)) (function | Invalid_iter_body (loc, bef, aft) -> Some (loc, bef, aft) | _ -> None) @@ -546,13 +546,13 @@ let () = (* Type too large *) register_error_kind `Permanent - ~id:"michelson_v1.type_too_large" + ~id:"typeTooLarge" ~title:"Stack item type too large" ~description:"An instruction generated a type larger than the limit." (obj3 (req "loc" Script.location_encoding) - (req "type_size" uint16) - (req "maximum_type_size" uint16)) + (req "typeSize" uint16) + (req "maximumTypeSize" uint16)) (function | Type_too_large (loc, ts, maxts) -> Some (loc, ts, maxts) | _ -> None) @@ -561,16 +561,16 @@ let () = (* Ill typed data *) register_error_kind `Permanent - ~id:"michelson_v1.ill_typed_data" - ~title: "Ill typed data" + ~id:"illTypedDataTypeError" + ~title: "Ill typed data (typechecking error)" ~description: "The toplevel error thrown when trying to typecheck \ a data expression against a given type \ (always followed by more precise errors)." (obj3 (opt "identifier" string) - (req "expected_type" Script.expr_encoding) - (req "ill_typed_expression" Script.expr_encoding)) + (req "expectedType" Script.expr_encoding) + (req "illTypedExpression" Script.expr_encoding)) (function | Ill_typed_data (name, expr, ty) -> Some (name, ty, expr) | _ -> None) @@ -578,14 +578,14 @@ let () = (* Ill formed type *) register_error_kind `Permanent - ~id:"michelson_v1.ill_formed_type" - ~title: "Ill formed type" + ~id:"illFormedTypeTypeError" + ~title: "Ill formed type (typechecking error)" ~description: "The toplevel error thrown when trying to parse a type expression \ (always followed by more precise errors)." (obj3 (opt "identifier" string) - (req "ill_formed_expression" Script.expr_encoding) + (req "illFormedExpression" Script.expr_encoding) (req "location" Script.location_encoding)) (function | Ill_formed_type (name, expr, loc) -> Some (name, expr, loc) @@ -595,15 +595,15 @@ let () = (* Ill typed contract *) register_error_kind `Permanent - ~id:"michelson_v1.ill_typed_contract" - ~title: "Ill typed contract" + ~id:"illTypedContractTypeError" + ~title: "Ill typed contract (typechecking error)" ~description: "The toplevel error thrown when trying to typecheck \ a contract code against given input, output and storage types \ (always followed by more precise errors)." (obj2 - (req "ill_typed_code" Script.expr_encoding) - (req "type_map" type_map_enc)) + (req "illTypedCode" Script.expr_encoding) + (req "typeMap" type_map_enc)) (function | Ill_typed_contract (expr, type_map) -> Some (expr, type_map) @@ -613,7 +613,7 @@ let () = (* Cannot serialize error *) register_error_kind `Temporary - ~id:"michelson_v1.cannot_serialize_error" + ~id:"cannotSerializeError" ~title:"Not enough gas to serialize error" ~description:"The error was too big to be serialized with \ the provided gas" diff --git a/src/proto_alpha/lib_protocol/src/voting_services.ml b/src/proto_alpha/lib_protocol/src/voting_services.ml index 80a42a4cd..f4588caac 100644 --- a/src/proto_alpha/lib_protocol/src/voting_services.ml +++ b/src/proto_alpha/lib_protocol/src/voting_services.ml @@ -111,8 +111,8 @@ let register () = register0 S.current_proposal begin fun ctxt () () -> (* this would be better implemented using get_option in get_current_proposal *) Vote.get_current_proposal ctxt >>= function - | Ok p -> return_some p - | Error [Raw_context.Storage_error (Missing_key _)] -> return_none + | Ok p -> return (Some p) + | Error [Raw_context.Storage_error (Missing_key _)] -> return None | (Error _ as e) -> Lwt.return e end