Skip to content
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

Indexed event param #22

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

clemlak
Copy link

@clemlak clemlak commented Oct 21, 2024

Adds support for indexed event parameters when declared with #define.

@@ -841,6 +849,34 @@ mod tests {
);
}

#[test]
fn parse_sol_event_indexed() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the current schema of one test function with multiple assets per parser function

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👌

@@ -341,6 +341,10 @@ fn sol_type<'tokens, 'src: 'tokens>() -> impl Parser<'tokens, 'src, Spanned<DynS
recursive(|sol_raw_type| {
let sol_raw_primitive_type = ident().map(|(typ, _)| typ.to_string());

let sol_raw_event_primitive_type = ident()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would also allow indexed args inside tuples and inside function args. Maybe we should give the sol_type_parser a flag to enable "indexed" args.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, let me see how I can fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants