diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c53327dd..47f554ff 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,14 +17,14 @@ jobs: name: golangci-lint runs-on: ${{ matrix.os }} steps: - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v4 with: go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.52 + version: v1.54 - name: gofmt run: | go fmt ./... diff --git a/websocket/config.go b/websocket/config.go index 8b353964..14c48b7c 100644 --- a/websocket/config.go +++ b/websocket/config.go @@ -82,16 +82,21 @@ const ( ) func (m Market) supports(topic Topic) bool { + // FMV is supported for Stocks, Options, Forex, and Crypto but is not within the range + // so we need to make sure FMV is suppored if these markets are used. + isBusinessFairMarketValue := topic == BusinessFairMarketValue + switch m { case Stocks: - return topic > stocksMin && topic < stocksMax + return isBusinessFairMarketValue || (topic > stocksMin && topic < stocksMax) case Options: - return topic > optionsMin && topic < optionsMax + return isBusinessFairMarketValue || (topic > optionsMin && topic < optionsMax) case Forex: - return topic > forexMin && topic < forexMax + return isBusinessFairMarketValue || (topic > forexMin && topic < forexMax) case Crypto: - return topic > cryptoMin && topic < cryptoMax + return isBusinessFairMarketValue || (topic > cryptoMin && topic < cryptoMax) } + return true // assume user knows what they're doing if they use some unknown market }