Skip to content

Commit

Permalink
Added _accepted=false to output from message sent to library
Browse files Browse the repository at this point in the history
  • Loading branch information
jjcnn committed Sep 27, 2022
1 parent 793931a commit a8d0c41
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
19 changes: 11 additions & 8 deletions src/eval/Runner.ml
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ let output_message_json gas_remaining mlist =

let output_event_json elist =
let open JSON.JSONLiteral in
`List
`List
(List.map elist ~f:(function
| Msg m -> JSON.Event.event_to_json m
| _ -> `Null))
| Msg m -> JSON.Event.event_to_json m
| _ -> `Null))

let assert_no_address_type_in_type t gas_remaining =
let open RunnerType in
Expand Down Expand Up @@ -411,11 +411,14 @@ let run_with_args args =
if is_deployment then deploy_library args gas_remaining
else
(* Messages to libraries are ignored, but tolerated. *)
`Assoc [
("gas_remaining", `String (Uint64.to_string gas_remaining));
("messages", output_message_json gas_remaining []);
("events", output_event_json []);
]
`Assoc
[
("gas_remaining", `String (Uint64.to_string gas_remaining));
( RunnerName.as_string ContractUtil.accepted_label,
`String (Bool.to_string false) );
("messages", output_message_json gas_remaining []);
("events", output_event_json []);
]
else
match FEParser.parse_cmodule args.input with
| Error e ->
Expand Down
7 changes: 6 additions & 1 deletion tests/runner/TestLib2/output_1.json
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
{ "gas_remaining": "62896", "messages": [], "events": [] }
{
"gas_remaining": "62896",
"_accepted": "false",
"messages": [],
"events": []
}

0 comments on commit a8d0c41

Please sign in to comment.