-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### 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.
- Loading branch information
Showing
3 changed files
with
160 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters