-
Notifications
You must be signed in to change notification settings - Fork 0
fix: frov hoisting bug #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/noir
Are you sure you want to change the base?
Conversation
this mitigates the case where inconsistencies between the logic in `collect_helpers` and `collect_tests` caused setup hooks to be invoked but not defined, as was the trigger for this PR. This also mean we will generate more helpers, as we'll now generate them when there's no real need for reuse of their logic, as exemplified in the previous commit
zkfrov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything is working like a charm now. Tested with the full Token tree and all functions are generated and included in their corresponding mods!
Left a small suggestion.
| if generate_setup_hooks { | ||
| for import in &self.imported_hooks { | ||
| output.push_str(format!(" use super::{};\n", import.name).as_str()); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to have: pack super imports in the mods, this
use super::{
when_shares_are_held,
when_called_on_behalf_of_other_with_authwit
};
instead of the current behaviour
use super::when_shares_are_held;
use super::when_called_on_behalf_of_other_with_authwit;
That was generated with this change
| if generate_setup_hooks { | |
| for import in &self.imported_hooks { | |
| output.push_str(format!(" use super::{};\n", import.name).as_str()); | |
| } | |
| } | |
| if generate_setup_hooks && !self.imported_hooks.is_empty() { | |
| if self.imported_hooks.len() == 1 { | |
| output.push_str(format!(" use super::{};\n", self.imported_hooks[0].name).as_str()); | |
| } else { | |
| output.push_str(" use super::{\n"); | |
| for (i, import) in self.imported_hooks.iter().enumerate() { | |
| output.push_str(&format!(" {}", import.name)); | |
| if i < self.imported_hooks.len() - 1 { | |
| output.push_str(",\n"); | |
| } else { | |
| output.push('\n'); | |
| } | |
| } | |
| output.push_str(" };\n"); | |
| } | |
| output.push('\n'); | |
| } |
see git history for details