diff --git a/src/proto_alpha/lib_protocol/apply.ml b/src/proto_alpha/lib_protocol/apply.ml index 58b03e065f7fc73491a119fa2413caa92d17929f..89eb16234ab45b222f7e3210388f66801bcc6475 100644 --- a/src/proto_alpha/lib_protocol/apply.ml +++ b/src/proto_alpha/lib_protocol/apply.ml @@ -786,8 +786,7 @@ type 'loc execution_arg = | Typed_arg : 'loc * ('a, _) Script_typed_ir.ty * 'a -> 'loc execution_arg | Untyped_arg : Script.expr -> _ execution_arg -let apply_transaction_to_implicit ~ctxt ~source ~amount ~pkh ~untyped_parameter - ~external_entrypoint ~before_operation = +let apply_transaction_to_implicit ~ctxt ~source ~amount ~pkh ~before_operation = let contract = Contract.Implicit pkh in (* Transfers of zero to implicit accounts are forbidden. *) error_when Tez.(amount = zero) (Empty_transaction contract) >>?= fun () -> @@ -796,20 +795,6 @@ let apply_transaction_to_implicit ~ctxt ~source ~amount ~pkh ~untyped_parameter Contract.allocated ctxt contract >>= fun already_allocated -> Token.transfer ctxt (`Contract source) (`Contract contract) amount >>=? fun (ctxt, balance_updates) -> - (* Only allow [Unit] parameter to implicit accounts. *) - (match untyped_parameter with - | None -> Result.return_unit - | Some parameter -> ( - match Micheline.root parameter with - | Prim (_, Michelson_v1_primitives.D_Unit, [], _) -> Result.return_unit - | _ -> error (Script_interpreter.Bad_contract_parameter contract))) - >>?= fun () -> - (match external_entrypoint with - | None -> Result.return_unit - | Some entrypoint -> - if Entrypoint.is_default entrypoint then Result.return_unit - else error (Script_tc_errors.No_such_entrypoint entrypoint)) - >>?= fun () -> let result = Transaction_to_contract_result { @@ -1100,8 +1085,6 @@ let apply_internal_operation_contents : ~source ~amount ~pkh - ~untyped_parameter:None - ~external_entrypoint:None ~before_operation:ctxt_before_op >|=? fun (ctxt, res, ops) -> ( ctxt, @@ -1267,13 +1250,19 @@ let apply_manager_operation : ctxt parameters >>?= fun (parameters, ctxt) -> + (* Only allow [Unit] parameter to implicit accounts. *) + (match Micheline.root parameters with + | Prim (_, Michelson_v1_primitives.D_Unit, [], _) -> Result.return_unit + | _ -> error (Script_interpreter.Bad_contract_parameter source_contract)) + >>?= fun () -> + (if Entrypoint.is_default entrypoint then Result.return_unit + else error (Script_tc_errors.No_such_entrypoint entrypoint)) + >>?= fun () -> apply_transaction_to_implicit ~ctxt ~source:source_contract ~amount ~pkh - ~untyped_parameter:(Some parameters) - ~external_entrypoint:(Some entrypoint) ~before_operation:ctxt_before_op >|=? fun (ctxt, res, ops) -> (ctxt, Transaction_result res, ops) | Transaction