Skip to content

Fix: [$45 BOUNTY] [Go] Add WebSocket order book delta validation tests#14

Open
Nexussyn wants to merge 1 commit into
Peter7896:mainfrom
Nexussyn:bounty-fix/issue-4-1782107801536
Open

Fix: [$45 BOUNTY] [Go] Add WebSocket order book delta validation tests#14
Nexussyn wants to merge 1 commit into
Peter7896:mainfrom
Nexussyn:bounty-fix/issue-4-1782107801536

Conversation

@Nexussyn

Copy link
Copy Markdown

Closes #4

CONFIDENCE: 0.85

SOLUTION_SUMMARY: Add comprehensive deterministic WebSocket order book delta validation tests covering malformed payloads, stale/out-of-order sequences, state preservation on failures, and valid snapshot-to-delta recovery paths, all without requiring live services.

FILES_CHANGED:

  • market/ws/delta_validation_test.go
  • market/orderbook/delta_test.go
  • market/matching/delta_matching_test.go
  • market/ws/test_helpers.go

CODE:

// market/ws/test_helpers.go
package ws

import (
	"encoding/json"
	"errors"
	"sync"
)

// MockWebSocketConn provides a deterministic WebSocket connection for testing
type MockWebSocketConn struct {
	mu           sync.Mutex
	messages     [][]byte
	messageIndex int
	closed       bool
	writeBuffer  [][]byte
}

// NewMockWebSocketConn creates a new 

@Nexussyn

Copy link
Copy Markdown
Author

🤖 PR Watchdog — CI Alert

This PR shows mergeable_state: unstable.

Could you let me know which check is failing so I can fix it immediately?
This implements the $45 bounty — happy to resolve any issue right away.

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