Skip to content

Commit

Permalink
Revert when endpoint not found (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
virgil-serbanuta authored Nov 7, 2024
1 parent 3ba0065 commit 82e60d6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
17 changes: 17 additions & 0 deletions tests/ulm-with-contract/endpoints.notfound.run
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
push "noEndpoint";
hold_string_from_test_stack;
push "uint64";
hold_list_values_from_test_stack;
push 123_u64;
hold_list_values_from_test_stack;
encode_call_data;

return_value;
mock CallData;

call_contract 12345;
return_value;
check_eq ();

push_status;
check_eq 3
5 changes: 2 additions & 3 deletions ulm-semantics/main/preprocessing/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ module ULM-PREPROCESSING-ENDPOINTS
| "ulm" [token]
| "ulmWrap##init" [token]
| "CallData" [token]
| "EVMC_BAD_JUMP_DESTINATION" [token]
| "EVMC_REVERT" [token]
| "EVMC_SUCCESS" [token]
syntax BytesOrError ::= methodSignature(String, NormalizedFunctionParameterList) [function, total]
Expand Down Expand Up @@ -222,8 +222,7 @@ module ULM-PREPROCESSING-ENDPOINTS
, bufferId: _:Identifier
, gas: _:Identifier
)
// TODO: Is this the right kind of error?
=> :: state_hooks :: setStatus(:: ulm :: EVMC_BAD_JUMP_DESTINATION , .CallParamsList);
=> :: state_hooks :: setStatus(:: ulm :: EVMC_REVERT , .CallParamsList);
rule signatureToCall
(... signature: Signature:Identifier
Expand Down

0 comments on commit 82e60d6

Please sign in to comment.