[TASK-15956] chore: disable bolivia kyc#1386
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughBolivia ('BO') entry was removed from the MantecaSupportedExchanges configuration in the AddMoney constants module. The entry was commented out, preventing Bolivia from being used for exchange routing. No logic or control flow changes were introduced. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/AddMoney/consts/index.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-14T14:42:54.411Z
Learnt from: Zishan-7
Repo: peanutprotocol/peanut-ui PR: 1094
File: src/utils/withdraw.utils.ts:181-191
Timestamp: 2025-08-14T14:42:54.411Z
Learning: The countryCodeMap in src/components/AddMoney/consts/index.ts uses uppercase 3-letter country codes as keys (like 'AUT', 'BEL', 'CZE') that map to 2-letter country codes, requiring input normalization to uppercase for proper lookups.
Applied to files:
src/components/AddMoney/consts/index.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Deploy-Preview
| // MX: 'MEXICO', | ||
| //PH: 'PHILIPPINES', | ||
| BO: 'BOLIVIA', | ||
| //BO: 'BOLIVIA', |
There was a problem hiding this comment.
🧩 Analysis chain
Incomplete removal: Bolivia still referenced in withdraw flow logic.
While Bolivia is commented out from MantecaSupportedExchanges, it remains hardcoded in the Manteca country checks at lines 2584 and 2637. This creates inconsistent behavior:
- Add money flow (line 2670): Bolivia won't route to Manteca ✓
- Withdraw flow (lines 2594-2596, 2643-2645): Bolivia will still route to Manteca ✗
Apply this diff to fully disable Bolivia from Manteca routing:
const isMantecaCountry = [
'argentina',
'chile',
'brazil',
'colombia',
'panama',
'costa-rica',
'guatemala',
'philippines',
- 'bolivia',
].includes(country.path)Also apply the same change around line 2628:
const isMantecaCountry = [
'argentina',
'chile',
'brazil',
'colombia',
'panama',
'costa-rica',
'guatemala',
'philippines',
- 'bolivia',
].includes(country.path)Run the following script to verify all references to Bolivia in the codebase:
🏁 Script executed:
#!/bin/bash
# Search for all references to Bolivia/bolivia/BO in the codebase
rg -i -n --type=ts --type=tsx --type=js --type=jsx -C3 '\b(bolivia|BO)\b' -g '!node_modules' -g '!*.lock'Length of output: 27
🏁 Script executed:
#!/bin/bash
# Search for Bolivia/bolivia/BO references - using supported file types only
rg -i -n --type=ts --type=js -C3 '\b(bolivia|BO)\b' -g '!node_modules'Length of output: 4220
🏁 Script executed:
#!/bin/bash
# Verify context around lines 2584 and 2637 to confirm these are in withdraw logic
echo "=== Context around line 2584 (withdraw array 1) ==="
sed -n '2570,2595p' src/components/AddMoney/consts/index.ts
echo -e "\n=== Context around line 2637 (withdraw array 2) ==="
sed -n '2620,2650p' src/components/AddMoney/consts/index.ts
echo -e "\n=== Check when manteca.consts.ts was added ==="
git log --oneline --follow src/constants/manteca.consts.ts 2>/dev/null | head -5 || echo "File history unavailable"Length of output: 2987
Incomplete Bolivia removal confirmed—withdraw flow still routes to Manteca.
The review comment's findings are verified. Bolivia is correctly identified as:
- Commented out from
MantecaSupportedExchanges(line 20) ✓ - Still hardcoded in withdraw routing checks at lines 2584 and 2637 in identical
isMantecaCountryarrays ✓
Both locations are within withdraw method routing logic that explicitly directs to /withdraw/manteca when isMantecaCountry is true. This creates the inconsistency: add-money operations bypass Manteca while withdraw operations still route through it for Bolivia.
The suggested diffs in the review comment are accurate and complete for resolving this inconsistency in src/components/AddMoney/consts/index.ts.
🤖 Prompt for AI Agents
In src/components/AddMoney/consts/index.ts around line 20 and related withdraw
routing logic (see the isMantecaCountry arrays at the withdraw method lines
~2584 and ~2637), Bolivia is inconsistently handled: it’s commented out in
MantecaSupportedExchanges but still hardcoded in withdraw routing; restore
consistency by either uncommenting 'BOLIVIA' in MantecaSupportedExchanges or
removing 'BOLIVIA' from the hardcoded isMantecaCountry arrays and refactoring
the withdraw checks to use the central MantecaSupportedExchanges constant;
ensure both add-money and withdraw paths derive Manteca routing from the same
constant to prevent future drift.
No description provided.