Makefile: add new recipes and linter features (#244)

* Makefile: add new recipes and linter features

* expand linter coverage and fix issues

* Update makefile

* address PR nitterinos
This commit is contained in:
Adrian Gallagher
2019-01-31 14:53:24 +11:00
committed by GitHub
parent e182248387
commit 291e404a4a
85 changed files with 306 additions and 393 deletions

View File

@@ -363,17 +363,14 @@ func (i *ItBit) SendAuthenticatedHTTPRequest(method string, path string, params
request := make(map[string]interface{})
url := i.APIUrl + path
if params != nil {
for key, value := range params {
request[key] = value
}
for key, value := range params {
request[key] = value
}
PayloadJSON := []byte("")
var err error
if params != nil {
PayloadJSON, err = common.JSONEncode(request)
if err != nil {
return err
@@ -410,7 +407,7 @@ func (i *ItBit) SendAuthenticatedHTTPRequest(method string, path string, params
RequestID string `json:"requestId"`
}{}
err = i.SendPayload(method, url, headers, bytes.NewBuffer([]byte(PayloadJSON)), &intermediary, true, i.Verbose)
err = i.SendPayload(method, url, headers, bytes.NewBuffer(PayloadJSON), &intermediary, true, i.Verbose)
if err != nil {
return err
}
@@ -434,7 +431,7 @@ func (i *ItBit) GetFee(feeBuilder exchange.FeeBuilder) (float64, error) {
case exchange.CryptocurrencyTradeFee:
fee = calculateTradingFee(feeBuilder.PurchasePrice, feeBuilder.Amount, feeBuilder.IsMaker)
case exchange.InternationalBankWithdrawalFee:
fee = getInternationalBankWithdrawalFee(feeBuilder.CurrencyItem, feeBuilder.Amount, feeBuilder.BankTransactionType)
fee = getInternationalBankWithdrawalFee(feeBuilder.CurrencyItem, feeBuilder.BankTransactionType)
}
if fee < 0 {
@@ -454,7 +451,7 @@ func calculateTradingFee(purchasePrice, amount float64, isMaker bool) float64 {
return feePercent * purchasePrice * amount
}
func getInternationalBankWithdrawalFee(currency string, amount float64, bankTransactionType exchange.InternationalBankTransactionType) float64 {
func getInternationalBankWithdrawalFee(currency string, bankTransactionType exchange.InternationalBankTransactionType) float64 {
var fee float64
if (bankTransactionType == exchange.Swift || bankTransactionType == exchange.WireTransfer) && currency == symbol.USD {
fee = 40

View File

@@ -371,7 +371,7 @@ func TestWithdraw(t *testing.T) {
_, err := i.WithdrawCryptocurrencyFunds(withdrawCryptoRequest)
if err != common.ErrFunctionNotSupported {
t.Errorf("Expected 'Not supported', recieved %v", err)
t.Errorf("Expected 'Not supported', received %v", err)
}
}
@@ -387,7 +387,7 @@ func TestWithdrawFiat(t *testing.T) {
_, err := i.WithdrawFiatFunds(withdrawFiatRequest)
if err != common.ErrFunctionNotSupported {
t.Errorf("Expected '%v', recieved: '%v'", common.ErrFunctionNotSupported, err)
t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err)
}
}
@@ -403,7 +403,7 @@ func TestWithdrawInternationalBank(t *testing.T) {
_, err := i.WithdrawFiatFundsToInternationalBank(withdrawFiatRequest)
if err != common.ErrFunctionNotSupported {
t.Errorf("Expected '%v', recieved: '%v'", common.ErrFunctionNotSupported, err)
t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err)
}
}