mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-03 15:10:49 +00:00
golangci-lint/CI: Bump versions and introduce new linters (#798)
* golangci-lint/CI: Bump versions
Fix remaining linter issues
* Specifically set AppVeyor version
* Fix the infamous typos 👀
* Add go env cmd to AppVeyor
* Add go version cmd to AppVeyor
* Specify AppVeyor image, adjust linters
* Update go get to go install due to deprecation
* Bump golangci-lint timeout time for AppVeyor
* Change NW contract to NQ
* Address nitters
* GetRandomPair -> Pair{}
* Address nits
* Address time nitterinos plus additional tweaks
* More time inception upgrades!
* Bending time and space
This commit is contained in:
@@ -477,7 +477,7 @@ func (b *BTSE) SendAuthenticatedHTTPRequest(ctx context.Context, ep exchange.URL
|
||||
|
||||
var hmac []byte
|
||||
var body io.Reader
|
||||
nonce := strconv.FormatInt(time.Now().UnixNano()/int64(time.Millisecond), 10)
|
||||
nonce := strconv.FormatInt(time.Now().UnixMilli(), 10)
|
||||
headers := map[string]string{
|
||||
"btse-api": b.API.Credentials.Key,
|
||||
"btse-nonce": nonce,
|
||||
|
||||
@@ -543,12 +543,11 @@ func TestGetFee(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestParseOrderTime(t *testing.T) {
|
||||
expected := int64(1534792846)
|
||||
actual, err := parseOrderTime("2018-08-20 19:20:46")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if expected != actual.Unix() {
|
||||
if expected := int64(1534792846); expected != actual.Unix() {
|
||||
t.Errorf("TestParseOrderTime expected: %d, got %d", expected, actual.Unix())
|
||||
}
|
||||
}
|
||||
@@ -920,8 +919,7 @@ func TestWsLogin(t *testing.T) {
|
||||
func TestWsSubscription(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := []byte(`{"event":"subscribe","channel":["orderBookL2Api:SFI-ETH_0","tradeHistory:SFI-ETH"]}`)
|
||||
err := b.wsHandleData(data)
|
||||
if err != nil {
|
||||
if err := b.wsHandleData(data); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ func (b *BTSE) WsConnect() error {
|
||||
|
||||
// WsAuthenticate Send an authentication message to receive auth data
|
||||
func (b *BTSE) WsAuthenticate() error {
|
||||
nonce := strconv.FormatInt(time.Now().UnixNano()/int64(time.Millisecond), 10)
|
||||
nonce := strconv.FormatInt(time.Now().UnixMilli(), 10)
|
||||
path := "/spotWS" + nonce
|
||||
|
||||
hmac, err := crypto.GetHMAC(crypto.HashSHA512_384,
|
||||
@@ -216,7 +216,7 @@ func (b *BTSE) wsHandleData(respRaw []byte) error {
|
||||
Side: oSide,
|
||||
Status: oStatus,
|
||||
AssetType: a,
|
||||
Date: time.Unix(0, notification.Data[i].Timestamp*int64(time.Millisecond)),
|
||||
Date: time.UnixMilli(notification.Data[i].Timestamp),
|
||||
Pair: p,
|
||||
}
|
||||
}
|
||||
@@ -250,7 +250,7 @@ func (b *BTSE) wsHandleData(respRaw []byte) error {
|
||||
return err
|
||||
}
|
||||
trades = append(trades, trade.Data{
|
||||
Timestamp: time.Unix(0, tradeHistory.Data[x].TransactionTime*int64(time.Millisecond)),
|
||||
Timestamp: time.UnixMilli(tradeHistory.Data[x].TransactionTime),
|
||||
CurrencyPair: p,
|
||||
AssetType: a,
|
||||
Exchange: b.Name,
|
||||
|
||||
@@ -313,8 +313,7 @@ func (b *BTSE) UpdateTickers(ctx context.Context, a asset.Item) error {
|
||||
|
||||
// UpdateTicker updates and returns the ticker for a currency pair
|
||||
func (b *BTSE) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error) {
|
||||
err := b.UpdateTickers(ctx, a)
|
||||
if err != nil {
|
||||
if err := b.UpdateTickers(ctx, a); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ticker.GetTicker(b.Name, p, a)
|
||||
@@ -589,7 +588,7 @@ func (b *BTSE) CancelAllOrders(ctx context.Context, orderCancellation *order.Can
|
||||
|
||||
allOrders, err := b.CancelExistingOrder(ctx, "", fPair.String(), "")
|
||||
if err != nil {
|
||||
return resp, nil
|
||||
return resp, err
|
||||
}
|
||||
|
||||
resp.Status = make(map[string]string)
|
||||
|
||||
Reference in New Issue
Block a user