Skip to content

fix: better error logging and prevent transactions over total balance#161

Open
sqhell wants to merge 4 commits intomainfrom
fix/update-fix-NU6
Open

fix: better error logging and prevent transactions over total balance#161
sqhell wants to merge 4 commits intomainfrom
fix/update-fix-NU6

Conversation

@sqhell
Copy link
Contributor

@sqhell sqhell commented Feb 17, 2026

● Changes

  • Added client-side balance validation to Transfer flow - Validates amount against spendable balance with 0.0001 ZEC fee buffer before allowing users to proceed past input screen
  • Added fee buffer validation to Shield flow - Prevents shielding when transparent balance is below 0.0015 ZEC minimum (includes 0.0005 ZEC fee buffer)
  • Enhanced error handling for InsufficientFunds errors - Parses Rust WASM errors to extract and display exact available/required amounts with clear, actionable messages
  • Improved error logging - Added comprehensive error logging including full stack traces, error types, and parsed amount breakdowns for debugging

Tests

Build and run the dev server

cd /home/skynet/ztest/WebZjs
just build
yarn dev

Test 1: Transfer validation

Navigate to Transfer/Send screen

Try to send amount > available balance

Expected: Error shown immediately, cannot proceed

Error message shows: "Insufficient balance. Available (after fees): X.XXXXXXXX ZEC"

Test 2: Shield validation

Navigate to Shield Balance screen with < 0.0015 ZEC transparent balance

Expected: Shield button disabled

Error shows: "Minimum balance required: 0.0015 ZEC (includes transaction fees)"

Test 3: Enhanced error messages (if validation bypassed)

Check browser console for detailed error breakdown:

- Full error object logged

- Parsed amounts: Available, Required, Shortfall in both zatoshis and ZEC

- User sees elegant message with exact amounts needed

Test 4: Valid transactions

Try transfer with amount < (balance - fee buffer)

Try shield with balance > 0.0015 ZEC

Expected: Both proceed normally through confirmation and execution

Issues

  • Fixes user-reported issue: "Insufficient Funds" errors showing ugly WASM error messages instead of user-friendly validation
  • Prevents users from reaching confirmation screen with insufficient balance
  • Addresses lack of fee consideration in UI validation logic

@sqhell sqhell requested a review from irubido February 17, 2026 19:35
@sqhell sqhell requested a review from rob1997 February 18, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments