You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### TL;DR
Implemented signature lookup for transactions and improved query filtering.
### What changed?
- Activated signature lookup in `GetTransactionsByContractAndSignature` function
- Exported `ExtractFunctionSelector` function
- Updated ClickHouse queries to include function selector for transactions
- Generalised signature clause handling for both logs and transactions in ClickHouse queries
### How to test?
1. Make a GET request to `/{chainId}/transactions/{to}/{signature}` endpoint with a valid contract address and function signature
```
curl --location 'http://localhost:3000/660279/transactions/0x6e55472109e6abe4054a8e8b8d9edffcb31032c5/setMinDstGas(uint16,uint16,uint256)?limit=1' \
--header 'Authorization: Basic ...'
```
2. Verify that the returned transactions are filtered correctly based on the provided signature
```json
{
"meta": {
"chain_id": 660279,
"address": "0x6e55472109e6abe4054a8e8b8d9edffcb31032c5",
"signature": "0xdf2a5b3b87f900bae4c01587a04a2d9f5990f0066e443e87fe88cf2ce9974ff0",
"page": 0,
"limit": 5,
"total_items": 5,
"total_pages": 0
},
"data": [
{
...
"to_address": "0x6e55472109e6abe4054a8e8b8d9edffcb31032c5",
"value": 0,
"gas": 52119,
"gas_price": 1600000000,
"data": "0xdf2a5b3b00000000000000000000000000000000000000000000000000000000000000af00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000030d40",
"function_selector": "0xdf2a5b3b",
...
}
]
}
```
### Why make this change?
This change enables more precise filtering of transactions based on function signatures, improving the ability to query specific contract interactions. It also aligns the transaction querying capabilities with those already available for logs, providing a more consistent and powerful API for data retrieval.
0 commit comments