fix(predict): fix unregistered wallet issue on first deposit cp-7.77.0 cp-7.78.0#30267
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Impact is confined to the Polymarket Predictions deposit/position-opening flow. No shared components (navigation, modals, Engine, controllers) are affected. Tags selected:
No other tags are warranted as the change is isolated to the Predictions/Polymarket deposit wallet logic. Performance Test Selection: |
|



Description
Fixes the first-deposit flow for new Predict users whose Polymarket deposit wallet has been created but is not fully registered yet.
Polymarket advised that
STATE_MINEDcan happen before the wallet is usable on their side, so the deposit wallet relayer polling now treats onlySTATE_CONFIRMEDas a successful completion state. This keeps polling through mined responses until Polymarket confirms the wallet, preventing the follow-up batch transaction from failing with "wallet is not registered".Changelog
CHANGELOG entry: Fixed a bug that caused a user's first Predict deposit to fail while their deposit wallet was still registering.
Related issues
Fixes: PRED-886
Manual testing steps
Screenshots/Recordings
N/A - logic-only relayer polling change.
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Testing
yarn jest app/components/UI/Predict/providers/polymarket/depositWallet.test.ts --runInBandNote
Medium Risk
Changes deposit-wallet relayer polling completion criteria, which can affect first-deposit transaction flow timing and success. Low code surface area but touches user-critical deposit execution behavior.
Overview
Fixes Predict first-deposit failures by tightening Polymarket relayer success detection:
waitForDepositWalletTransactionnow treats onlySTATE_CONFIRMED(notSTATE_MINED) as a completion state before proceeding.Updates the related unit test to expect continued polling through
STATE_MINED/no-hash responses until aSTATE_CONFIRMEDtransaction hash is returned.Reviewed by Cursor Bugbot for commit a36ba27. Bugbot is set up for automated code reviews on this repo. Configure here.