mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-21 15:10:12 +00:00
Bump golangci-lint, Docker and Go CI versions (#564)
* Bump golangci-lint and Go CI versions * Bump golangci-lint version * Address nitterinos
This commit is contained in:
@@ -151,13 +151,18 @@ func (b *Bithumb) GetTransactionHistory(symbol string) (TransactionHistory, erro
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetAccountInformation returns account information by singular currency
|
||||
func (b *Bithumb) GetAccountInformation(currency string) (Account, error) {
|
||||
response := Account{}
|
||||
// GetAccountInformation returns account information based on the desired
|
||||
// order/payment currencies
|
||||
func (b *Bithumb) GetAccountInformation(orderCurrency, paymentCurrency string) (Account, error) {
|
||||
var response Account
|
||||
if orderCurrency == "" {
|
||||
return response, errors.New("order currency must be set")
|
||||
}
|
||||
|
||||
val := url.Values{}
|
||||
if currency != "" {
|
||||
val.Set("currency", currency)
|
||||
val.Add("order_currency", orderCurrency)
|
||||
if paymentCurrency != "" { // optional param, default is KRW
|
||||
val.Add("payment_currency", paymentCurrency)
|
||||
}
|
||||
|
||||
return response,
|
||||
@@ -477,7 +482,7 @@ func (b *Bithumb) SendAuthenticatedHTTPRequest(path string, params url.Values, r
|
||||
|
||||
params.Set("endpoint", path)
|
||||
payload := params.Encode()
|
||||
hmacPayload := path + string(0) + payload + string(0) + n
|
||||
hmacPayload := path + string('\x00') + payload + string('\x00') + n
|
||||
hmac := crypto.GetHMAC(crypto.HashSHA512,
|
||||
[]byte(hmacPayload),
|
||||
[]byte(b.API.Credentials.Secret))
|
||||
|
||||
@@ -92,6 +92,25 @@ func TestGetTransactionHistory(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetAccountInformation(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
// Offline test
|
||||
_, err := b.GetAccountInformation("", "")
|
||||
if err == nil {
|
||||
t.Error("expected error when no order currency is specified")
|
||||
}
|
||||
|
||||
if !areTestAPIKeysSet() {
|
||||
t.Skip()
|
||||
}
|
||||
|
||||
_, err = b.GetAccountInformation(testCurrency, currency.KRW.String())
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetAccountBalance(t *testing.T) {
|
||||
t.Parallel()
|
||||
if !areTestAPIKeysSet() {
|
||||
|
||||
Reference in New Issue
Block a user