Commit a07402d
committed
feat(contract): add notification category metadata to events
Off-chain consumers could not selectively subscribe to specific
notification categories because every event looked the same beyond its
name. This adds a NotificationCategory (Group / Admin / Financial)
published as a trailing, indexed topic on every emitted event so
listeners and indexers can filter by category without decoding payloads.
- Introduce NotificationCategory enum in base::events.
- Attach the category as the last topic of every contract event.
- Keep the change backward compatible: the event name remains the first
topic and all pre-existing topics/data keep their positions; the new
category topic is simply appended and ignored by existing listeners.
- Add tests covering each category and a subscriber that filters by type.1 parent 396bda5 commit a07402d
4 files changed
Lines changed: 370 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| |||
275 | 276 | | |
276 | 277 | | |
277 | 278 | | |
| 279 | + | |
278 | 280 | | |
279 | 281 | | |
280 | 282 | | |
| |||
297 | 299 | | |
298 | 300 | | |
299 | 301 | | |
300 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
301 | 306 | | |
302 | 307 | | |
303 | 308 | | |
| |||
313 | 318 | | |
314 | 319 | | |
315 | 320 | | |
316 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
317 | 325 | | |
318 | 326 | | |
319 | 327 | | |
| |||
646 | 654 | | |
647 | 655 | | |
648 | 656 | | |
649 | | - | |
650 | 657 | | |
| 658 | + | |
| 659 | + | |
651 | 660 | | |
652 | 661 | | |
653 | 662 | | |
| |||
680 | 689 | | |
681 | 690 | | |
682 | 691 | | |
683 | | - | |
684 | 692 | | |
| 693 | + | |
| 694 | + | |
685 | 695 | | |
686 | 696 | | |
687 | 697 | | |
| |||
714 | 724 | | |
715 | 725 | | |
716 | 726 | | |
717 | | - | |
718 | 727 | | |
| 728 | + | |
| 729 | + | |
719 | 730 | | |
720 | 731 | | |
721 | 732 | | |
| |||
761 | 772 | | |
762 | 773 | | |
763 | 774 | | |
764 | | - | |
765 | 775 | | |
| 776 | + | |
| 777 | + | |
766 | 778 | | |
767 | 779 | | |
768 | 780 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
2 | 27 | | |
3 | 28 | | |
4 | 29 | | |
5 | 30 | | |
6 | 31 | | |
7 | 32 | | |
8 | 33 | | |
| 34 | + | |
| 35 | + | |
9 | 36 | | |
10 | 37 | | |
11 | 38 | | |
12 | 39 | | |
13 | 40 | | |
14 | 41 | | |
15 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
16 | 46 | | |
17 | 47 | | |
18 | 48 | | |
19 | 49 | | |
20 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
21 | 54 | | |
22 | 55 | | |
23 | 56 | | |
24 | 57 | | |
25 | 58 | | |
26 | 59 | | |
27 | 60 | | |
| 61 | + | |
| 62 | + | |
28 | 63 | | |
29 | 64 | | |
30 | 65 | | |
| |||
34 | 69 | | |
35 | 70 | | |
36 | 71 | | |
| 72 | + | |
| 73 | + | |
37 | 74 | | |
38 | 75 | | |
39 | 76 | | |
| |||
43 | 80 | | |
44 | 81 | | |
45 | 82 | | |
| 83 | + | |
| 84 | + | |
46 | 85 | | |
47 | 86 | | |
48 | 87 | | |
| |||
52 | 91 | | |
53 | 92 | | |
54 | 93 | | |
| 94 | + | |
| 95 | + | |
55 | 96 | | |
56 | 97 | | |
57 | 98 | | |
| |||
63 | 104 | | |
64 | 105 | | |
65 | 106 | | |
| 107 | + | |
| 108 | + | |
66 | 109 | | |
67 | 110 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
259 | 262 | | |
0 commit comments