You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the ABI does not have a concept of a return parameter, only parameters. So to emulate a return parameter, a constant MAIN_RETURN_NAME is used in the parameter list.
Solution
Ad return_type to ABI. This means that we can remove the MAIN_RETURN_NAME constant from the compiler and it is solely a value that lives in noirc_abi. When the Verifier.toml file is parsed, this is the only time that one needs to check for MAIN_RETURN_NAME so that it can be placed into the return_parameter field.
Note that the field to add is return_type and not return_parameter :
When converting noir return parameters into ABI parameters; we are currently doing this for only the main function. This is more abundant by the fact that we name that return parameter MAIN_RETURN_NAME. We have already noted that the main return type needs to be public, so the visibility field here is not useful. (There is an argument to be made that to make the function more generic, we should return the visibility) For this argument, we can simply return the type and visibility.
Alternatives considered
Additional context
The text was updated successfully, but these errors were encountered:
Problem
Currently the ABI does not have a concept of a return parameter, only parameters. So to emulate a return parameter, a constant
MAIN_RETURN_NAME
is used in the parameter list.Solution
Ad
return_type
to ABI. This means that we can remove theMAIN_RETURN_NAME
constant from the compiler and it is solely a value that lives innoirc_abi
. When the Verifier.toml file is parsed, this is the only time that one needs to check forMAIN_RETURN_NAME
so that it can be placed into thereturn_parameter
field.Note that the field to add is
return_type
and notreturn_parameter
:When converting noir return parameters into ABI parameters; we are currently doing this for only the main function. This is more abundant by the fact that we name that return parameter
MAIN_RETURN_NAME
. We have already noted that the main return type needs to be public, so the visibility field here is not useful. (There is an argument to be made that to make the function more generic, we should return the visibility) For this argument, we can simply return the type and visibility.Alternatives considered
Additional context
The text was updated successfully, but these errors were encountered: