Skip to content

Add WebSocket order book delta validation tests (#4)#10

Open
fengyangxxx wants to merge 2 commits into
Peter7896:mainfrom
fengyangxxx:bounty/zeroeye-4-ws-delta-validation-tests
Open

Add WebSocket order book delta validation tests (#4)#10
fengyangxxx wants to merge 2 commits into
Peter7896:mainfrom
fengyangxxx:bounty/zeroeye-4-ws-delta-validation-tests

Conversation

@fengyangxxx

Copy link
Copy Markdown

Summary

Adds deterministic WebSocket/order book delta validation coverage for #4. The change introduces focused order book delta helpers plus parser tests for WebSocket delta payloads, covering malformed payloads, stale/out-of-order sequences, checksum mismatch state preservation, and a valid snapshot-to-delta update path without live services.

Changes

  • Added orderbook.SnapshotUpdate / orderbook.DeltaUpdate helpers for deterministic snapshot and delta application.
  • Added validation for symbol, side, price, quantity, previous/current sequence ordering, empty deltas, and checksum mismatch.
  • Added WebSocket delta payload parsing for bid/ask array payloads and side-tagged change payloads.
  • Added deterministic tests in market/orderbook, market/matching, and market/ws.
  • Added root go.work so the required repository-root command go test ./market/orderbook ./market/matching ./market/ws runs against the existing market module.
  • Included the script-generated diagnostic pair for code commit c0ddfd5c:
    • diagnostic/build-c0ddfd5c.json
    • diagnostic/build-c0ddfd5c.logd

Testing

  • go test ./market/orderbook ./market/matching ./market/ws - pass
  • python3 build.py in Linux Docker build environment - generated the committed diagnostic pair
    • total modules: 10
    • passed: 7
    • failed: 3 unrelated existing environment/module failures
    • market: PASS
    • unrelated failures: frailbox, engine, openapi-haskell
  • python -m json.tool diagnostic/build-c0ddfd5c.json - pass

Checklist

  • Relevant modules affected by these changes build locally
  • Tests pass locally
  • Diagnostic build log is committed in this PR
  • Documentation has been updated, if applicable
  • Configuration or schema changes are documented, if applicable
  • No generated build artifacts are committed, except the required diagnostic build log
  • Changes are scoped to the PR purpose and avoid unrelated cleanup
  • Security, privacy, and error-handling implications have been considered

  • I would like to request that my diagnostic build log is removed before merging

Closes #4

Notime02 added a commit to Notime02/zeroeye that referenced this pull request Jun 21, 2026
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.

[$45 BOUNTY] [Go] Add WebSocket order book delta validation tests

1 participant