mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-02 15:10:46 +00:00
sharedtestvalues: Add helper functions and implement throughout exchange tests (#1163)
* exchanges/sharedtestvalues: implement new functions to handle test skipping and announcements for standardising. * exchanges: fin test impl. * linter: fixes * exchange_template: fix test * allocate so it doesn't make a panic at the disco * glorious: nits * glorious: nits * Update exchanges/sharedtestvalues/sharedtestvalues.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * Update exchanges/sharedtestvalues/sharedtestvalues.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * glorious: nits * linter: fix * linter: shhhh --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io> Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
This commit is contained in:
@@ -17,7 +17,7 @@ const (
|
||||
canManipulateRealOrders = false
|
||||
)
|
||||
|
||||
var {{.Variable}} {{.CapitalName}}
|
||||
var {{.Variable}} = &{{.CapitalName}}{}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
{{.Variable}}.SetDefaults()
|
||||
@@ -53,9 +53,5 @@ func TestInterface(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func areTestAPIKeysSet() bool {
|
||||
return {{.Variable}}.ValidateAPICredentials({{.Variable}}.GetDefaultCredentials()) == nil
|
||||
}
|
||||
|
||||
// Implement tests for API endpoints below
|
||||
{{end}}
|
||||
|
||||
@@ -518,8 +518,8 @@ func ({{.Variable}} *{{.CapitalName}}) GetFeeByType(ctx context.Context, feeBuil
|
||||
return 0, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
// ValidateCredentials validates current credentials used for wrapper
|
||||
func ({{.Variable}} *{{.CapitalName}}) ValidateCredentials(ctx context.Context, assetType asset.Item) error {
|
||||
// ValidateAPICredentials validates current credentials used for wrapper
|
||||
func ({{.Variable}} *{{.CapitalName}}) ValidateAPICredentials(ctx context.Context, assetType asset.Item) error {
|
||||
_, err := {{.Variable}}.UpdateAccountInfo(ctx, assetType)
|
||||
return {{.Variable}}.CheckTransientError(err)
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ func setExchangeAPIKeys(name string, keys map[string]*config.APICredentialsConfi
|
||||
base.Config.API.AuthenticatedSupport = true
|
||||
base.Config.API.AuthenticatedWebsocketSupport = true
|
||||
|
||||
return base.ValidateAPICredentials(base.GetDefaultCredentials()) == nil
|
||||
return base.VerifyAPICredentials(base.GetDefaultCredentials()) == nil
|
||||
}
|
||||
|
||||
func parseOrderSide(orderSide string) order.Side {
|
||||
|
||||
Reference in New Issue
Block a user