Repository navigation
fix(web): wire availableBalance into DepositTab to prevent failed deposits (#1063) - #1094
Conversation
|
Someone is attempting to deploy a commit to the Collins' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Yasir-TechGuy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Hi @collinsezedike Please check it out |
455867a to
402f16c
Compare
collinsezedike
left a comment
There was a problem hiding this comment.
@Yasir-TechGuy, thank you for the fix. The guard is wired correctly and the VaultPanel test exercises it, but the branch cannot merge as it stands.
The Commit Messages check fails: the commit subject fix(web): wire availableBalance into DepositTab to prevent failed deposits is 74 characters and the limit is 72. Amend or squash it to a shorter subject with no issue reference, for example fix(web): wire availableBalance into the deposit guard.
There is one correctness note on the hook inline.
0fc51f8 to
1dde25e
Compare
|
Thanks @collinsezedike — both points addressed in the latest push (
All four local checks pass: format, lint, typecheck, tests (359/359). CI should be green on the new SHA. Thanks for catching the stale-balance bug — that would have been an on-chain revert we didn't prevent. |
|
Please @collinsezedike i have also applied to work on the last 2 unassiged issue in your repo, please kindly assign them to me, i will do a great job |
collinsezedike
left a comment
There was a problem hiding this comment.
@Yasir-TechGuy thank you for the contribution. There are more open issues if you would like to keep going.
@collinsezedike Yes I would like to. Please kindly assign the unassigned issues to me. I have applied for them already 🙏 |
Summary
DepositTab([Bug] The over-balance deposit guard never runs in the app #1063): Previously,VaultPanelrendered<DepositTab />without passing theavailableBalanceprop. Because the prop was optional,DepositTabsilently skipped the over-balance validation, allowing users to submit deposits larger than their wallet balance.useUsdcBalancehook: Fetches the connected wallet's USDC balance directly from Horizon usingfetchBalances— the exact same source used byuseTrustlinesfor the deposit's trustline check.VaultPanelnow consumesuseUsdcBalanceand passes the value into<DepositTab availableBalance={...} />.undefined. This preserves the existing optional behavior so transient network errors don't permanently lock users out of deposits.availableBalanceprop, the test suite fails. The tests explicitly assert that theexceedsBalanceerror is shown and the submit button is disabled when the wallet balance is lower than the typed amount.Test plan
pnpm lint && pnpm typecheck && pnpm testpass locallyvaultPanel.validation.exceedsBalanceand disablesvault-deposit-submit.Closes #1063