Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

going for goreportcard 100% happiness #87

Merged
merged 1 commit into from
Jan 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exchanges/binance.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ func (wrapper *BinanceWrapper) subscribeOrderbookFeed(market *environment.Market
// 24 hours max
currentUpdateID := lastUpdateID

done, _, err := binance.WsPartialDepthServe(MarketNameFor(market, wrapper), "20", func(event *binance.WsPartialDepthEvent) {
done, _, _ := binance.WsPartialDepthServe(MarketNameFor(market, wrapper), "20", func(event *binance.WsPartialDepthEvent) {
if event.LastUpdateID <= currentUpdateID { // this update is more recent than the latest fetched
return
}
Expand Down
24 changes: 1 addition & 23 deletions exchanges/bittrex.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,35 +218,13 @@ func (wrapper *BittrexWrapper) CalculateWithdrawFees(market *environment.Market,
// FeedConnect connects to the feed of the exchange.
func (wrapper *BittrexWrapper) FeedConnect(markets []*environment.Market) error {
return ErrWebsocketNotSupported

wrapper.websocketOn = true

for _, m := range markets {
wrapper.subscribeMarketSummaryFeed(m)
}

return nil
}

// SubscribeMarketSummaryFeed subscribes to the Market Summary Feed service.
//
// NOTE: Not supported on Bittrex v1 API, use *BittrexWrapperV2.
func (wrapper *BittrexWrapper) subscribeMarketSummaryFeed(market *environment.Market) {
results := make(chan api.ExchangeState)

wrapper.api.SubscribeExchangeUpdate(MarketNameFor(market, wrapper), results, wrapper.unsubscribeChannels[market])
panic("Not implemented")
go func(market *environment.Market, results <-chan api.ExchangeState) {
for {
select {
case <-results:
//TODO: handle result
case <-wrapper.unsubscribeChannels[market]:
close(wrapper.unsubscribeChannels[market])
delete(wrapper.unsubscribeChannels, market)
}
}
}(market, results)
panic(ErrWebsocketNotSupported)
}

// Withdraw performs a withdraw operation from the exchange to a destination address.
Expand Down