Split market pair logic into spot and futures files and rename price files to plural data-dimension names without changing behavior.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
[Medium] internal/data/market/trading_pairs_test.go still keeps the old trading_pairs filename even though trading_pairs.go was removed. The tests now cover shared canonical symbol helpers and futureCacheTokenKey, so please rename/split it to match the new file boundaries, for example spot_pairs_test.go or pair_symbols_test.go + futures_pairs_test.go.
[Low] internal/data/market/main.go still contains dead code: alphaCacheRefreshLoop is no longer called after NewMarketData switched to cacheRefreshLoop, and refreshAllCaches already refreshes Alpha tokens. Since this PR is cleaning market file structure, please remove that stale helper too.
Validation:
go test ./internal/data/market -v
go test ./...
FAIL
1. [Medium] `internal/data/market/trading_pairs_test.go` still keeps the old `trading_pairs` filename even though `trading_pairs.go` was removed. The tests now cover shared canonical symbol helpers and `futureCacheTokenKey`, so please rename/split it to match the new file boundaries, for example `spot_pairs_test.go` or `pair_symbols_test.go` + `futures_pairs_test.go`.
2. [Low] `internal/data/market/main.go` still contains dead code: `alphaCacheRefreshLoop` is no longer called after `NewMarketData` switched to `cacheRefreshLoop`, and `refreshAllCaches` already refreshes Alpha tokens. Since this PR is cleaning market file structure, please remove that stale helper too.
Validation:
- `go test ./internal/data/market -v`
- `go test ./...`
Rename pair tests to match post-refactor boundaries and remove unused alpha cache refresh helper.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Removed dead helper in internal/data/market/main.go:
deleted alphaCacheRefreshLoop (không còn được gọi)
Validation
go test ./internal/data/market -v✅
go test ./...✅
Nếu bạn muốn mình tách test theo 2 file riêng (spot_pairs_test.go + futures_pairs_test.go) thay vì pairs_test.go, mình có thể tách tiếp ở PR này.
Đã xử lý cả 2 ý review trên branch PR.
## Updates applied
- Renamed test file:
- `internal/data/market/trading_pairs_test.go` -> `internal/data/market/pairs_test.go`
- Removed dead helper in `internal/data/market/main.go`:
- deleted `alphaCacheRefreshLoop` (không còn được gọi)
## Validation
- `go test ./internal/data/market -v` ✅
- `go test ./...` ✅
Nếu bạn muốn mình tách test theo 2 file riêng (`spot_pairs_test.go` + `futures_pairs_test.go`) thay vì `pairs_test.go`, mình có thể tách tiếp ở PR này.
No blocking issues found in the latest update. The previous review feedback has been addressed:
trading_pairs_test.go was renamed to pairs_test.go.
Dead alphaCacheRefreshLoop was removed from main.go.
No stale refs remain for the old market filenames or removed helper.
Validation:
go test ./internal/data/market -v
go test ./...
PASS
No blocking issues found in the latest update. The previous review feedback has been addressed:
- `trading_pairs_test.go` was renamed to `pairs_test.go`.
- Dead `alphaCacheRefreshLoop` was removed from `main.go`.
- No stale refs remain for the old market filenames or removed helper.
Validation:
- `go test ./internal/data/market -v`
- `go test ./...`
thuanle
merged commit c5ff494e13 into main2026-04-27 09:53:34 +07:00
claudecode
requested review from codex 2026-04-27 09:56:22 +07:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Refactor
internal/data/marketfilenames to consistent data-dimension naming and align pair responsibilities by file.Changes
spot_price.go->spot_prices.gofuture_price.go->futures_prices.gotrading_pairs.go->spot_pairs.gofutures_pairs.goand move futures-pair specific logic theremain.gofor orchestration/cache refresh flowScope
Test Plan
go test ./internal/data/market -vgo test ./...Related
FAIL
[Medium]
internal/data/market/trading_pairs_test.gostill keeps the oldtrading_pairsfilename even thoughtrading_pairs.gowas removed. The tests now cover shared canonical symbol helpers andfutureCacheTokenKey, so please rename/split it to match the new file boundaries, for examplespot_pairs_test.goorpair_symbols_test.go+futures_pairs_test.go.[Low]
internal/data/market/main.gostill contains dead code:alphaCacheRefreshLoopis no longer called afterNewMarketDataswitched tocacheRefreshLoop, andrefreshAllCachesalready refreshes Alpha tokens. Since this PR is cleaning market file structure, please remove that stale helper too.Validation:
go test ./internal/data/market -vgo test ./...Đã xử lý cả 2 ý review trên branch PR.
Updates applied
internal/data/market/trading_pairs_test.go->internal/data/market/pairs_test.gointernal/data/market/main.go:alphaCacheRefreshLoop(không còn được gọi)Validation
go test ./internal/data/market -v✅go test ./...✅Nếu bạn muốn mình tách test theo 2 file riêng (
spot_pairs_test.go+futures_pairs_test.go) thay vìpairs_test.go, mình có thể tách tiếp ở PR này.PASS
No blocking issues found in the latest update. The previous review feedback has been addressed:
trading_pairs_test.gowas renamed topairs_test.go.alphaCacheRefreshLoopwas removed frommain.go.Validation:
go test ./internal/data/market -vgo test ./...