Commit 27f860b
stevieoche
refactor: replace magic literals with named constants and add is_deprecated view
- router-quote: introduce BPS_DENOMINATOR (u32 = 10_000) as single
source of truth for the basis-points denominator; replace all five
raw 10000 literals (four validation guards and the checked_div in
get_quote) with the constant (closes #884)
- router-registry: introduce MAX_CONSTRAINT_LEN (usize = 32) to tie
the length guard and stack-buffer size in constraint_str_buf to one
declaration, preventing a silent divergence bug (closes #887)
- router-registry: add is_deprecated(env, name, version) view function
that returns Result<bool, RegistryError>; callers no longer need to
fetch and discard the full ContractEntry just to read one bool field;
add three tests covering false on fresh registration, true after
deprecate, and NotFound for an unregistered version (closes #886)
- router-registry: expand registry_error_to_batch from a generic
catch-all 'Error' string to fully exhaustive named arms so batch
callers can distinguish every failure variant (closes #885)1 parent c28197b commit 27f860b
2 files changed
Lines changed: 81 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
94 | 103 | | |
95 | 104 | | |
96 | 105 | | |
| |||
125 | 134 | | |
126 | 135 | | |
127 | 136 | | |
128 | | - | |
| 137 | + | |
129 | 138 | | |
130 | 139 | | |
131 | 140 | | |
| |||
168 | 177 | | |
169 | 178 | | |
170 | 179 | | |
171 | | - | |
| 180 | + | |
172 | 181 | | |
173 | 182 | | |
174 | 183 | | |
| |||
241 | 250 | | |
242 | 251 | | |
243 | 252 | | |
244 | | - | |
| 253 | + | |
245 | 254 | | |
246 | 255 | | |
247 | 256 | | |
| |||
346 | 355 | | |
347 | 356 | | |
348 | 357 | | |
349 | | - | |
| 358 | + | |
350 | 359 | | |
351 | 360 | | |
352 | 361 | | |
353 | | - | |
| 362 | + | |
354 | 363 | | |
355 | 364 | | |
356 | 365 | | |
| |||
509 | 518 | | |
510 | 519 | | |
511 | 520 | | |
512 | | - | |
| 521 | + | |
513 | 522 | | |
514 | 523 | | |
515 | 524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
79 | 91 | | |
80 | 92 | | |
81 | 93 | | |
| |||
297 | 309 | | |
298 | 310 | | |
299 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
300 | 333 | | |
301 | 334 | | |
302 | 335 | | |
| |||
794 | 827 | | |
795 | 828 | | |
796 | 829 | | |
797 | | - | |
| 830 | + | |
798 | 831 | | |
799 | | - | |
| 832 | + | |
800 | 833 | | |
801 | 834 | | |
802 | | - | |
| 835 | + | |
803 | 836 | | |
804 | 837 | | |
805 | 838 | | |
| |||
938 | 971 | | |
939 | 972 | | |
940 | 973 | | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
941 | 1004 | | |
942 | 1005 | | |
943 | 1006 | | |
| |||
0 commit comments