mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-30 23:16:52 +00:00
Feature: Add mock testing to ZB (#569)
* Adds mock testing to ZB
* STEALS improved time validation code from the original STOLEN validation code :D
* Mini fixes from review
* happy fun comment stealing
* Moves the loop checker earlier to ensure no double appendages
* Fixes sneaky test
* Fixes the important part where mock tests work instead of live tests
* Skips authenticated endpoints for mock testing.
* lint
* Updates candle wrapper functions to respect design
* basic linting fix
* Reverts configtest.json, updates readme to be way better, adds coverage to validateCandlesRequest
* Tiniest grammatical fix
* Fixes more outdated code references
* Closing out a high
* Fixes spacing
* Replaces all instances of 4 spaces in tmpl files with a tab
* fixes spacing and tab related readme issues once and for all 🤞
* tidy
* indentation violation identification situation
This commit is contained in:
@@ -31,8 +31,8 @@ Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader
|
||||
+ Individual package example below:
|
||||
|
||||
```go
|
||||
// Exchanges will be abstracted out in further updates and examples will be
|
||||
// supplied then
|
||||
// Exchanges will be abstracted out in further updates and examples will be
|
||||
// supplied then
|
||||
```
|
||||
|
||||
### How to do REST public/private calls
|
||||
@@ -48,9 +48,9 @@ main.go
|
||||
var i exchange.IBotExchange
|
||||
|
||||
for x := range bot.Exchanges {
|
||||
if bot.Exchanges[x].GetName() == "Itbit" {
|
||||
i = bot.Exchanges[x]
|
||||
}
|
||||
if bot.Exchanges[x].GetName() == "Itbit" {
|
||||
i = bot.Exchanges[x]
|
||||
}
|
||||
}
|
||||
|
||||
// Public calls - wrapper functions
|
||||
@@ -58,13 +58,13 @@ for x := range bot.Exchanges {
|
||||
// Fetches current ticker information
|
||||
tick, err := i.FetchTicker()
|
||||
if err != nil {
|
||||
// Handle error
|
||||
// Handle error
|
||||
}
|
||||
|
||||
// Fetches current orderbook information
|
||||
ob, err := i.FetchOrderbook()
|
||||
if err != nil {
|
||||
// Handle error
|
||||
// Handle error
|
||||
}
|
||||
|
||||
// Private calls - wrapper functions - make sure your APIKEY and APISECRET are
|
||||
@@ -73,7 +73,7 @@ if err != nil {
|
||||
// Fetches current account information
|
||||
accountInfo, err := i.GetAccountInfo()
|
||||
if err != nil {
|
||||
// Handle error
|
||||
// Handle error
|
||||
}
|
||||
```
|
||||
|
||||
@@ -85,13 +85,13 @@ if err != nil {
|
||||
// Fetches current ticker information
|
||||
ticker, err := i.GetTicker()
|
||||
if err != nil {
|
||||
// Handle error
|
||||
// Handle error
|
||||
}
|
||||
|
||||
// Fetches current orderbook information
|
||||
ob, err := i.GetOrderBook()
|
||||
if err != nil {
|
||||
// Handle error
|
||||
// Handle error
|
||||
}
|
||||
|
||||
// Private calls - make sure your APIKEY and APISECRET are set and
|
||||
@@ -100,13 +100,13 @@ if err != nil {
|
||||
// GetUserInfo returns account info
|
||||
accountInfo, err := i.GetUserInfo(...)
|
||||
if err != nil {
|
||||
// Handle error
|
||||
// Handle error
|
||||
}
|
||||
|
||||
// Submits an order and the exchange and returns its tradeID
|
||||
tradeID, err := i.Trade(...)
|
||||
if err != nil {
|
||||
// Handle error
|
||||
// Handle error
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user