Fix #895: replace magic number in broker param_count check#1209
Open
Chessing234 wants to merge 1 commit intomarketcalls:mainfrom
Open
Fix #895: replace magic number in broker param_count check#1209Chessing234 wants to merge 1 commit intomarketcalls:mainfrom
Chessing234 wants to merge 1 commit intomarketcalls:mainfrom
Conversation
…check Define named constants _MIN_BROKER_INIT_PARAMS (2) and _MIN_BROKER_INIT_PARAMS_WITH_FEED (3) to replace unexplained magic numbers in BrokerData initialization across quotes_service, history_service, and depth_service. The constants clarify that 2 represents self + auth_token and 3 adds feed_token. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_MIN_BROKER_INIT_PARAMS = 2and_MIN_BROKER_INIT_PARAMS_WITH_FEED = 3to replace unexplained magic numbersquotes_service.py,history_service.py, anddepth_service.py2=self+auth_token, and3addsfeed_tokenCloses #895
Verification
Test plan
🤖 Generated with Claude Code
Summary by cubic
Replace magic numbers in
BrokerData.__init__param-count checks with named constants for clearer intent; no behavior change. Fixes #895._MIN_BROKER_INIT_PARAMS = 2(self + auth_token) inquotes_service.pyandhistory_service.py.depth_service.py, also added_MIN_BROKER_INIT_PARAMS_WITH_FEED = 3(adds feed_token).BrokerData(auth only, auth+feed, auth+feed+user_id).Written for commit 347aefa. Summary will update on new commits.