refactor: cleaning up flow of calls generation#18265
Conversation
fd553a2 to
d2467ff
Compare
| @@ -4,10 +4,7 @@ | |||
| //! | |||
There was a problem hiding this comment.
Moved it from functions dir as it no longer made sense to have it there.
I want the functions dir to only contain the simple marker attributes and to move all the complex logic out of there.
| @@ -39,10 +34,6 @@ comptime fn get_abi_relevant_attributes(f: FunctionDefinition) -> Quoted { | |||
| } | |||
|
|
|||
| pub(crate) comptime fn transform_private(f: FunctionDefinition) -> Quoted { | |||
There was a problem hiding this comment.
These functions now became cleaner as the registration really had nothing to do here. I plan on renaming these functions to generate_{private,public,utility}_external to follow the naming of generate_{private,public}_internal and
| // We generate structs and their implementations necessary for convenient functions calls. | ||
| let interface = generate_contract_interface(m); | ||
| let self_call_structs = generate_self_call_structs(m); | ||
| let self_call_structs = generate_external_function_self_calls_structs(m); |
There was a problem hiding this comment.
Somewhat unrelated but felt like the original function name was no longer descriptive enough.
| /// `self.enqueue_self.some_public_function(args)` | ||
| /// - `EnqueueSelfStatic`: Enqueue your own view public functions, e.g.: | ||
| /// `self.enqueue_self_static.some_view_function(args)` | ||
| comptime fn generate_self_call_structs(m: Module) -> Quoted { |
There was a problem hiding this comment.
Replaced with calls_generation::external_functions::generate_external_function_self_calls_structs
| @@ -1,3 +1,6 @@ | |||
| // TODO(benesjan): Instead of having this registry, just generate the authorize check when the given | |||
| // `__aztec_nr_internals__` function is being generated. Having this registry is completely unnecessary. | |||
There was a problem hiding this comment.
This registry is also unnecessary. Plan on tackling this once the stack is merged. (will go through all the "TODO(benesjan)" in the codebase once that's done and do the cleanups).
5c45a7f to
e9e3a26
Compare
a541e1f to
8a87c75
Compare
8a87c75 to
58d83ff
Compare
dc586db to
5843610
Compare
803e713 to
f59e55f
Compare
5843610 to
ffe6c15
Compare
6eedab5 to
cc4088d
Compare
f59e55f to
8ba4963
Compare
Flakey Tests🤖 says: This CI run detected 2 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
8ba4963 to
571f69f
Compare
cc4088d to
09bfcdb
Compare
fd11b14 to
7241673
Compare
09bfcdb to
afc0612
Compare
Before this PR we generate the external function calls when the external macro was run and then we added the result to registries for later to be obtained by the aztec macro. This flow became unnecessarily complex because now the external macro just registers the function definitions in the external function registry and then it uses this registry to generate the `__aztec_nr_internals__` functions in the aztec macro. We can use this same function registry also for generating the calls obviating the need for the call registries.
afc0612 to
e82cde7
Compare
Before this PR we generate the external function calls when the external macro was run and then we added the result to registries for later to be obtained by the aztec macro. This flow became unnecessarily complex because now the external macro just registers the function definitions in the external function registry and then it uses this registry to generate the `__aztec_nr_internals__` functions in the aztec macro. We can use this same function registry also for generating the calls obviating the need for the call registries.

Before this PR we generate the external function calls when the external macro was run and then we added the result to registries for later to be obtained by the aztec macro.
This flow became unnecessarily complex because now the external macro just registers the function definitions in the external function registry and then it uses this registry to generate the
__aztec_nr_internals__functions in the aztec macro. We can use this same function registry also for generating the calls obviating the need for the call registries.