Commit f9bf58c
authored
fix signature handling (#169)
### TL;DR
Improved signature handling for logs and transactions by moving ABI construction into the main handler functions.
### What changed?
- Consolidated log and transaction handler logic by moving signature processing into the main handler functions
- Updated signature hash calculation to use ABI-generated IDs instead of manual Keccak256 hashing
- Simplified function signatures by removing unnecessary parameter passing
- Improved error handling for ABI construction
### How to test?
1. Query event logs with a valid event signature
- `GET /{chainId}/events/{contract}/{signature}`
2. Query transactions with a valid function signature
- `GET /{chainId}/transactions/{to}/{signature}`
3. Verify that signature hashes are correctly generated from ABIs
4. Confirm that error handling works for invalid signatures
### Why make this change?
The previous implementation had redundant signature processing and used a less reliable method for generating signature hashes. This change makes the code more maintainable and uses the more accurate ABI-generated IDs for signature matching, reducing potential edge cases and improving reliability.File tree
3 files changed
+29
-31
lines changed- internal
- common
- handlers
3 files changed
+29
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
45 | | - | |
| 44 | + | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
| |||
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
70 | | - | |
71 | | - | |
| 69 | + | |
72 | 70 | | |
73 | 71 | | |
74 | 72 | | |
| |||
94 | 92 | | |
95 | 93 | | |
96 | 94 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 95 | + | |
105 | 96 | | |
106 | 97 | | |
107 | | - | |
| 98 | + | |
108 | 99 | | |
109 | 100 | | |
110 | 101 | | |
111 | 102 | | |
112 | 103 | | |
113 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
114 | 108 | | |
115 | 109 | | |
116 | 110 | | |
117 | 111 | | |
118 | 112 | | |
119 | 113 | | |
| 114 | + | |
120 | 115 | | |
121 | 116 | | |
122 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | | - | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
63 | | - | |
64 | | - | |
| 62 | + | |
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
| |||
87 | 85 | | |
88 | 86 | | |
89 | 87 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 88 | + | |
98 | 89 | | |
99 | 90 | | |
100 | | - | |
| 91 | + | |
101 | 92 | | |
102 | 93 | | |
103 | 94 | | |
104 | 95 | | |
105 | 96 | | |
106 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
107 | 101 | | |
108 | 102 | | |
109 | 103 | | |
110 | 104 | | |
111 | 105 | | |
112 | 106 | | |
| 107 | + | |
113 | 108 | | |
114 | 109 | | |
115 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
| |||
0 commit comments