-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added just in time encoding for events signatures (#57)
### TL;DR Updated API structure and query handling for improved contract and signature-based queries. ### What changed? - Modified `Meta` struct to use `*uint64` for `ChainIdentifier` - Updated `GetChainId` function to return `*uint64` instead of string - Renamed route parameters for better clarity (e.g., `contractAddress` to `to`) - Implemented signature hashing for event and function signatures - Updated query filters to use `ToAddress` instead of `ContractAddress` - Added support for querying logs by padded `to_address` in topic_2 - Adjusted query building logic to handle different tables (logs and transactions) ### How to test? 1. Test API endpoints with updated route parameters: - `/api/v1/{chainId}/transactions/{to}` - `/api/v1/{chainId}/events/{to}` - `/api/v1/{chainId}/transactions/{to}/{signature}` - `/api/v1/{chainId}/events/{to}/{signature}` 2. Verify that queries work correctly with the new `ToAddress` filter 3. Check that signature hashing is applied correctly for event and function signatures 4. Ensure that logs queries correctly filter by the padded `to_address` in topic_2 ### Why make this change? These changes improve the API's flexibility and accuracy when querying contract-specific data. By using more precise parameter names and implementing proper signature hashing, the API can provide more reliable and targeted results. The updates also enhance the ability to filter logs by the correct `to_address` format, ensuring better compatibility with Ethereum event structures.
- Loading branch information
Showing
9 changed files
with
136 additions
and
55 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
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
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
Oops, something went wrong.