Skip to content

Add WebSocket order book delta validation tests - #24

Open
natemiller23 wants to merge 1 commit into
Peter7896:mainfrom
natemiller23:bounty-pr-bot/orderbook-delta-validation
Open

Add WebSocket order book delta validation tests#24
natemiller23 wants to merge 1 commit into
Peter7896:mainfrom
natemiller23:bounty-pr-bot/orderbook-delta-validation

Conversation

@natemiller23

Copy link
Copy Markdown

Summary

Adds deterministic WebSocket/order book delta validation coverage for bounty #4.

/claim #4

Changes

  • Added orderbook.Delta with explicit validation errors for malformed symbols, prices, quantities, stale/out-of-order sequences, and checksum mismatches.
  • Applies deltas atomically by validating into cloned book state first, so invalid deltas preserve the existing book.
  • Added snapshot replacement plus valid snapshot -> valid delta coverage.
  • Added WebSocket delta message parsing tests for malformed payloads and unsupported event types.
  • Added matching package coverage proving invalid deltas do not mutate an engine-owned book.

Testing

$go test ./orderbook ./matching ./ws
ok   github.com/tent-of-trials/market/orderbook  0.024s
ok   github.com/tent-of-trials/market/matching   0.023s
ok   github.com/tent-of-trials/market/ws         0.017s

python build.py was attempted under UTF-8, but this Windows workstation is missing required repo toolchains (npm, Rust, gcc, cmake, Java, Ruby, Lua, GHC). The script stops at npm install before producing a new diagnostic artifact. Existing diagnostic/build-00000000.{json,logd} artifacts are unchanged.

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

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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.

1 participant