Fix misspells

This commit is contained in:
Adrian Gallagher
2017-10-04 18:15:01 +11:00
parent 61023f9fed
commit 55c8b02d1d
16 changed files with 39 additions and 39 deletions

View File

@@ -409,26 +409,26 @@ func TestConvertCurrency(t *testing.T) {
t.Errorf("Test failed. ConvertCurrency USD -> AUD. Error %s", err)
}
// Test non-existant currencies
// Test non-existent currencies
_, err = ConvertCurrency(1000, "ASDF", "USD")
if err == nil {
t.Errorf("Test failed. ConvertCurrency non-existant currency -> USD. Error %s", err)
t.Errorf("Test failed. ConvertCurrency non-existent currency -> USD. Error %s", err)
}
_, err = ConvertCurrency(1000, "USD", "ASDF")
if err == nil {
t.Errorf("Test failed. ConvertCurrency USD -> non-existant currency. Error %s", err)
t.Errorf("Test failed. ConvertCurrency USD -> non-existent currency. Error %s", err)
}
_, err = ConvertCurrency(1000, "CNY", "UAHF")
if err == nil {
t.Errorf("Test failed. ConvertCurrency non-USD currency CNY -> non-existant currency. Error %s", err)
t.Errorf("Test failed. ConvertCurrency non-USD currency CNY -> non-existent currency. Error %s", err)
}
_, err = ConvertCurrency(1000, "UASF", "UAHF")
if err == nil {
t.Errorf("Test failed. ConvertCurrency non-existant currency -> non-existant currency. Error %s", err)
t.Errorf("Test failed. ConvertCurrency non-existent currency -> non-existent currency. Error %s", err)
}
}

View File

@@ -15,7 +15,7 @@ func TestGetSymbolByCurrencyName(t *testing.T) {
_, err = GetSymbolByCurrencyName("BLAH")
if err == nil {
t.Errorf("Test failed. TestGetSymbolByCurrencyNam returned nil on non-existant currency")
t.Errorf("Test failed. TestGetSymbolByCurrencyNam returned nil on non-existent currency")
}
}

View File

