Commit b667e36
Verify Token-2022 settlement against the whole existing suite
The Token-2022 paths are worth little if they only hold for the handful
of cases someone thought to write twice, so instead of a parallel suite
this reruns the suite that already exists against the second program.
`common::also_under_token_2022!(some_test)` sits in front of a test and
generates `some_test_token_2022`, which runs the same body with
Token-2022 as the thread-local active program. Nothing in the body
changes: the token helpers build against `token::active()`, and
`payer_signed_tx` / `signed_tx` repoint the legacy program id in every
instruction they assemble. 75 tests are covered this way, across buffer
creation, reclamation, order settlement, pushes, and limit prices --
error paths as much as happy ones.
Naming the test in front of it, rather than wrapping the body, keeps the
indentation and makes a stale name a compile error instead of a test
that quietly stopped being generated. A test that can only hold under
one program (one pinned to the legacy native mint) goes without and says
why, as do the suites whose instructions name no token program at all.
Three tests are Token-2022-only, covering what has no legacy analogue --
a buffer for a mint with a `TransferFeeConfig`, which needs a
`TransferFeeAmount` on every account holding it and so must be longer
than the base layout:
- `creates_buffer_sized_for_a_mint_with_extensions`
- `recreating_an_extension_mint_buffer_is_idempotent`
- `reclaims_a_buffer_sized_for_an_extension_mint`
`bench-report.json` gains the CU, account, and transaction-byte readings
for every generated test. Token-2022 costs more per instruction, as
expected from the longer accounts and the extension-aware transfer path.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 818938f commit b667e36
12 files changed
Lines changed: 629 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| 11 | + | |
9 | 12 | | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
| 16 | + | |
12 | 17 | | |
13 | 18 | | |
| 19 | + | |
14 | 20 | | |
| 21 | + | |
15 | 22 | | |
| 23 | + | |
16 | 24 | | |
| 25 | + | |
17 | 26 | | |
| 27 | + | |
18 | 28 | | |
| 29 | + | |
19 | 30 | | |
| 31 | + | |
20 | 32 | | |
| 33 | + | |
21 | 34 | | |
| 35 | + | |
22 | 36 | | |
23 | 37 | | |
24 | 38 | | |
25 | 39 | | |
26 | 40 | | |
27 | 41 | | |
| 42 | + | |
28 | 43 | | |
| 44 | + | |
29 | 45 | | |
30 | 46 | | |
31 | 47 | | |
32 | 48 | | |
| 49 | + | |
33 | 50 | | |
| 51 | + | |
34 | 52 | | |
35 | 53 | | |
| 54 | + | |
36 | 55 | | |
37 | 56 | | |
| 57 | + | |
38 | 58 | | |
| 59 | + | |
39 | 60 | | |
| 61 | + | |
40 | 62 | | |
| 63 | + | |
41 | 64 | | |
| 65 | + | |
42 | 66 | | |
| 67 | + | |
43 | 68 | | |
| 69 | + | |
44 | 70 | | |
| 71 | + | |
45 | 72 | | |
| 73 | + | |
46 | 74 | | |
47 | 75 | | |
48 | 76 | | |
49 | 77 | | |
50 | 78 | | |
51 | 79 | | |
| 80 | + | |
52 | 81 | | |
| 82 | + | |
53 | 83 | | |
54 | 84 | | |
55 | 85 | | |
56 | 86 | | |
| 87 | + | |
57 | 88 | | |
| 89 | + | |
58 | 90 | | |
59 | 91 | | |
| 92 | + | |
60 | 93 | | |
61 | 94 | | |
| 95 | + | |
62 | 96 | | |
| 97 | + | |
63 | 98 | | |
| 99 | + | |
64 | 100 | | |
| 101 | + | |
65 | 102 | | |
| 103 | + | |
66 | 104 | | |
| 105 | + | |
67 | 106 | | |
| 107 | + | |
68 | 108 | | |
| 109 | + | |
69 | 110 | | |
| 111 | + | |
70 | 112 | | |
71 | 113 | | |
72 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| 161 | + | |
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
| |||
179 | 181 | | |
180 | 182 | | |
181 | 183 | | |
| 184 | + | |
182 | 185 | | |
183 | 186 | | |
184 | 187 | | |
| |||
213 | 216 | | |
214 | 217 | | |
215 | 218 | | |
| 219 | + | |
216 | 220 | | |
217 | 221 | | |
218 | 222 | | |
| |||
262 | 266 | | |
263 | 267 | | |
264 | 268 | | |
| 269 | + | |
265 | 270 | | |
266 | 271 | | |
267 | 272 | | |
| |||
300 | 305 | | |
301 | 306 | | |
302 | 307 | | |
| 308 | + | |
303 | 309 | | |
304 | 310 | | |
305 | 311 | | |
| |||
329 | 335 | | |
330 | 336 | | |
331 | 337 | | |
| 338 | + | |
332 | 339 | | |
333 | 340 | | |
334 | 341 | | |
| |||
360 | 367 | | |
361 | 368 | | |
362 | 369 | | |
| 370 | + | |
363 | 371 | | |
364 | 372 | | |
365 | 373 | | |
| |||
389 | 397 | | |
390 | 398 | | |
391 | 399 | | |
| 400 | + | |
392 | 401 | | |
393 | 402 | | |
394 | 403 | | |
| |||
415 | 424 | | |
416 | 425 | | |
417 | 426 | | |
| 427 | + | |
418 | 428 | | |
419 | 429 | | |
420 | 430 | | |
| |||
493 | 503 | | |
494 | 504 | | |
495 | 505 | | |
| 506 | + | |
496 | 507 | | |
497 | 508 | | |
498 | 509 | | |
| |||
532 | 543 | | |
533 | 544 | | |
534 | 545 | | |
| 546 | + | |
535 | 547 | | |
536 | 548 | | |
537 | 549 | | |
| |||
558 | 570 | | |
559 | 571 | | |
560 | 572 | | |
| 573 | + | |
561 | 574 | | |
562 | 575 | | |
563 | 576 | | |
| |||
580 | 593 | | |
581 | 594 | | |
582 | 595 | | |
| 596 | + | |
583 | 597 | | |
584 | 598 | | |
585 | 599 | | |
| |||
622 | 636 | | |
623 | 637 | | |
624 | 638 | | |
| 639 | + | |
625 | 640 | | |
626 | 641 | | |
627 | 642 | | |
| |||
674 | 689 | | |
675 | 690 | | |
676 | 691 | | |
| 692 | + | |
677 | 693 | | |
678 | 694 | | |
679 | 695 | | |
| |||
750 | 766 | | |
751 | 767 | | |
752 | 768 | | |
| 769 | + | |
753 | 770 | | |
754 | 771 | | |
755 | 772 | | |
| |||
791 | 808 | | |
792 | 809 | | |
793 | 810 | | |
| 811 | + | |
794 | 812 | | |
795 | 813 | | |
796 | 814 | | |
| |||
822 | 840 | | |
823 | 841 | | |
824 | 842 | | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
| 843 | + | |
831 | 844 | | |
832 | 845 | | |
833 | 846 | | |
| |||
840 | 853 | | |
841 | 854 | | |
842 | 855 | | |
| 856 | + | |
843 | 857 | | |
844 | 858 | | |
845 | 859 | | |
| |||
869 | 883 | | |
870 | 884 | | |
871 | 885 | | |
| 886 | + | |
| 887 | + | |
872 | 888 | | |
873 | 889 | | |
874 | 890 | | |
| |||
898 | 914 | | |
899 | 915 | | |
900 | 916 | | |
| 917 | + | |
901 | 918 | | |
902 | 919 | | |
903 | 920 | | |
| |||
932 | 949 | | |
933 | 950 | | |
934 | 951 | | |
| 952 | + | |
935 | 953 | | |
936 | 954 | | |
937 | 955 | | |
| |||
976 | 994 | | |
977 | 995 | | |
978 | 996 | | |
| 997 | + | |
979 | 998 | | |
980 | 999 | | |
981 | 1000 | | |
| |||
1003 | 1022 | | |
1004 | 1023 | | |
1005 | 1024 | | |
| 1025 | + | |
1006 | 1026 | | |
1007 | 1027 | | |
1008 | 1028 | | |
| |||
1030 | 1050 | | |
1031 | 1051 | | |
1032 | 1052 | | |
| 1053 | + | |
1033 | 1054 | | |
1034 | 1055 | | |
1035 | 1056 | | |
| |||
1054 | 1075 | | |
1055 | 1076 | | |
1056 | 1077 | | |
| 1078 | + | |
1057 | 1079 | | |
1058 | 1080 | | |
1059 | 1081 | | |
| |||
1078 | 1100 | | |
1079 | 1101 | | |
1080 | 1102 | | |
| 1103 | + | |
1081 | 1104 | | |
1082 | 1105 | | |
1083 | 1106 | | |
| |||
0 commit comments