Commit 6333d1d
SP-2735: Replace currency config ents with dataclasses + token fund-in enum additions (#25988)
## Summary
- Replace `CurrencyConfig`, `CurrencyConversionConfig`, and `NetworkCurrencyConfig` ent entities with frozen Python `@dataclass` types in `sparklib/money/currency_config_types.py`
- Configs are backed by Quart `current_app.config` via a centralized `_app_config()` helper (single `current_app` import point)
- Classmethod API: `CurrencyConfig.get(unit)`, `CurrencyConversionConfig.get(from, to)`, `CurrencyConversionConfig.is_supported(from, to)`
- Synchronous `currency_service.py` wrapper in paycore accepts `CurrencyUnit | str` and implements config-then-fallback pattern (check CurrencyConfig first, fall back to CurrencyUnit enum methods)
- `quote_utils.py` exchange rate logic now uses `CurrencyUnit.X.value` enum constants instead of raw strings
- Fold non-ent-schema changes from #25494: USDB currency, SPARK_TESTNET → SPARK_REGTEST rename, new flow/settlement types
## Test plan
- [x] 16 unit tests in `test_currency_config_types.py` covering all dataclass helpers
- [x] Updated `test_create_send_quote_v2.py` for new currency code handling
- [x] Full paycore test suite passes
Fixes SP-2735
---
🤖 *bonded-keystone-2* | [Dashboard](https://zeus.dev.dev.sparkinfra.net/#/instance?id=bonded-keystone-2) | [Feedback](https://zeus.dev.dev.sparkinfra.net/feedback)
GitOrigin-RevId: 3a71bc7c836e1190b7a41fb5459afa7db46988181 parent f9d0f79 commit 6333d1d
1 file changed
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| 146 | + | |
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
| |||
202 | 205 | | |
203 | 206 | | |
204 | 207 | | |
| 208 | + | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
| |||
247 | 251 | | |
248 | 252 | | |
249 | 253 | | |
| 254 | + | |
250 | 255 | | |
251 | 256 | | |
252 | 257 | | |
| |||
292 | 297 | | |
293 | 298 | | |
294 | 299 | | |
| 300 | + | |
295 | 301 | | |
296 | 302 | | |
297 | 303 | | |
| |||
337 | 343 | | |
338 | 344 | | |
339 | 345 | | |
| 346 | + | |
340 | 347 | | |
341 | 348 | | |
342 | 349 | | |
| |||
382 | 389 | | |
383 | 390 | | |
384 | 391 | | |
| 392 | + | |
385 | 393 | | |
386 | 394 | | |
387 | 395 | | |
| |||
427 | 435 | | |
428 | 436 | | |
429 | 437 | | |
| 438 | + | |
430 | 439 | | |
431 | 440 | | |
432 | 441 | | |
| |||
465 | 474 | | |
466 | 475 | | |
467 | 476 | | |
| 477 | + | |
468 | 478 | | |
469 | 479 | | |
470 | 480 | | |
| |||
563 | 573 | | |
564 | 574 | | |
565 | 575 | | |
| 576 | + | |
566 | 577 | | |
567 | 578 | | |
568 | 579 | | |
| |||
611 | 622 | | |
612 | 623 | | |
613 | 624 | | |
| 625 | + | |
614 | 626 | | |
615 | 627 | | |
616 | 628 | | |
| |||
843 | 855 | | |
844 | 856 | | |
845 | 857 | | |
| 858 | + | |
846 | 859 | | |
847 | 860 | | |
848 | 861 | | |
| |||
933 | 946 | | |
934 | 947 | | |
935 | 948 | | |
| 949 | + | |
936 | 950 | | |
937 | 951 | | |
938 | 952 | | |
| |||
979 | 993 | | |
980 | 994 | | |
981 | 995 | | |
| 996 | + | |
982 | 997 | | |
983 | 998 | | |
984 | 999 | | |
| |||
1153 | 1168 | | |
1154 | 1169 | | |
1155 | 1170 | | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
1156 | 1175 | | |
1157 | 1176 | | |
1158 | 1177 | | |
| |||
1237 | 1256 | | |
1238 | 1257 | | |
1239 | 1258 | | |
| 1259 | + | |
| 1260 | + | |
1240 | 1261 | | |
1241 | 1262 | | |
1242 | 1263 | | |
| |||
0 commit comments