@@ -43,7 +43,7 @@ type Trades struct {
Trades []Trade `json:"trades"`
}
// Trade is a sub-type which holds the singular trade that occured in the past
// Trade is a sub-type which holds the singular trade that occurred in the past
type Trade struct {
TID int64 `json:"tid"`
Price float64 `json:"px"`

View File

@@ -188,7 +188,7 @@ func (b *Bitfinex) GetLends(symbol string, values url.Values) ([]Lends, error) {
return response, common.SendHTTPGetRequest(path, true, b.Verbose, &response)
}
// GetSymbols returns the avaliable currency pairs on the exchange
// GetSymbols returns the available currency pairs on the exchange
func (b *Bitfinex) GetSymbols() ([]string, error) {
products := []string{}
path := fmt.Sprint(bitfinexAPIURL + bitfinexSymbols)
@@ -444,7 +444,7 @@ func (b *Bitfinex) GetBalanceHistory(symbol string, timeSince, timeUntil time.Ti
b.SendAuthenticatedHTTPRequest("POST", bitfinexHistory, request, &response)
}
// GetMovementHistory returns an array of past deposits and withdrawels
// GetMovementHistory returns an array of past deposits and withdrawals
func (b *Bitfinex) GetMovementHistory(symbol, method string, timeSince, timeUntil time.Time, limit int) ([]MovementHistory, error) {
response := []MovementHistory{}
request := make(map[string]interface{})

View File

@@ -40,7 +40,7 @@ type TradeStructure struct {
Type string `json:"sell"`
}
// Lendbook holds most recent funding data for a relevent currency
// Lendbook holds most recent funding data for a relevant currency
type Lendbook struct {
Bids []Book `json:"bids"`
Asks []Book `json:"asks"`
@@ -86,7 +86,7 @@ type AccountInfo struct {
} `json:"fees"`
}
// AccountFees stores withdrawel account fee data from Bitfinex
// AccountFees stores withdrawal account fee data from Bitfinex
type AccountFees struct {
Withdraw struct {
BTC float64 `json:"BTC,string"`
@@ -186,7 +186,7 @@ type WalletTransfer struct {
Message string `json:"message"`
}
// Withdrawal holds withdrawel status information
// Withdrawal holds withdrawal status information
type Withdrawal struct {
Status string `json:"status"`
Message string `json:"message"`
@@ -300,7 +300,7 @@ type Offer struct {
ExecutedAmount float64 `json:"executed_amount,string"`
}
// MarginFunds holds active funding information used in a margin positon
// MarginFunds holds active funding information used in a margin position
type MarginFunds struct {
ID int64 `json:"id"`
PositionID int64 `json:"position_id"`

View File

@@ -350,7 +350,7 @@ func (b *Bitstamp) PlaceOrder(currencyPair string, price float64, amount float64
b.SendAuthenticatedHTTPRequest(path, true, req, &response)
}
// GetWithdrawalRequests returns withdrawl requests for the account
// GetWithdrawalRequests returns withdrawal requests for the account
// timedelta - positive integer with max value 50000000 which returns requests
// from number of seconds ago to now.
func (b *Bitstamp) GetWithdrawalRequests(timedelta int64) ([]WithdrawalRequests, error) {

View File

@@ -60,7 +60,7 @@ func (b *BTCMarkets) SetDefaults() {
b.AssetTypes = []string{ticker.Spot}
}
// Setup takes in an exchange configuration and sets all paramaters
// Setup takes in an exchange configuration and sets all parameters
func (b *BTCMarkets) Setup(exch config.ExchangeConfig) {
if !exch.Enabled {
b.SetEnabled(false)

View File

@@ -15,7 +15,7 @@ import (
const (
warningBase64DecryptSecretKeyFailed = "WARNING -- Exchange %s unable to base64 decode secret key.. Disabling Authenticated API support."
// WarningAuthenticatedRequestWithoutCredentialsSet error message for authenticated request without credentails set
// WarningAuthenticatedRequestWithoutCredentialsSet error message for authenticated request without credentials set
WarningAuthenticatedRequestWithoutCredentialsSet = "WARNING -- Exchange %s authenticated HTTP request called but not supported due to unset/default API keys."
// ErrExchangeNotFound is a constant for an error message
ErrExchangeNotFound = "Exchange not found in dataset."

View File

@@ -22,7 +22,7 @@ func TestSetAssetTypes(t *testing.T) {
err = b.SetAssetTypes()
if err == nil {
t.Fatal("Test failed. TestSetAssetTypes returned nil error for a non-existant exchange")
t.Fatal("Test failed. TestSetAssetTypes returned nil error for a non-existent exchange")
}
b.Name = "ANX"
@@ -77,9 +77,9 @@ func TestGetExchangeAssetTypes(t *testing.T) {
t.Fatal("Test failed. Bitfinex does not contain default asset type 'SPOT'")
}
_, err = GetExchangeAssetTypes("non-existant-exchange")
_, err = GetExchangeAssetTypes("non-existent-exchange")
if err == nil {
t.Fatal("Test failed. Got asset types for non-existant exchange")
t.Fatal("Test failed. Got asset types for non-existent exchange")
}
}
@@ -96,7 +96,7 @@ func TestSetCurrencyPairFormat(t *testing.T) {
err = b.SetCurrencyPairFormat()
if err == nil {
t.Fatal("Test failed. TestSetCurrencyPairFormat returned nil error for a non-existant exchange")
t.Fatal("Test failed. TestSetCurrencyPairFormat returned nil error for a non-existent exchange")
}
b.Name = "ANX"
@@ -349,9 +349,9 @@ func TestGetAndFormatExchangeCurrencies(t *testing.T) {
actual, expected)
}
_, err = GetAndFormatExchangeCurrencies("non-existant", pairs)
_, err = GetAndFormatExchangeCurrencies("non-existent", pairs)
if err == nil {
t.Errorf("Test failed - Exchange TestGetAndFormatExchangeCurrencies returned nil error on non-existant exchange")
t.Errorf("Test failed - Exchange TestGetAndFormatExchangeCurrencies returned nil error on non-existent exchange")
}
}

View File

@@ -71,7 +71,7 @@ func (g *GDAX) SetDefaults() {
g.AssetTypes = []string{ticker.Spot}
}
// Setup initialises the exchange paramaters with the current configuration
// Setup initialises the exchange parameters with the current configuration
func (g *GDAX) Setup(exch config.ExchangeConfig) {
if !exch.Enabled {
g.SetEnabled(false)
@@ -514,7 +514,7 @@ func (g *GDAX) GetFills(orderID, currencyPair string) ([]FillResponse, error) {
params.Set("product_id", currencyPair)
}
if len(params.Get("order_id")) == 0 && len(params.Get("product_id")) == 0 {
return resp, errors.New("no paramaters set")
return resp, errors.New("no parameters set")
}
path := common.EncodeURLValues(gdaxAPIURL+gdaxFills, params)
@@ -708,7 +708,7 @@ func (g *GDAX) GetCoinbaseAccounts() ([]CoinbaseAccounts, error) {
// E.g. BTC-USD. *Required* if type is fills
// accountID - ID of the account to generate an account report for. *Required*
// if type is account
// format - pdf or csv (defualt is pdf)
// format - pdf or csv (default is pdf)
// email - [optional] Email address to send the report to
func (g *GDAX) GetReport(reportType, startDate, endDate, currencyPair, accountID, format, email string) (Report, error) {
resp := Report{}

View File

@@ -111,7 +111,7 @@ func (g *Gemini) SetDefaults() {
g.AssetTypes = []string{ticker.Spot}
}
// Setup sets exchange configuration paramaters
// Setup sets exchange configuration parameters
func (g *Gemini) Setup(exch config.ExchangeConfig) {
if !exch.Enabled {
g.SetEnabled(false)
@@ -204,7 +204,7 @@ func (g *Gemini) GetTrades(currencyPair string, params url.Values) ([]Trade, err
return trades, common.SendHTTPGetRequest(path, true, g.Verbose, &trades)
}
// GetAuction returns auction infomation
// GetAuction returns auction information
func (g *Gemini) GetAuction(currencyPair string) (Auction, error) {
path := fmt.Sprintf("%s/v%s/%s/%s", geminiAPIURL, geminiAPIVersion, geminiAuction, currencyPair)
auction := Auction{}
@@ -348,8 +348,8 @@ func (g *Gemini) GetDepositAddress(depositAddlabel, currency string) (DepositAdd
}
// WithdrawCrypto withdraws crypto currency to a whitelisted address
func (g *Gemini) WithdrawCrypto(address, currency string, amount float64) (WithdrawelAddress, error) {
response := WithdrawelAddress{}
func (g *Gemini) WithdrawCrypto(address, currency string, amount float64) (WithdrawalAddress, error) {
response := WithdrawalAddress{}
request := make(map[string]interface{})
request["address"] = address
request["amount"] = strconv.FormatFloat(amount, 'f', -1, 64)

View File

@@ -150,8 +150,8 @@ type DepositAddress struct {
Label string `json:"label"`
}
// WithdrawelAddress holds withdrawel information
type WithdrawelAddress struct {
// WithdrawalAddress holds withdrawal information
type WithdrawalAddress struct {
Address string `json:"address"`
Amount float64 `json:"amount"`
TXHash string `json:"txHash"`

View File

@@ -51,7 +51,7 @@ func (i *ItBit) SetDefaults() {
i.AssetTypes = []string{ticker.Spot}
}
// Setup sets the exchange paramaters from exchange config
// Setup sets the exchange parameters from exchange config
func (i *ItBit) Setup(exch config.ExchangeConfig) {
if !exch.Enabled {
i.SetEnabled(false)

View File

@@ -92,21 +92,21 @@ func TestGetOrderbook(t *testing.T) {
t.Fatal("Test failed. TestGetOrderbook failed. Mismatched pairs")
}
_, err = GetOrderbook("nonexistant", currency, Spot)
_, err = GetOrderbook("nonexistent", currency, Spot)
if err == nil {
t.Fatal("Test failed. TestGetOrderbook retrieved non-existant orderbook")
t.Fatal("Test failed. TestGetOrderbook retrieved non-existent orderbook")
}
currency.FirstCurrency = "blah"
_, err = GetOrderbook("Exchange", currency, Spot)
if err == nil {
t.Fatal("Test failed. TestGetOrderbook retrieved non-existant orderbook using invalid first currency")
t.Fatal("Test failed. TestGetOrderbook retrieved non-existent orderbook using invalid first currency")
}
newCurrency := pair.NewCurrencyPair("BTC", "AUD")
_, err = GetOrderbook("Exchange", newCurrency, Spot)
if err == nil {
t.Fatal("Test failed. TestGetOrderbook retrieved non-existant orderbook using invalid second currency")
t.Fatal("Test failed. TestGetOrderbook retrieved non-existent orderbook using invalid second currency")
}
}

View File

@@ -36,7 +36,7 @@ type Base struct {
SendFrom string `json:"send_from"`
}
// New initalises the SMSGlobal var
// New initialises the SMSGlobal var
func New(username, password, sendFrom string, contacts []Contact) *Base {
if username == "" || password == "" || sendFrom == "" || len(contacts) == 0 {
return nil

View File

@@ -52,7 +52,7 @@ func TestGetContactByNumber(t *testing.T) {
_, err = result.GetContactByNumber("ASDASDASD")
if err == nil {
t.Fatal("Test failed. TestGetContactByNumber: Returned nil err on non-existant number")
t.Fatal("Test failed. TestGetContactByNumber: Returned nil err on non-existent number")
}
}
@@ -73,7 +73,7 @@ func TestGetContactByName(t *testing.T) {
_, err = result.GetContactByName("ASDASDASD")
if err == nil {
t.Fatal("Test failed. TestGetContactByName: Returned nil err on non-existant number")
t.Fatal("Test failed. TestGetContactByName: Returned nil err on non-existent number")
}
}