Commit b297574
authored
Instead of a key, use an incrementing
## Motivation
The system needs to enforce that events are never overwritten anyway. It
makes them much harder to use for applications if the applications need
to keep track of that.
## Proposal
Replace the general `key: Vec<u8>` with `index: u32`. Instead of the
application, the system now chooses the index, and always uses the next
available number.
## Test Plan
The tests have been updated, and already use system events.
The user application events will be tested more thoroughly later, when
we have an example (probably `social`) that uses them.
## Release Plan
- Nothing to do / These changes follow the usual release cycle.
## Links
- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)index for events. (#3672)1 parent cf2ecfb commit b297574
File tree
23 files changed
+95
-115
lines changed- examples/meta-counter/src
- linera-base/src
- linera-core/src
- chain_worker/state
- client
- unit_tests
- linera-execution/src
- wasm
- linera-rpc/tests/snapshots
- linera-sdk
- src/contract
- wit
- linera-service-graphql-client
- gql
- src
23 files changed
+95
-115
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 43 | + | |
| 44 | + | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1198 | 1198 | | |
1199 | 1199 | | |
1200 | 1200 | | |
1201 | | - | |
1202 | | - | |
1203 | | - | |
1204 | | - | |
| 1201 | + | |
| 1202 | + | |
1205 | 1203 | | |
1206 | 1204 | | |
1207 | 1205 | | |
| |||
1214 | 1212 | | |
1215 | 1213 | | |
1216 | 1214 | | |
1217 | | - | |
| 1215 | + | |
1218 | 1216 | | |
1219 | 1217 | | |
1220 | 1218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
527 | | - | |
| 526 | + | |
| 527 | + | |
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
| |||
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
22 | | - | |
| 20 | + | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
| |||
233 | 231 | | |
234 | 232 | | |
235 | 233 | | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | 234 | | |
257 | 235 | | |
258 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3108 | 3108 | | |
3109 | 3109 | | |
3110 | 3110 | | |
3111 | | - | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
3112 | 3115 | | |
3113 | 3116 | | |
3114 | 3117 | | |
3115 | 3118 | | |
3116 | 3119 | | |
3117 | 3120 | | |
3118 | | - | |
| 3121 | + | |
3119 | 3122 | | |
3120 | 3123 | | |
3121 | 3124 | | |
| |||
3131 | 3134 | | |
3132 | 3135 | | |
3133 | 3136 | | |
3134 | | - | |
| 3137 | + | |
3135 | 3138 | | |
3136 | 3139 | | |
3137 | 3140 | | |
3138 | 3141 | | |
3139 | | - | |
| 3142 | + | |
3140 | 3143 | | |
3141 | 3144 | | |
3142 | 3145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2450 | 2450 | | |
2451 | 2451 | | |
2452 | 2452 | | |
2453 | | - | |
| 2453 | + | |
2454 | 2454 | | |
2455 | 2455 | | |
2456 | 2456 | | |
| |||
2470 | 2470 | | |
2471 | 2471 | | |
2472 | 2472 | | |
2473 | | - | |
| 2473 | + | |
2474 | 2474 | | |
2475 | 2475 | | |
2476 | 2476 | | |
| |||
2560 | 2560 | | |
2561 | 2561 | | |
2562 | 2562 | | |
2563 | | - | |
| 2563 | + | |
2564 | 2564 | | |
2565 | 2565 | | |
2566 | 2566 | | |
| |||
2698 | 2698 | | |
2699 | 2699 | | |
2700 | 2700 | | |
2701 | | - | |
| 2701 | + | |
2702 | 2702 | | |
2703 | 2703 | | |
2704 | 2704 | | |
| |||
2837 | 2837 | | |
2838 | 2838 | | |
2839 | 2839 | | |
2840 | | - | |
| 2840 | + | |
2841 | 2841 | | |
2842 | 2842 | | |
2843 | 2843 | | |
2844 | | - | |
2845 | 2844 | | |
2846 | | - | |
| 2845 | + | |
| 2846 | + | |
2847 | 2847 | | |
2848 | 2848 | | |
2849 | 2849 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | | - | |
215 | 213 | | |
216 | 214 | | |
217 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | | - | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
433 | 435 | | |
434 | 436 | | |
435 | 437 | | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
436 | 451 | | |
437 | 452 | | |
438 | 453 | | |
| |||
689 | 704 | | |
690 | 705 | | |
691 | 706 | | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
692 | 713 | | |
693 | 714 | | |
694 | 715 | | |
| |||
0 commit comments