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

Strip signature params #118

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

catalyst17
Copy link
Contributor

@catalyst17 catalyst17 commented Oct 28, 2024

TL;DR

Added functionality to strip and normalize Solidity function and event signatures.

What changed?

  • Introduced a new StripPayload function in utils.go to remove parameter names, 'indexed' keywords, and extra whitespaces from Solidity function or event signatures.
  • Implemented helper functions parseParameters, cleanType, and isType to support the signature stripping process.
  • Updated GetLogsByContractAndSignature and GetTransactionsByContractAndSignature handlers to use the new StripPayload function before processing requests.

How to test?

  1. Call the API endpoints for getting logs or transactions by contract and signature.
  2. Use various Solidity function and event signatures, including those with parameter names, indexed keywords, and extra whitespaces.
  3. Verify that the API correctly handles and matches these signatures, regardless of the extra information included.

Why make this change?

This change improves the flexibility and user-friendliness of the API. It allows users to query logs and transactions using more verbose Solidity signatures without requiring exact matches. This normalization process ensures that signatures with different formatting or additional information (like parameter names) are still correctly recognized and processed by the system.

@catalyst17 catalyst17 changed the title feat: strip signature params Strip signature params Oct 28, 2024
Copy link
Contributor Author

catalyst17 commented Oct 28, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @catalyst17 and the rest of your teammates on Graphite Graphite

@catalyst17 catalyst17 requested a review from iuwqyir October 28, 2024 16:15
@catalyst17 catalyst17 marked this pull request as ready for review October 28, 2024 16:15
@catalyst17 catalyst17 force-pushed the arsenii/block-317/strip-signature-params branch from a152139 to 86d4285 Compare October 28, 2024 16:16
Copy link

linear bot commented Oct 28, 2024

Copy link
Contributor Author

catalyst17 commented Oct 28, 2024

Merge activity

  • Oct 28, 1:35 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Oct 28, 1:37 PM EDT: Graphite rebased this pull request as part of a merge.
  • Oct 28, 1:38 PM EDT: A user merged this pull request with Graphite.

@catalyst17 catalyst17 changed the base branch from arsenii/block-316/transactions_function_selector_filter to graphite-base/118 October 28, 2024 17:35
@catalyst17 catalyst17 changed the base branch from graphite-base/118 to main October 28, 2024 17:35
@catalyst17 catalyst17 force-pushed the arsenii/block-317/strip-signature-params branch from 86d4285 to 6f0e94e Compare October 28, 2024 17:36
@catalyst17 catalyst17 merged commit 6d1009b into main Oct 28, 2024
4 checks passed
@catalyst17 catalyst17 deleted the arsenii/block-317/strip-signature-params branch October 28, 2024 17:38
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