From 13de466a10b887347e054f57450190d1164ab77d Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 17 May 2022 15:25:58 +0200 Subject: [PATCH 01/12] Client: remove dead pp_internal_operation --- src/proto_alpha/lib_client/operation_result.ml | 4 ---- src/proto_alpha/lib_client/operation_result.mli | 3 --- 2 files changed, 7 deletions(-) diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index 32c8bb97833e..279df89dc72a 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -1163,7 +1163,3 @@ let pp_internal_operation_result ppf (Apply_results.Internal_contents op) = (fun _ppf () -> ()) ppf (operation, ()) - -let pp_internal_operation ppf (Script_typed_ir.Internal_operation op) = - let op = contents_of_internal_operation op in - pp_internal_operation_result ppf (Internal_contents op) diff --git a/src/proto_alpha/lib_client/operation_result.mli b/src/proto_alpha/lib_client/operation_result.mli index 77298d3a03e1..adec43533617 100644 --- a/src/proto_alpha/lib_client/operation_result.mli +++ b/src/proto_alpha/lib_client/operation_result.mli @@ -28,9 +28,6 @@ open Alpha_context val tez_sym : string -val pp_internal_operation : - Format.formatter -> Script_typed_ir.packed_internal_operation -> unit - val pp_internal_operation_result : Format.formatter -> Apply_results.packed_internal_contents -> unit -- GitLab From 28530d0a62420d0493bd04399a2cfea9fdd00eb3 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 17 May 2022 15:26:40 +0200 Subject: [PATCH 02/12] Client: rename pp_internal_operation_result into pp_internal_operation Because it doesn't print results at all. --- src/proto_alpha/lib_client/client_proto_programs.ml | 4 ++-- src/proto_alpha/lib_client/michelson_v1_error_reporter.ml | 2 +- src/proto_alpha/lib_client/operation_result.ml | 2 +- src/proto_alpha/lib_client/operation_result.mli | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/proto_alpha/lib_client/client_proto_programs.ml b/src/proto_alpha/lib_client/client_proto_programs.ml index 8a802bd1f784..f79f858fee94 100644 --- a/src/proto_alpha/lib_client/client_proto_programs.ml +++ b/src/proto_alpha/lib_client/client_proto_programs.ml @@ -86,7 +86,7 @@ let print_run_result (cctxt : #Client_context.printer) ~show_source ~parsed = %a@]@]@." print_expr storage - (Format.pp_print_list Operation_result.pp_internal_operation_result) + (Format.pp_print_list Operation_result.pp_internal_operation) operations (fun ppf -> function | None -> () @@ -109,7 +109,7 @@ let print_trace_result (cctxt : #Client_context.printer) ~show_source ~parsed = %a@]@]@." print_expr storage - (Format.pp_print_list Operation_result.pp_internal_operation_result) + (Format.pp_print_list Operation_result.pp_internal_operation) operations (fun ppf -> function | None -> () diff --git a/src/proto_alpha/lib_client/michelson_v1_error_reporter.ml b/src/proto_alpha/lib_client/michelson_v1_error_reporter.ml index 7e63f5623b32..a5044a047985 100644 --- a/src/proto_alpha/lib_client/michelson_v1_error_reporter.ml +++ b/src/proto_alpha/lib_client/michelson_v1_error_reporter.ml @@ -404,7 +404,7 @@ let report_errors ~details ~show_source ?parsed ppf errs = Format.fprintf ppf "@[Internal operation replay attempt:@,%a@]" - Operation_result.pp_internal_operation_result + Operation_result.pp_internal_operation op ; if rest <> [] then Format.fprintf ppf "@," ; print_trace locations rest diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index 279df89dc72a..d34a6a175412 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -1155,7 +1155,7 @@ let pp_operation_result ppf pp_contents_and_result_list ppf contents_and_result_list ; Format.fprintf ppf "@]@." -let pp_internal_operation_result ppf (Apply_results.Internal_contents op) = +let pp_internal_operation ppf (Apply_results.Internal_contents op) = let operation = manager_operation_of_internal_operation op.operation in pp_manager_operation_content op.source diff --git a/src/proto_alpha/lib_client/operation_result.mli b/src/proto_alpha/lib_client/operation_result.mli index adec43533617..a55ca529bff5 100644 --- a/src/proto_alpha/lib_client/operation_result.mli +++ b/src/proto_alpha/lib_client/operation_result.mli @@ -28,7 +28,7 @@ open Alpha_context val tez_sym : string -val pp_internal_operation_result : +val pp_internal_operation : Format.formatter -> Apply_results.packed_internal_contents -> unit val pp_operation_result : -- GitLab From 958fc97e59885d5fff0d987d02db1216b4bfc5c6 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 17 May 2022 15:37:14 +0200 Subject: [PATCH 03/12] Client: do not convert internal contents to external operation in pp_internal_operation And move the function at the same time --- .../lib_client/operation_result.ml | 83 +++++++++++++++++-- 1 file changed, 74 insertions(+), 9 deletions(-) diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index d34a6a175412..ba83b1f8e56e 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -29,8 +29,82 @@ open Apply_results let tez_sym = "\xEA\x9C\xA9" +let pp_internal_operation ppf (Apply_results.Internal_contents op) = + let {operation; source; _} = op in + (* For now, try to use the same format as in [pp_manager_operation_content]. *) + Format.fprintf ppf "@[@[Internal " ; + (match operation with + | Transaction {destination; amount; parameters; entrypoint} -> + Format.fprintf + ppf + "Transaction:@,Amount: %s%a@,From: %a@,To: %a" + tez_sym + Tez.pp + amount + Contract.pp + source + Destination.pp + destination ; + if not (Entrypoint.is_default entrypoint) then + Format.fprintf ppf "@,Entrypoint: %a" Entrypoint.pp entrypoint ; + if not (Script_repr.is_unit_parameter parameters) then + let expr = + WithExceptions.Option.to_exn + ~none:(Failure "ill-serialized argument") + (Data_encoding.force_decode parameters) + in + Format.fprintf + ppf + "@,Parameter: @[%a@]" + Michelson_v1_printer.print_expr + expr + | Origination {delegate; credit; script = {code; storage}} -> ( + Format.fprintf + ppf + "Origination:@,From: %a@,Credit: %s%a" + Contract.pp + source + tez_sym + Tez.pp + credit ; + let code = + WithExceptions.Option.to_exn + ~none:(Failure "ill-serialized code") + (Data_encoding.force_decode code) + and storage = + WithExceptions.Option.to_exn + ~none:(Failure "ill-serialized storage") + (Data_encoding.force_decode storage) + in + let {Michelson_v1_parser.source; _} = + Michelson_v1_printer.unparse_toplevel code + in + Format.fprintf + ppf + "@,@[Script:@ @[%a@]@,@[Initial storage:@ %a@]" + Format.pp_print_text + source + Michelson_v1_printer.print_expr + storage ; + match delegate with + | None -> Format.fprintf ppf "@,No delegate for this contract" + | Some delegate -> + Format.fprintf + ppf + "@,Delegate: %a" + Signature.Public_key_hash.pp + delegate) + | Delegation delegate_opt -> ( + Format.fprintf ppf "Delegation:@,Contract: %a@,To: " Contract.pp source ; + match delegate_opt with + | None -> Format.pp_print_string ppf "nobody" + | Some delegate -> Signature.Public_key_hash.pp ppf delegate)) ; + + Format.fprintf ppf "@]@]" + let pp_manager_operation_content (type kind) source internal pp_result ppf ((operation, result) : kind manager_operation * _) = + (* For now, try to keep formatting in sync with [pp_internal_operation]. *) Format.fprintf ppf "@[" ; (match operation with | Transaction {destination; amount; parameters; entrypoint} -> @@ -1154,12 +1228,3 @@ let pp_operation_result ppf let contents_and_result_list = Apply_results.pack_contents_list op res in pp_contents_and_result_list ppf contents_and_result_list ; Format.fprintf ppf "@]@." - -let pp_internal_operation ppf (Apply_results.Internal_contents op) = - let operation = manager_operation_of_internal_operation op.operation in - pp_manager_operation_content - op.source - true - (fun _ppf () -> ()) - ppf - (operation, ()) -- GitLab From ec38f09dbcbba6a9cdd54f4c772e22110e46bb6f Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 17 May 2022 15:47:57 +0200 Subject: [PATCH 04/12] Client: extend pp_internal_operation to print result too --- src/proto_alpha/lib_client/operation_result.ml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index ba83b1f8e56e..4addea83c250 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -29,7 +29,8 @@ open Apply_results let tez_sym = "\xEA\x9C\xA9" -let pp_internal_operation ppf (Apply_results.Internal_contents op) = +let pp_internal_operation_result ppf (Apply_results.Internal_contents op) + pp_result res = let {operation; source; _} = op in (* For now, try to use the same format as in [pp_manager_operation_content]. *) Format.fprintf ppf "@[@[Internal " ; @@ -100,11 +101,14 @@ let pp_internal_operation ppf (Apply_results.Internal_contents op) = | None -> Format.pp_print_string ppf "nobody" | Some delegate -> Signature.Public_key_hash.pp ppf delegate)) ; - Format.fprintf ppf "@]@]" + Format.fprintf ppf "%a@]@]" pp_result res + +let pp_internal_operation ppf op = + pp_internal_operation_result ppf op (fun (_ : Format.formatter) () -> ()) () let pp_manager_operation_content (type kind) source internal pp_result ppf ((operation, result) : kind manager_operation * _) = - (* For now, try to keep formatting in sync with [pp_internal_operation]. *) + (* For now, try to keep formatting in sync with [pp_internal_operation_result]. *) Format.fprintf ppf "@[" ; (match operation with | Transaction {destination; amount; parameters; entrypoint} -> -- GitLab From fb12c701731b43b520cc737e65e6d81e00e28561 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 17 May 2022 15:40:21 +0200 Subject: [PATCH 05/12] Client: internal operations are actually internal operations --- src/proto_alpha/lib_client/operation_result.ml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index 4addea83c250..31ad8b22ce05 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -1063,15 +1063,11 @@ let pp_manager_operation_contents_and_result ppf "@,@[Internal operations:@ %a@]" (Format.pp_print_list (fun ppf (Internal_manager_operation_result (op, res)) -> - let operation = - manager_operation_of_internal_operation op.operation - in - pp_manager_operation_content - op.source - false - pp_result + pp_internal_operation_result ppf - (operation, res))) + (Internal_contents op) + pp_result + res)) internal_operation_results) ; Format.fprintf ppf "@]" -- GitLab From eb29299bfefb0f5db07d3e90162e269fb113e195 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 17 May 2022 15:52:08 +0200 Subject: [PATCH 06/12] Client: pp_manager_operation_content is for external operations only --- src/proto_alpha/lib_client/operation_result.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index 31ad8b22ce05..82e262187d8e 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -106,9 +106,10 @@ let pp_internal_operation_result ppf (Apply_results.Internal_contents op) let pp_internal_operation ppf op = pp_internal_operation_result ppf op (fun (_ : Format.formatter) () -> ()) () -let pp_manager_operation_content (type kind) source internal pp_result ppf +let pp_manager_operation_content (type kind) source pp_result ppf ((operation, result) : kind manager_operation * _) = (* For now, try to keep formatting in sync with [pp_internal_operation_result]. *) + let internal = false in Format.fprintf ppf "@[" ; (match operation with | Transaction {destination; amount; parameters; entrypoint} -> @@ -1053,7 +1054,7 @@ let pp_manager_operation_contents_and_result ppf Format.fprintf ppf "@,%a" - (pp_manager_operation_content (Contract.Implicit source) false pp_result) + (pp_manager_operation_content (Contract.Implicit source) pp_result) (operation, operation_result) ; (match internal_operation_results with | [] -> () -- GitLab From d6a5acfd4c510250811616ba5e3c65dbbd02bfae Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 17 May 2022 15:55:53 +0200 Subject: [PATCH 07/12] Client: simplify pp_manager_operation_content --- .../lib_client/operation_result.ml | 59 +++++-------------- 1 file changed, 16 insertions(+), 43 deletions(-) diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index 82e262187d8e..f6e962b2173e 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -109,14 +109,12 @@ let pp_internal_operation ppf op = let pp_manager_operation_content (type kind) source pp_result ppf ((operation, result) : kind manager_operation * _) = (* For now, try to keep formatting in sync with [pp_internal_operation_result]. *) - let internal = false in Format.fprintf ppf "@[" ; (match operation with | Transaction {destination; amount; parameters; entrypoint} -> Format.fprintf ppf - "@[%s:@,Amount: %s%a@,From: %a@,To: %a" - (if internal then "Internal transaction" else "Transaction") + "@[Transaction:@,Amount: %s%a@,From: %a@,To: %a" tez_sym Tez.pp amount @@ -142,8 +140,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Origination {delegate; credit; script = {code; storage}} -> Format.fprintf ppf - "@[%s:@,From: %a@,Credit: %s%a" - (if internal then "Internal origination" else "Origination") + "@[Origination:@,From: %a@,Credit: %s%a" Contract.pp source tez_sym @@ -181,8 +178,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Reveal key -> Format.fprintf ppf - "@[%s of manager public key:@,Contract: %a@,Key: %a%a@]" - (if internal then "Internal revelation" else "Revelation") + "@[Revelation of manager public key:@,Contract: %a@,Key: %a%a@]" Contract.pp source Signature.Public_key.pp @@ -192,8 +188,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Delegation None -> Format.fprintf ppf - "@[%s:@,Contract: %a@,To: nobody%a@]" - (if internal then "Internal Delegation" else "Delegation") + "@[Delegation:@,Contract: %a@,To: nobody%a@]" Contract.pp source pp_result @@ -201,8 +196,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Delegation (Some delegate) -> Format.fprintf ppf - "@[%s:@,Contract: %a@,To: %a%a@]" - (if internal then "Internal Delegation" else "Delegation") + "@[Delegation:@,Contract: %a@,To: %a%a@]" Contract.pp source Signature.Public_key_hash.pp @@ -225,9 +219,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Set_deposits_limit None -> Format.fprintf ppf - "@[%s:@,Delegate: %a@,Unlimited deposits%a@]" - (if internal then "Internal set deposits limit" - else "Set deposits limit") + "@[Set deposits limit:@,Delegate: %a@,Unlimited deposits%a@]" Contract.pp source pp_result @@ -235,9 +227,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Set_deposits_limit (Some limit) -> Format.fprintf ppf - "@[%s:@,Delegate: %a@,Limit: %a%a@]" - (if internal then "Internal set deposits limit" - else "Set deposits limit") + "@[Set deposits limit:@,Delegate: %a@,Limit: %a%a@]" Contract.pp source Tez.pp @@ -247,9 +237,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Tx_rollup_origination -> Format.fprintf ppf - "@[%s:@,From: %a%a@]" - (if internal then "Internal tx rollup origination" - else "Tx rollup origination") + "@[Tx rollup origination:@,From: %a%a@]" Contract.pp source pp_result @@ -257,9 +245,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Tx_rollup_submit_batch {tx_rollup; content; burn_limit = _} -> Format.fprintf ppf - "@[%s:%a, %d bytes, From: %a%a@]" - (if internal then "Internal tx rollup transaction" - else "Tx rollup transaction") + "@[Tx rollup transaction:%a, %d bytes, From: %a%a@]" Tx_rollup.pp tx_rollup (String.length content) @@ -270,9 +256,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Tx_rollup_commit {tx_rollup; commitment} -> Format.fprintf ppf - "@[%s:%a, %a@,From: %a%a@]" - (if internal then "Internal tx rollup commitment" - else "Tx rollup commitment") + "@[Tx rollup commitment:%a, %a@,From: %a%a@]" Tx_rollup.pp tx_rollup Tx_rollup_commitment.Full.pp @@ -284,9 +268,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Tx_rollup_return_bond {tx_rollup} -> Format.fprintf ppf - "@[%s:%a @,From: %a%a@]" - (if internal then "Internal tx rollup return commitment bond" - else "Tx rollup return commitment bond") + "@[Tx rollup return commitment bond:%a @,From: %a%a@]" Tx_rollup.pp tx_rollup Contract.pp @@ -296,9 +278,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Tx_rollup_finalize_commitment {tx_rollup} -> Format.fprintf ppf - "@[%s:%a @,From: %a%a@]" - (if internal then "Internal tx rollup finalize commitment" - else "Tx rollup finalize commitment") + "@[Tx rollup finalize commitment:%a @,From: %a%a@]" Tx_rollup.pp tx_rollup Contract.pp @@ -308,9 +288,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Tx_rollup_remove_commitment {tx_rollup; _} -> Format.fprintf ppf - "@[%s:%a @,From: %a%a@]" - (if internal then "Internal tx rollup remove commitment" - else "Tx rollup remove commitment") + "@[Tx rollup remove commitment:%a @,From: %a%a@]" Tx_rollup.pp tx_rollup Contract.pp @@ -321,9 +299,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf (* FIXME/TORU *) Format.fprintf ppf - "@[%s:%a @,From: %a%a@]" - (if internal then "Internal tx rollup rejection" - else "Tx rollup rejection") + "@[Tx rollup rejection:%a @,From: %a%a@]" Tx_rollup.pp tx_rollup Contract.pp @@ -333,9 +309,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Tx_rollup_dispatch_tickets {tx_rollup; _} -> Format.fprintf ppf - "@[%s:%a@,From: %a%a@]" - (if internal then "Internal tx rollup dispatch tickets" - else "Tx rollup dispatch tickets") + "@[Tx rollup dispatch tickets:%a@,From: %a%a@]" Tx_rollup.pp tx_rollup Contract.pp @@ -345,8 +319,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Transfer_ticket _ -> Format.fprintf ppf - "@[%s:@,From: %a%a@]" - (if internal then "Internal transfer ticket" else "Transfer ticket") + "@[Transfer tickets:@,From: %a%a@]" Contract.pp source pp_result -- GitLab From ca581fa0861598d3ac4e4e038cb84240178ffa99 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 17 May 2022 15:59:09 +0200 Subject: [PATCH 08/12] Client: simplify pp_manager_operation_content further (1) --- .../lib_client/operation_result.ml | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index f6e962b2173e..74821bc26a72 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -109,12 +109,12 @@ let pp_internal_operation ppf op = let pp_manager_operation_content (type kind) source pp_result ppf ((operation, result) : kind manager_operation * _) = (* For now, try to keep formatting in sync with [pp_internal_operation_result]. *) - Format.fprintf ppf "@[" ; + Format.fprintf ppf "@[@[" ; (match operation with | Transaction {destination; amount; parameters; entrypoint} -> Format.fprintf ppf - "@[Transaction:@,Amount: %s%a@,From: %a@,To: %a" + "Transaction:@,Amount: %s%a@,From: %a@,To: %a" tez_sym Tez.pp amount @@ -140,7 +140,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Origination {delegate; credit; script = {code; storage}} -> Format.fprintf ppf - "@[Origination:@,From: %a@,Credit: %s%a" + "Origination:@,From: %a@,Credit: %s%a" Contract.pp source tez_sym @@ -178,7 +178,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Reveal key -> Format.fprintf ppf - "@[Revelation of manager public key:@,Contract: %a@,Key: %a%a@]" + "Revelation of manager public key:@,Contract: %a@,Key: %a%a@]" Contract.pp source Signature.Public_key.pp @@ -188,7 +188,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Delegation None -> Format.fprintf ppf - "@[Delegation:@,Contract: %a@,To: nobody%a@]" + "Delegation:@,Contract: %a@,To: nobody%a@]" Contract.pp source pp_result @@ -196,7 +196,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Delegation (Some delegate) -> Format.fprintf ppf - "@[Delegation:@,Contract: %a@,To: %a%a@]" + "Delegation:@,Contract: %a@,To: %a%a@]" Contract.pp source Signature.Public_key_hash.pp @@ -211,7 +211,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf in Format.fprintf ppf - "Register Global:@,@[ Value: %a%a@]" + "Register Global:@,Value: %a%a@]" Michelson_v1_printer.print_expr value pp_result @@ -219,7 +219,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Set_deposits_limit None -> Format.fprintf ppf - "@[Set deposits limit:@,Delegate: %a@,Unlimited deposits%a@]" + "Set deposits limit:@,Delegate: %a@,Unlimited deposits%a@]" Contract.pp source pp_result @@ -227,7 +227,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Set_deposits_limit (Some limit) -> Format.fprintf ppf - "@[Set deposits limit:@,Delegate: %a@,Limit: %a%a@]" + "Set deposits limit:@,Delegate: %a@,Limit: %a%a@]" Contract.pp source Tez.pp @@ -237,7 +237,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Tx_rollup_origination -> Format.fprintf ppf - "@[Tx rollup origination:@,From: %a%a@]" + "Tx rollup origination:@,From: %a%a@]" Contract.pp source pp_result @@ -245,7 +245,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Tx_rollup_submit_batch {tx_rollup; content; burn_limit = _} -> Format.fprintf ppf - "@[Tx rollup transaction:%a, %d bytes, From: %a%a@]" + "Tx rollup transaction:%a, %d bytes, From: %a%a@]" Tx_rollup.pp tx_rollup (String.length content) @@ -256,7 +256,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Tx_rollup_commit {tx_rollup; commitment} -> Format.fprintf ppf - "@[Tx rollup commitment:%a, %a@,From: %a%a@]" + "Tx rollup commitment:%a, %a@,From: %a%a@]" Tx_rollup.pp tx_rollup Tx_rollup_commitment.Full.pp @@ -268,7 +268,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Tx_rollup_return_bond {tx_rollup} -> Format.fprintf ppf - "@[Tx rollup return commitment bond:%a @,From: %a%a@]" + "Tx rollup return commitment bond:%a @,From: %a%a@]" Tx_rollup.pp tx_rollup Contract.pp @@ -278,7 +278,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Tx_rollup_finalize_commitment {tx_rollup} -> Format.fprintf ppf - "@[Tx rollup finalize commitment:%a @,From: %a%a@]" + "Tx rollup finalize commitment:%a @,From: %a%a@]" Tx_rollup.pp tx_rollup Contract.pp @@ -288,7 +288,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Tx_rollup_remove_commitment {tx_rollup; _} -> Format.fprintf ppf - "@[Tx rollup remove commitment:%a @,From: %a%a@]" + "Tx rollup remove commitment:%a @,From: %a%a@]" Tx_rollup.pp tx_rollup Contract.pp @@ -299,7 +299,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf (* FIXME/TORU *) Format.fprintf ppf - "@[Tx rollup rejection:%a @,From: %a%a@]" + "Tx rollup rejection:%a @,From: %a%a@]" Tx_rollup.pp tx_rollup Contract.pp @@ -309,7 +309,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Tx_rollup_dispatch_tickets {tx_rollup; _} -> Format.fprintf ppf - "@[Tx rollup dispatch tickets:%a@,From: %a%a@]" + "Tx rollup dispatch tickets:%a@,From: %a%a@]" Tx_rollup.pp tx_rollup Contract.pp @@ -319,7 +319,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Transfer_ticket _ -> Format.fprintf ppf - "@[Transfer tickets:@,From: %a%a@]" + "Transfer tickets:@,From: %a%a@]" Contract.pp source pp_result @@ -328,8 +328,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf let (module R : Sc_rollups.PVM.S) = Sc_rollups.of_kind kind in Format.fprintf ppf - "@[Originate smart contract rollup of kind %s with boot sector \ - '%a'%a@]" + "Originate smart contract rollup of kind %s with boot sector '%a'%a@]" R.name R.pp_boot_sector boot_sector @@ -338,8 +337,8 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Sc_rollup_add_messages {rollup; messages = _} -> Format.fprintf ppf - "@[Add a message to the inbox of the smart contract rollup at \ - address %a%a@]" + "Add a message to the inbox of the smart contract rollup at address \ + %a%a@]" Sc_rollup.Address.pp rollup pp_result @@ -347,8 +346,8 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Sc_rollup_cement {rollup; commitment} -> Format.fprintf ppf - "@[Cement the commitment %a in the smart contract rollup at \ - address %a%a@]" + "Cement the commitment %a in the smart contract rollup at address \ + %a%a@]" Sc_rollup.Commitment_hash.pp commitment Sc_rollup.Address.pp @@ -358,8 +357,7 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Sc_rollup_publish {rollup; commitment} -> Format.fprintf ppf - "@[Publish commitment %a in the smart contract rollup at address \ - %a%a@]" + "Publish commitment %a in the smart contract rollup at address %a%a@]" Sc_rollup.Commitment.pp commitment Sc_rollup.Address.pp @@ -369,8 +367,8 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Sc_rollup_refute {rollup; opponent; refutation} -> Format.fprintf ppf - "@[Refute staker %a in the smart contract rollup at address %a \ - using refutation %a%a@]" + "Refute staker %a in the smart contract rollup at address %a using \ + refutation %a%a@]" Sc_rollup.Staker.pp opponent Sc_rollup.Address.pp @@ -382,8 +380,8 @@ let pp_manager_operation_content (type kind) source pp_result ppf | Sc_rollup_timeout {rollup; stakers} -> Format.fprintf ppf - "@[Punish one of the two stakers %a and %a by timeout in the \ - smart contract rollup at address %a%a@]" + "Punish one of the two stakers %a and %a by timeout in the smart \ + contract rollup at address %a%a@]" Sc_rollup.Staker.pp (fst stakers) Sc_rollup.Staker.pp -- GitLab From 3d17b3bc332b7200dcd4891c287df64dfb203d07 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 17 May 2022 16:01:53 +0200 Subject: [PATCH 09/12] Client: simplify pp_manager_operation_content further (2) --- .../lib_client/operation_result.ml | 130 +++++------------- 1 file changed, 37 insertions(+), 93 deletions(-) diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index 74821bc26a72..f28b67ed64a8 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -124,20 +124,18 @@ let pp_manager_operation_content (type kind) source pp_result ppf destination ; if not (Entrypoint.is_default entrypoint) then Format.fprintf ppf "@,Entrypoint: %a" Entrypoint.pp entrypoint ; - (if not (Script_repr.is_unit_parameter parameters) then - let expr = - WithExceptions.Option.to_exn - ~none:(Failure "ill-serialized argument") - (Data_encoding.force_decode parameters) - in - Format.fprintf - ppf - "@,Parameter: @[%a@]" - Michelson_v1_printer.print_expr - expr) ; - pp_result ppf result ; - Format.fprintf ppf "@]" - | Origination {delegate; credit; script = {code; storage}} -> + if not (Script_repr.is_unit_parameter parameters) then + let expr = + WithExceptions.Option.to_exn + ~none:(Failure "ill-serialized argument") + (Data_encoding.force_decode parameters) + in + Format.fprintf + ppf + "@,Parameter: @[%a@]" + Michelson_v1_printer.print_expr + expr + | Origination {delegate; credit; script = {code; storage}} -> ( Format.fprintf ppf "Origination:@,From: %a@,Credit: %s%a" @@ -165,44 +163,36 @@ let pp_manager_operation_content (type kind) source pp_result ppf source Michelson_v1_printer.print_expr storage ; - (match delegate with + match delegate with | None -> Format.fprintf ppf "@,No delegate for this contract" | Some delegate -> Format.fprintf ppf "@,Delegate: %a" Signature.Public_key_hash.pp - delegate) ; - pp_result ppf result ; - Format.fprintf ppf "@]" + delegate) | Reveal key -> Format.fprintf ppf - "Revelation of manager public key:@,Contract: %a@,Key: %a%a@]" + "Revelation of manager public key:@,Contract: %a@,Key: %a" Contract.pp source Signature.Public_key.pp key - pp_result - result | Delegation None -> Format.fprintf ppf - "Delegation:@,Contract: %a@,To: nobody%a@]" + "Delegation:@,Contract: %a@,To: nobody" Contract.pp source - pp_result - result | Delegation (Some delegate) -> Format.fprintf ppf - "Delegation:@,Contract: %a@,To: %a%a@]" + "Delegation:@,Contract: %a@,To: %a" Contract.pp source Signature.Public_key_hash.pp delegate - pp_result - result | Register_global_constant {value = lazy_value} -> let value = WithExceptions.Option.to_exn @@ -211,187 +201,141 @@ let pp_manager_operation_content (type kind) source pp_result ppf in Format.fprintf ppf - "Register Global:@,Value: %a%a@]" + "Register Global:@,Value: %a" Michelson_v1_printer.print_expr value - pp_result - result | Set_deposits_limit None -> Format.fprintf ppf - "Set deposits limit:@,Delegate: %a@,Unlimited deposits%a@]" + "Set deposits limit:@,Delegate: %a@,Unlimited deposits" Contract.pp source - pp_result - result | Set_deposits_limit (Some limit) -> Format.fprintf ppf - "Set deposits limit:@,Delegate: %a@,Limit: %a%a@]" + "Set deposits limit:@,Delegate: %a@,Limit: %a" Contract.pp source Tez.pp limit - pp_result - result | Tx_rollup_origination -> - Format.fprintf - ppf - "Tx rollup origination:@,From: %a%a@]" - Contract.pp - source - pp_result - result + Format.fprintf ppf "Tx rollup origination:@,From: %a" Contract.pp source | Tx_rollup_submit_batch {tx_rollup; content; burn_limit = _} -> Format.fprintf ppf - "Tx rollup transaction:%a, %d bytes, From: %a%a@]" + "Tx rollup transaction:%a, %d bytes, From: %a" Tx_rollup.pp tx_rollup (String.length content) Contract.pp source - pp_result - result | Tx_rollup_commit {tx_rollup; commitment} -> Format.fprintf ppf - "Tx rollup commitment:%a, %a@,From: %a%a@]" + "Tx rollup commitment:%a, %a@,From: %a" Tx_rollup.pp tx_rollup Tx_rollup_commitment.Full.pp commitment Contract.pp source - pp_result - result | Tx_rollup_return_bond {tx_rollup} -> Format.fprintf ppf - "Tx rollup return commitment bond:%a @,From: %a%a@]" + "Tx rollup return commitment bond:%a @,From: %a" Tx_rollup.pp tx_rollup Contract.pp source - pp_result - result | Tx_rollup_finalize_commitment {tx_rollup} -> Format.fprintf ppf - "Tx rollup finalize commitment:%a @,From: %a%a@]" + "Tx rollup finalize commitment:%a @,From: %a" Tx_rollup.pp tx_rollup Contract.pp source - pp_result - result | Tx_rollup_remove_commitment {tx_rollup; _} -> Format.fprintf ppf - "Tx rollup remove commitment:%a @,From: %a%a@]" + "Tx rollup remove commitment:%a @,From: %a" Tx_rollup.pp tx_rollup Contract.pp source - pp_result - result | Tx_rollup_rejection {tx_rollup; _} -> (* FIXME/TORU *) Format.fprintf ppf - "Tx rollup rejection:%a @,From: %a%a@]" + "Tx rollup rejection:%a @,From: %a" Tx_rollup.pp tx_rollup Contract.pp source - pp_result - result | Tx_rollup_dispatch_tickets {tx_rollup; _} -> Format.fprintf ppf - "Tx rollup dispatch tickets:%a@,From: %a%a@]" + "Tx rollup dispatch tickets:%a@,From: %a" Tx_rollup.pp tx_rollup Contract.pp source - pp_result - result | Transfer_ticket _ -> - Format.fprintf - ppf - "Transfer tickets:@,From: %a%a@]" - Contract.pp - source - pp_result - result + Format.fprintf ppf "Transfer tickets:@,From: %a" Contract.pp source | Sc_rollup_originate {kind; boot_sector} -> let (module R : Sc_rollups.PVM.S) = Sc_rollups.of_kind kind in Format.fprintf ppf - "Originate smart contract rollup of kind %s with boot sector '%a'%a@]" + "Originate smart contract rollup of kind %s with boot sector '%a'" R.name R.pp_boot_sector boot_sector - pp_result - result | Sc_rollup_add_messages {rollup; messages = _} -> Format.fprintf ppf - "Add a message to the inbox of the smart contract rollup at address \ - %a%a@]" + "Add a message to the inbox of the smart contract rollup at address %a" Sc_rollup.Address.pp rollup - pp_result - result | Sc_rollup_cement {rollup; commitment} -> Format.fprintf ppf - "Cement the commitment %a in the smart contract rollup at address \ - %a%a@]" + "Cement the commitment %a in the smart contract rollup at address %a" Sc_rollup.Commitment_hash.pp commitment Sc_rollup.Address.pp rollup - pp_result - result | Sc_rollup_publish {rollup; commitment} -> Format.fprintf ppf - "Publish commitment %a in the smart contract rollup at address %a%a@]" + "Publish commitment %a in the smart contract rollup at address %a" Sc_rollup.Commitment.pp commitment Sc_rollup.Address.pp rollup - pp_result - result | Sc_rollup_refute {rollup; opponent; refutation} -> Format.fprintf ppf "Refute staker %a in the smart contract rollup at address %a using \ - refutation %a%a@]" + refutation %a" Sc_rollup.Staker.pp opponent Sc_rollup.Address.pp rollup Sc_rollup.Game.pp_refutation refutation - pp_result - result | Sc_rollup_timeout {rollup; stakers} -> Format.fprintf ppf "Punish one of the two stakers %a and %a by timeout in the smart \ - contract rollup at address %a%a@]" + contract rollup at address %a" Sc_rollup.Staker.pp (fst stakers) Sc_rollup.Staker.pp (snd stakers) Sc_rollup.Address.pp - rollup - pp_result - result) ; + rollup) ; - Format.fprintf ppf "@]" + Format.fprintf ppf "%a@]@]" pp_result result let pp_balance_updates ppf = function | [] -> () -- GitLab From 1ac37c75b60de5d040f6a96f39940021fd3ced0c Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 17 May 2022 16:14:24 +0200 Subject: [PATCH 10/12] Client: simplify pp_manager_operation_content further (3) --- .../lib_client/operation_result.ml | 36 ++++++------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index f28b67ed64a8..c12780350e03 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -179,20 +179,11 @@ let pp_manager_operation_content (type kind) source pp_result ppf source Signature.Public_key.pp key - | Delegation None -> - Format.fprintf - ppf - "Delegation:@,Contract: %a@,To: nobody" - Contract.pp - source - | Delegation (Some delegate) -> - Format.fprintf - ppf - "Delegation:@,Contract: %a@,To: %a" - Contract.pp - source - Signature.Public_key_hash.pp - delegate + | Delegation delegate_opt -> ( + Format.fprintf ppf "Delegation:@,Contract: %a@,To: " Contract.pp source ; + match delegate_opt with + | None -> Format.pp_print_string ppf "nobody" + | Some delegate -> Signature.Public_key_hash.pp ppf delegate) | Register_global_constant {value = lazy_value} -> let value = WithExceptions.Option.to_exn @@ -204,20 +195,15 @@ let pp_manager_operation_content (type kind) source pp_result ppf "Register Global:@,Value: %a" Michelson_v1_printer.print_expr value - | Set_deposits_limit None -> - Format.fprintf - ppf - "Set deposits limit:@,Delegate: %a@,Unlimited deposits" - Contract.pp - source - | Set_deposits_limit (Some limit) -> + | Set_deposits_limit limit_opt -> ( Format.fprintf ppf - "Set deposits limit:@,Delegate: %a@,Limit: %a" + "Set deposits limit:@,Delegate: %a@," Contract.pp - source - Tez.pp - limit + source ; + match limit_opt with + | None -> Format.pp_print_string ppf "Unlimited deposits" + | Some limit -> Format.fprintf ppf "Limit: %a" Tez.pp limit) | Tx_rollup_origination -> Format.fprintf ppf "Tx rollup origination:@,From: %a" Contract.pp source | Tx_rollup_submit_batch {tx_rollup; content; burn_limit = _} -> -- GitLab From e38bbd0722d2d79d4a666e445ed93b128cfc8d90 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 17 May 2022 18:43:21 +0200 Subject: [PATCH 11/12] Tests/Python: update regression traces --- ...ract::test_originate_contract_from_contract_transfer.out | 2 +- ...ract.TestSelfAddressTransfer::test_send_self_address.out | 2 +- ...pcodes.TestContractOnchainOpcodes::test_set_delegate.out | 4 ++-- ...xe009ab79e8b84ef0e55c43a9a857214d8761e67b.7da5c9014e.out | 2 +- ...hain_opcodes.TestContractOnchainOpcodes::test_source.out | 2 +- ...des.TestContractOnchainOpcodes::test_transfer_tokens.out | 4 ++-- ...tz-None-Unit-(Some \"KT1Mjjcb6tmSsLm7Cb3.c3984fbc14.out" | 2 +- ...ing.TestAddApproveTransferRemove::test_add_liquidity.out | 4 ++-- ....TestAddApproveTransferRemove::test_remove_liquidity.out | 6 +++--- ...test_liquidity_baking.TestTrades::test_add_liquidity.out | 4 ++-- .../test_liquidity_baking.TestTrades::test_buy_tok.out | 4 ++-- .../test_liquidity_baking.TestTrades::test_sell_tok.out | 6 +++--- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_transfer.out b/tests_python/tests_alpha/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_transfer.out index cd7e57f8065d..b4347fb7c62e 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_transfer.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_transfer.out @@ -28,7 +28,7 @@ This sequence of operations was run: Storage size: 93 bytes Consumed gas: 2121.040 Internal operations: - Origination: + Internal Origination: From: [CONTRACT_HASH] Credit: ꜩ0 Script: diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract.TestSelfAddressTransfer::test_send_self_address.out b/tests_python/tests_alpha/_regtest_outputs/test_contract.TestSelfAddressTransfer::test_send_self_address.out index d277bc77a3ea..e34749f1ae1d 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_contract.TestSelfAddressTransfer::test_send_self_address.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract.TestSelfAddressTransfer::test_send_self_address.out @@ -29,7 +29,7 @@ This sequence of operations was run: Storage size: 82 bytes Consumed gas: 3490.352 Internal operations: - Transaction: + Internal Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] To: [CONTRACT_HASH] diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_set_delegate.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_set_delegate.out index cde8912d7412..91c395de218e 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_set_delegate.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_set_delegate.out @@ -76,7 +76,7 @@ This sequence of operations was run: Storage size: 51 bytes Consumed gas: 2115.714 Internal operations: - Delegation: + Internal Delegation: Contract: [CONTRACT_HASH] To: [CONTRACT_HASH] This delegation was successfully applied @@ -113,7 +113,7 @@ This sequence of operations was run: Storage size: 51 bytes Consumed gas: 1202.968 Internal operations: - Delegation: + Internal Delegation: Contract: [CONTRACT_HASH] To: nobody This delegation was successfully applied diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_success[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b.7da5c9014e.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_success[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b.7da5c9014e.out index 61bb45fd388b..f4cbb13672e4 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_success[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b.7da5c9014e.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_success[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b.7da5c9014e.out @@ -31,7 +31,7 @@ This sequence of operations was run: Storage size: 578 bytes Consumed gas: 2599.458 Internal operations: - Transaction: + Internal Transaction: Amount: ꜩ1000 From: [CONTRACT_HASH] To: [CONTRACT_HASH] diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_source.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_source.out index fcfd182e4ee0..327cda1e937d 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_source.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_source.out @@ -106,7 +106,7 @@ This sequence of operations was run: Storage size: 55 bytes Consumed gas: 2569.202 Internal operations: - Transaction: + Internal Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] To: [CONTRACT_HASH] diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_transfer_tokens.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_transfer_tokens.out index 1771ea004a4c..d8e19643a6b6 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_transfer_tokens.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_transfer_tokens.out @@ -174,7 +174,7 @@ This sequence of operations was run: [CONTRACT_HASH] ... -ꜩ100 [CONTRACT_HASH] ... +ꜩ100 Internal operations: - Transaction: + Internal Transaction: Amount: ꜩ100 From: [CONTRACT_HASH] To: [CONTRACT_HASH] @@ -222,7 +222,7 @@ This sequence of operations was run: [CONTRACT_HASH] ... -ꜩ100 [CONTRACT_HASH] ... +ꜩ100 Internal operations: - Transaction: + Internal Transaction: Amount: ꜩ100 From: [CONTRACT_HASH] To: [CONTRACT_HASH] diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[create_contract.tz-None-Unit-(Some \"KT1Mjjcb6tmSsLm7Cb3.c3984fbc14.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[create_contract.tz-None-Unit-(Some \"KT1Mjjcb6tmSsLm7Cb3.c3984fbc14.out" index 22855f1149aa..7e774d423d06 100644 --- "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[create_contract.tz-None-Unit-(Some \"KT1Mjjcb6tmSsLm7Cb3.c3984fbc14.out" +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[create_contract.tz-None-Unit-(Some \"KT1Mjjcb6tmSsLm7Cb3.c3984fbc14.out" @@ -3,7 +3,7 @@ tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_o storage (Some "KT1Mjjcb6tmSsLm7Cb3DSQszePjfchPM4Uxm") emitted operations - Internal origination: + Internal Origination: From: KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi Credit: ꜩ0.05 Script: diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_add_liquidity.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_add_liquidity.out index 5c9566781f83..17f4efd1cf99 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_add_liquidity.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_add_liquidity.out @@ -41,7 +41,7 @@ This sequence of operations was run: [CONTRACT_HASH] ... -ꜩ9001 [CONTRACT_HASH] ... +ꜩ9001 Internal operations: - Transaction: + Internal Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] To: [CONTRACT_HASH] @@ -62,7 +62,7 @@ This sequence of operations was run: Balance updates: [CONTRACT_HASH] ... -ꜩ0.017 storage fees ........................... +ꜩ0.017 - Transaction: + Internal Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] To: [CONTRACT_HASH] diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_remove_liquidity.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_remove_liquidity.out index 4f2ebeecda6c..8c02661f1b37 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_remove_liquidity.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_remove_liquidity.out @@ -35,7 +35,7 @@ This sequence of operations was run: Storage size: 4633 bytes Consumed gas: 2278.261 Internal operations: - Transaction: + Internal Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] To: [CONTRACT_HASH] @@ -48,7 +48,7 @@ This sequence of operations was run: Unset map(2)[0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c] Storage size: 2048 bytes Consumed gas: 1873.367 - Transaction: + Internal Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] To: [CONTRACT_HASH] @@ -67,7 +67,7 @@ This sequence of operations was run: Balance updates: [CONTRACT_HASH] ... -ꜩ0.01675 storage fees ........................... +ꜩ0.01675 - Transaction: + Internal Transaction: Amount: ꜩ125.105747 From: [CONTRACT_HASH] To: [CONTRACT_HASH] diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_add_liquidity.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_add_liquidity.out index 153ae6130672..855b33c84d1c 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_add_liquidity.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_add_liquidity.out @@ -41,7 +41,7 @@ This sequence of operations was run: [CONTRACT_HASH] ... -ꜩ9001 [CONTRACT_HASH] ... +ꜩ9001 Internal operations: - Transaction: + Internal Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] To: [CONTRACT_HASH] @@ -62,7 +62,7 @@ This sequence of operations was run: Balance updates: [CONTRACT_HASH] ... -ꜩ0.017 storage fees ........................... +ꜩ0.017 - Transaction: + Internal Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] To: [CONTRACT_HASH] diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_buy_tok.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_buy_tok.out index e8f5389bf347..074ab16c321d 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_buy_tok.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_buy_tok.out @@ -41,7 +41,7 @@ This sequence of operations was run: [CONTRACT_HASH] ... -ꜩ9001 [CONTRACT_HASH] ... +ꜩ9001 Internal operations: - Transaction: + Internal Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] To: [CONTRACT_HASH] @@ -60,7 +60,7 @@ This sequence of operations was run: Balance updates: [CONTRACT_HASH] ... -ꜩ0.017 storage fees ........................... +ꜩ0.017 - Transaction: + Internal Transaction: Amount: ꜩ9.001 From: [CONTRACT_HASH] To: [CONTRACT_HASH] diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_sell_tok.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_sell_tok.out index d26fb91a3177..624d58f58ac1 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_sell_tok.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_sell_tok.out @@ -35,7 +35,7 @@ This sequence of operations was run: Storage size: 4633 bytes Consumed gas: 1747.789 Internal operations: - Transaction: + Internal Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] To: [CONTRACT_HASH] @@ -52,7 +52,7 @@ This sequence of operations was run: Set map(0)[0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600] to 461 Storage size: 2331 bytes Consumed gas: 3265.725 - Transaction: + Internal Transaction: Amount: ꜩ3891.966034 From: [CONTRACT_HASH] To: [CONTRACT_HASH] @@ -61,7 +61,7 @@ This sequence of operations was run: Balance updates: [CONTRACT_HASH] ... -ꜩ3891.966034 [CONTRACT_HASH] ... +ꜩ3891.966034 - Transaction: + Internal Transaction: Amount: ꜩ3.895862 From: [CONTRACT_HASH] To: [CONTRACT_HASH] -- GitLab From ab8c6f6719ef2b9417687a938444b024ca919f08 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 17 May 2022 18:48:53 +0200 Subject: [PATCH 12/12] Tezt: reset regression outputs --- .../tx_rollup_finalize_commitment_future.out | 4 ++-- .../tx_rollup_finalize_commitment_no_batch.out | 4 ++-- ..._rollup_finalize_commitment_no_commitment.out | 4 ++-- .../tx_rollup_finalize_too_recent_commitment.out | 4 ++-- .../tx_rollup_rpc_commitment_remove.out | 16 ++++++++-------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tezt/_regressions/tx_rollup_finalize_commitment_future.out b/tezt/_regressions/tx_rollup_finalize_commitment_future.out index a690b5906c77..e9f53dec25f9 100644 --- a/tezt/_regressions/tx_rollup_finalize_commitment_future.out +++ b/tezt/_regressions/tx_rollup_finalize_commitment_future.out @@ -67,8 +67,8 @@ This simulation failed: Gas limit: 1040000 Storage limit: 60000 bytes Tx rollup finalize commitment:[TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. + From: [PUBLIC_KEY_HASH] + This operation FAILED. Error: { "id": "proto.alpha.tx_rollup_no_commitment_to_finalize", diff --git a/tezt/_regressions/tx_rollup_finalize_commitment_no_batch.out b/tezt/_regressions/tx_rollup_finalize_commitment_no_batch.out index 2141dd66877d..fb471970b2d2 100644 --- a/tezt/_regressions/tx_rollup_finalize_commitment_no_batch.out +++ b/tezt/_regressions/tx_rollup_finalize_commitment_no_batch.out @@ -40,8 +40,8 @@ This simulation failed: Gas limit: 1040000 Storage limit: 60000 bytes Tx rollup finalize commitment:[TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. + From: [PUBLIC_KEY_HASH] + This operation FAILED. Error: { "id": "proto.alpha.tx_rollup_no_commitment_to_finalize", diff --git a/tezt/_regressions/tx_rollup_finalize_commitment_no_commitment.out b/tezt/_regressions/tx_rollup_finalize_commitment_no_commitment.out index 78972d080fb3..4d375064906f 100644 --- a/tezt/_regressions/tx_rollup_finalize_commitment_no_commitment.out +++ b/tezt/_regressions/tx_rollup_finalize_commitment_no_commitment.out @@ -67,8 +67,8 @@ This simulation failed: Gas limit: 1040000 Storage limit: 60000 bytes Tx rollup finalize commitment:[TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. + From: [PUBLIC_KEY_HASH] + This operation FAILED. Error: { "id": "proto.alpha.tx_rollup_no_commitment_to_finalize", diff --git a/tezt/_regressions/tx_rollup_finalize_too_recent_commitment.out b/tezt/_regressions/tx_rollup_finalize_too_recent_commitment.out index 82a39dfa8daf..96565ba82731 100644 --- a/tezt/_regressions/tx_rollup_finalize_too_recent_commitment.out +++ b/tezt/_regressions/tx_rollup_finalize_too_recent_commitment.out @@ -96,8 +96,8 @@ This simulation failed: Gas limit: 1040000 Storage limit: 60000 bytes Tx rollup finalize commitment:[TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. + From: [PUBLIC_KEY_HASH] + This operation FAILED. Error: { "id": "proto.alpha.tx_rollup_no_commitment_to_finalize", diff --git a/tezt/_regressions/tx_rollup_rpc_commitment_remove.out b/tezt/_regressions/tx_rollup_rpc_commitment_remove.out index 9ba2ef542e28..7a7c70f49bd1 100644 --- a/tezt/_regressions/tx_rollup_rpc_commitment_remove.out +++ b/tezt/_regressions/tx_rollup_rpc_commitment_remove.out @@ -120,8 +120,8 @@ This simulation failed: Gas limit: 1040000 Storage limit: 60000 bytes Tx rollup finalize commitment:[TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. + From: [PUBLIC_KEY_HASH] + This operation FAILED. Error: { "id": "proto.alpha.tx_rollup_no_commitment_to_finalize", @@ -148,12 +148,12 @@ This sequence of operations was run: [PUBLIC_KEY_HASH] ... -ꜩ0.000505 payload fees(the block proposer) ....... +ꜩ0.000505 Tx rollup finalize commitment:[TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This tx rollup finalize operation was successfully applied - Balance updates: - - Consumed gas: 2501.420@finalized level: - 0 + From: [PUBLIC_KEY_HASH] + This tx rollup finalize operation was successfully applied + Balance updates: + + Consumed gas: 2501.420@finalized level: + 0 ./tezos-client --wait none remove commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -- GitLab