Skip to content

Commit

Permalink
Fix exchange info request
Browse files Browse the repository at this point in the history
  • Loading branch information
kislikjeka committed Jul 15, 2021
1 parent 076fe97 commit d6480cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion v2/exchange_info_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package binance
import (
"context"
"encoding/json"
"fmt"
"strings"
)

Expand Down Expand Up @@ -37,7 +38,7 @@ func (s *ExchangeInfoService) Do(ctx context.Context, opts ...RequestOption) (re
m["symbol"] = s.symbol
}
if len(s.symbols) != 0 {
r.setParam("symbols", strings.Join(s.symbols, ","))
r.setParam("symbols", fmt.Sprintf("[%s]", strings.Join(s.symbols, ",")))
}
r.setParams(m)
data, err := s.c.callAPI(ctx, r, opts...)
Expand Down
3 changes: 2 additions & 1 deletion v2/exchange_info_service_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package binance

import (
"fmt"
"strings"
"testing"

Expand Down Expand Up @@ -65,7 +66,7 @@ func (s *exchangeInfoServiceTestSuite) TestExchangeInfo() {
e := newRequest().setParams(map[string]interface{}{
"symbol": symbol,
})
e.setParam("symbols", strings.Join(symbols, ","))
e.setParam("symbols", fmt.Sprintf("[%s]", strings.Join(symbols, ",")))
s.assertRequestEqual(e, r)
})
res, err := s.client.NewExchangeInfoService().Symbol(symbol).Symbols(symbols...).Do(newContext())
Expand Down

0 comments on commit d6480cf

Please sign in to comment.