Skip to content

Commit 2e5b6fe

Browse files
committed
Lint fixes
1 parent 587eefd commit 2e5b6fe

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

exchanges/coinbasepro/coinbasepro.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,16 +1136,16 @@ func (e *Exchange) GetAllWallets(ctx context.Context, pag PaginationInp) (*GetAl
11361136
}
11371137

11381138
// GetWalletByID returns information about a single wallet. In lieu of a wallet ID, a currency can be provided to get the primary account for that currency
1139-
func (e *Exchange) GetWalletByID(ctx context.Context, walletID string, currency currency.Code) (*WalletData, error) {
1140-
if (walletID == "" && currency.IsEmpty()) || (walletID != "" && !currency.IsEmpty()) {
1139+
func (e *Exchange) GetWalletByID(ctx context.Context, walletID string, cur currency.Code) (*WalletData, error) {
1140+
if (walletID == "" && cur.IsEmpty()) || (walletID != "" && !cur.IsEmpty()) {
11411141
return nil, errCurrWalletConflict
11421142
}
11431143
var path string
11441144
if walletID != "" {
11451145
path = v2Path + accountsPath + "/" + walletID
11461146
}
1147-
if !currency.IsEmpty() {
1148-
path = v2Path + accountsPath + "/" + currency.String()
1147+
if !cur.IsEmpty() {
1148+
path = v2Path + accountsPath + "/" + cur.String()
11491149
}
11501150
resp := struct {
11511151
Data WalletData `json:"data"`
@@ -1201,12 +1201,12 @@ func (e *Exchange) GetCryptocurrencies(ctx context.Context) ([]CryptoData, error
12011201
}
12021202

12031203
// GetExchangeRates returns exchange rates for the specified currency. If none is specified, it defaults to USD
1204-
func (e *Exchange) GetExchangeRates(ctx context.Context, currency string) (*GetExchangeRatesResp, error) {
1204+
func (e *Exchange) GetExchangeRates(ctx context.Context, cur string) (*GetExchangeRatesResp, error) {
12051205
resp := struct {
12061206
Data GetExchangeRatesResp `json:"data"`
12071207
}{}
12081208
vals := url.Values{}
1209-
vals.Set("currency", currency)
1209+
vals.Set("currency", cur)
12101210
return &resp.Data, e.SendHTTPRequest(ctx, exchange.RestSpot, v2Path+exchangeRatesPath, vals, &resp)
12111211
}
12121212

@@ -1494,7 +1494,7 @@ func (e *Exchange) GetJWT(ctx context.Context, uri string) (string, time.Time, e
14941494
if block == nil {
14951495
return "", time.Time{}, errCantDecodePrivKey
14961496
}
1497-
key, err := x509.ParseECPrivateKey(block.Bytes)
1497+
privateKey, err := x509.ParseECPrivateKey(block.Bytes)
14981498
if err != nil {
14991499
return "", time.Time{}, err
15001500
}
@@ -1515,7 +1515,7 @@ func (e *Exchange) GetJWT(ctx context.Context, uri string) (string, time.Time, e
15151515
tok := jwt.NewWithClaims(jwt.SigningMethodES256, mapClaims)
15161516
tok.Header["kid"] = creds.Key
15171517
tok.Header["nonce"] = nonce
1518-
sign, err := tok.SignedString(key)
1518+
sign, err := tok.SignedString(privateKey)
15191519
return sign, regTime.Add(time.Minute * 2), err
15201520
// The code below mostly works, but seems to lead to bad results on the signature step. Deferring until later
15211521
// head := map[string]any{"kid": creds.Key, "typ": "JWT", "alg": "ES256", "nonce": nonce}

exchanges/coinbasepro/coinbasepro_websocket.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ func (e *Exchange) wsProcessUser(resp *StandardWebsocketResponse) error {
249249
if wsUser[i].Orders[j].LimitPrice != 0 {
250250
price = wsUser[i].Orders[j].LimitPrice
251251
}
252-
var asset asset.Item
253-
asset, err = stringToStandardAsset(wsUser[i].Orders[j].ProductType)
252+
var assetType asset.Item
253+
assetType, err = stringToStandardAsset(wsUser[i].Orders[j].ProductType)
254254
if err != nil {
255255
e.Websocket.DataHandler <- order.ClassificationError{
256256
Exchange: e.Name,
@@ -278,7 +278,7 @@ func (e *Exchange) wsProcessUser(resp *StandardWebsocketResponse) error {
278278
Side: oSide,
279279
Type: oType,
280280
Pair: wsUser[i].Orders[j].ProductID,
281-
AssetType: asset,
281+
AssetType: assetType,
282282
Status: oStatus,
283283
TriggerPrice: wsUser[i].Orders[j].StopPrice.Float64(),
284284
TimeInForce: tif,

0 commit comments

Comments
 (0)