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

[fix] support checking complex method signature #224

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

cryptoriver
Copy link
Contributor

@cryptoriver cryptoriver commented Oct 25, 2023

What

The previous method signature check function is not able to handle complex method signature (e.g nested arguments). Because of that, the rosetta node is not able to process contract call method containing nested arguments.

This pr fixed this issue with updated solution below

  1. check method name to ensure it's not empty
  2. check the method contains valid parentheses by using the classic valid parentheses check algorithm (with stack).
  3. extract the parameter types into an array and perform the type check.

Tests

  • Added some more unit tests
  • End to End tests

@cryptoriver cryptoriver marked this pull request as ready for review October 25, 2023 07:40
@cryptoriver cryptoriver changed the title support checking complex method signature [fix] support checking complex method signature Oct 25, 2023
Copy link
Contributor

@palango palango left a comment

Choose a reason for hiding this comment

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

Looks good so far, please add one simple test case.

airgap/method_registry.go Show resolved Hide resolved
@palango palango merged commit c2d26d4 into celo-org:master Oct 25, 2023
4 checks passed
@palango
Copy link
Contributor

palango commented Oct 25, 2023

@cryptoriver Thanks for creating this PR!

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