Commit 8d75cdf
committed
gnd: Validate event/call handler signatures against ABI
Add validation that event handler event signatures and call handler
function signatures match entries in the source ABI. This catches
errors like referencing a nonexistent event or using wrong parameter
types early, during codegen rather than at deploy time.
The matching logic mirrors graph-node's runtime matching:
- Event signatures support both indexed and non-indexed forms
- Non-indexed fallback only matches if a single event variant exists
- Function signatures use canonical form: name(type1,type2,...)
Changes:
- Add `event` field to EventHandler (Solidity event signature)
- Replace `call_handlers: Vec<String>` with `Vec<CallHandler>` struct
containing both the function signature and handler name
- Add validate_handler_signatures() wired into both codegen and build
- Update test ABI fixtures to include actual events/functions1 parent d12d454 commit 8d75cdf
3 files changed
Lines changed: 586 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
660 | | - | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
661 | 671 | | |
662 | 672 | | |
663 | 673 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
| 99 | + | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
129 | 139 | | |
130 | 140 | | |
131 | 141 | | |
| |||
223 | 233 | | |
224 | 234 | | |
225 | 235 | | |
| 236 | + | |
226 | 237 | | |
227 | 238 | | |
228 | 239 | | |
| |||
232 | 243 | | |
233 | 244 | | |
234 | 245 | | |
235 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
236 | 250 | | |
237 | 251 | | |
238 | 252 | | |
| |||
320 | 334 | | |
321 | 335 | | |
322 | 336 | | |
| 337 | + | |
323 | 338 | | |
324 | 339 | | |
325 | 340 | | |
| |||
329 | 344 | | |
330 | 345 | | |
331 | 346 | | |
332 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
333 | 351 | | |
334 | 352 | | |
335 | 353 | | |
| |||
0 commit comments