Commit 4024785
fix: ensure CTX API endpoints switch correctly between testnet and mainnet
- Removed cached kBaseURL constant that was preventing network switching
- baseURL property now computes URL dynamically based on current network
- This fixes the issue where switching from testnet to mainnet (or vice versa) required app restart
- Updated CLAUDE.md with network switching documentation and best practices
The issue occurred because the API endpoint was cached at initialization time.
Now it correctly evaluates the network on each request, ensuring:
- Testnet uses: http://staging.spend.ctx.com/
- Mainnet uses: https://spend.ctx.com/
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 2a69fce commit 4024785
2 files changed
Lines changed: 24 additions & 3 deletions
File tree
- DashWallet/Sources/Models/Explore Dash/Services/DashSpend/CTX
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
388 | 409 | | |
389 | 410 | | |
390 | 411 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
| |||
64 | 62 | | |
65 | 63 | | |
66 | 64 | | |
67 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
0 commit comments