fix: validate chain is 'bsc' for Phase 1 #34

Merged
shoko merged 1 commits from fix/issue-31 into main 2026-04-09 09:10:55 +02:00
Owner

Summary

  • Add chain validation to BacktestCreate and SimulationCreate schemas
  • Only "bsc" is accepted; non-BSC chains raise a clear error message

Changes

  • src/backend/app/db/schemas.py:
    • Added field_validator for chain field in both schemas
    • Validates that chain equals "bsc", otherwise raises ValueError('Phase 1 only supports BSC (bnb chain)')

Acceptance Criteria

  • API rejects backtest/simulate requests with non-BSC chain
  • Error message clearly states only BSC is supported
  • BSC chain requests work normally

Closes #31

## Summary - Add chain validation to `BacktestCreate` and `SimulationCreate` schemas - Only "bsc" is accepted; non-BSC chains raise a clear error message ## Changes - `src/backend/app/db/schemas.py`: - Added `field_validator` for `chain` field in both schemas - Validates that chain equals "bsc", otherwise raises `ValueError('Phase 1 only supports BSC (bnb chain)')` ## Acceptance Criteria - [x] API rejects backtest/simulate requests with non-BSC chain - [x] Error message clearly states only BSC is supported - [x] BSC chain requests work normally Closes #31
shoko added 1 commit 2026-04-09 08:58:47 +02:00
han approved these changes 2026-04-09 09:10:14 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko merged commit 55b008d4e8 into main 2026-04-09 09:10:55 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/randebu#34