Skip to content

Change handling of capitalization in `Tezos.get_entrypoint_opt`

E. Rivas requested to merge er433/get_entrypoint_opt/capital into dev

type:fixed

For LIGO developers

As reported in #ligo, It seems that there's some conflict right now for capitalized entrypoints:

$ docker run --rm -v "$PWD":"$PWD" -w "$PWD" ligolang/ligo:0.47.0 compile contract ff.ligo 
File "ff.ligo", line 2, characters 62-70:

Invalid entrypoint "%Upper". One of the following patterns is expected:
* "%bar" is expected for entrypoint "Bar"
* "%default" when no entrypoint is used.
$ cat ff.ligo 
function main(const x : address; const _ : address) is block {
  var r : option (contract (int)) := Tezos.get_entrypoint_opt("%Upper", x);
  var ra : address := Tezos.address(Option.unopt(r));
} with ((nil : list(operation)), ra) ;

This MR removes the failure when the entrypoint is capitalized (and moreover, works by uncapitalizing instead). It also removes the SELF/GET_ENTRYPOINT_OPT contract passes from 11-self_ast_typed, and leaves them in 13-self_ast_aggregated only. In addition, it also makes Tezos.self "wrong types" a warning instead of an error (see #1437 (closed)).

Changelog details:

Tezos.get_entrypoint_opt does not error anymore on the usage of a capitalized entrypoint.

Edited by E. Rivas

Merge request reports