Skip to content

Commit

Permalink
Further lint cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cranktakular committed Feb 20, 2024
1 parent 005af4a commit 2b5df7c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
5 changes: 3 additions & 2 deletions exchanges/coinbasepro/coinbasepro.go
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,8 @@ func (c *CoinbasePro) SendAuthenticatedHTTPRequest(ctx context.Context, ep excha

message := n + method + path + string(payload)

hmac, err := crypto.GetHMAC(crypto.HashSHA256,
var hmac []byte
hmac, err = crypto.GetHMAC(crypto.HashSHA256,
[]byte(message),
[]byte(creds.Secret))
if err != nil {
Expand Down Expand Up @@ -1426,7 +1427,7 @@ func (c *CoinbasePro) SendAuthenticatedHTTPRequest(ctx context.Context, ep excha
PreviewFailureReason string `json:"preview_failure_reason"`
NewOrderFailureReason string `json:"new_order_failure_reason"`
}{}
if err := json.Unmarshal(interim, &singleErrCap); err == nil {
if err = json.Unmarshal(interim, &singleErrCap); err == nil {
if singleErrCap.Message != "" {
errMessage := fmt.Sprintf("message: %s, error type: %s, error details: %s, edit failure reason: %s, preview failure reason: %s, new order failure reason: %s",
singleErrCap.Message, singleErrCap.ErrorType, singleErrCap.ErrorDetails, singleErrCap.EditFailureReason,
Expand Down
5 changes: 1 addition & 4 deletions exchanges/coinbasepro/coinbasepro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ func TestScheduleFuturesSweep(t *testing.T) {
for i := range curSweeps.Sweeps {
if curSweeps.Sweeps[i].Status == "PENDING" {
preCancel = true

}
}
}
Expand Down Expand Up @@ -503,7 +502,6 @@ func TestCancelPendingFuturesSweep(t *testing.T) {
if err != nil {
t.Error(err)
}

}
_, err = c.CancelPendingFuturesSweep(context.Background())
assert.NoError(t, err)
Expand Down Expand Up @@ -1316,7 +1314,6 @@ func TestGetOrderHistory(t *testing.T) {
req.Pairs = req.Pairs.Add(testPair)
_, err = c.GetOrderHistory(context.Background(), &req)
assert.NoError(t, err)

}

func TestGetHistoricCandles(t *testing.T) {
Expand Down Expand Up @@ -1820,7 +1817,7 @@ func withdrawFiatFundsHelper(t *testing.T, fn withdrawFiatFunc) {
assert.ErrorIs(t, err, errWalletIDEmpty)
sharedtestvalues.SkipTestIfCredentialsUnset(t, c)
req.WalletID = "meow"
req.Fiat.Bank.BankName = "GCT's Fake and Not Real Test Bank Meow Meow Meow"
req.Fiat.Bank.BankName = "GCT's Officially Fake and Not Real Test Bank"
expectedError := fmt.Sprintf(errPayMethodNotFound, req.Fiat.Bank.BankName)
_, err = fn(context.Background(), &req)
if err.Error() != expectedError {
Expand Down
4 changes: 2 additions & 2 deletions exchanges/coinbasepro/coinbasepro_websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ func (c *CoinbasePro) wsHandleData(respRaw []byte, seqCount uint64) (string, err

sliToSend := []ticker.Price{}

timestamp, err := getTimestamp(respRaw)
var timestamp time.Time
timestamp, err = getTimestamp(respRaw)
if err != nil {
return warnString, err
}
Expand Down Expand Up @@ -392,7 +393,6 @@ func (c *CoinbasePro) Unsubscribe(channelsToUnsubscribe []subscription.Subscript
for i := range channelsToUnsubscribe {
chanKeys[channelsToUnsubscribe[i].Channel] =
chanKeys[channelsToUnsubscribe[i].Channel].Add(channelsToUnsubscribe[i].Pair)

}

for s := range chanKeys {
Expand Down
2 changes: 0 additions & 2 deletions exchanges/coinbasepro/coinbasepro_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,6 @@ func (c *CoinbasePro) GetLatestFundingRates(ctx context.Context, r *fundingrate.
funding := make([]fundingrate.LatestRateResponse, len(products.Products))

for i := range products.Products {

pair, err := currency.NewPairFromString(products.Products[i].ID)
if err != nil {
return nil, err
Expand Down Expand Up @@ -1158,7 +1157,6 @@ func (c *CoinbasePro) GetFuturesContractDetails(ctx context.Context, item asset.

// UpdateOrderExecutionLimits updates order execution limits
func (c *CoinbasePro) UpdateOrderExecutionLimits(ctx context.Context, a asset.Item) error {

var data AllProducts
var err error
switch a {
Expand Down

0 comments on commit 2b5df7c

Please sign in to comment.