Skip to content

feat: validate CreateVault form inputs#142

Closed
go165 wants to merge 1 commit into
Disciplr-Org:mainfrom
go165:go165/create-vault-validation
Closed

feat: validate CreateVault form inputs#142
go165 wants to merge 1 commit into
Disciplr-Org:mainfrom
go165:go165/create-vault-validation

Conversation

@go165

@go165 go165 commented Jun 17, 2026

Copy link
Copy Markdown

Closes #123.

Summary

  • Add pure CreateVault validation helpers for USDC amount precision, future deadlines, Stellar public key format, and distinct success/failure destinations.
  • Wire validation into CreateVault so invalid values render inline Field errors and block submission before backend/contract calls.
  • Document the Field validation/error pattern.
  • Fix the existing Field forwardRef syntax so the validation path can compile and be tested.

Validation

  • npm test -- --run src/utils/__tests__/vaultValidation.test.ts src/pages/__tests__/CreateVault.test.tsx

Focused result: 2 files passed, 7 tests passed; CreateVault.tsx and vaultValidation.ts both reported 100% coverage in the focused run.

Baseline notes

  • npm run build is currently blocked by pre-existing repo-wide TypeScript issues outside this PR, including missing Vitest globals in existing tests, an existing @testing-library/user-event import without a dependency in Vaults.test.tsx, and unrelated unused/missing imports.
  • npm run lint is likewise blocked by existing repo-wide lint errors outside these changed TypeScript files. A scoped lint on the changed TS files passed; the markdown doc is ignored by the current ESLint config.

Reward/payment note if this issue is selected for GrantFox reward: Base/EVM address 0x1f0130669ca6fd02e025a984cc038f139df19a2f.

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.

Add Stellar address and USDC amount validation to the CreateVault form

2 participants