diff --git a/pkg/exchange/factory.go b/pkg/exchange/factory.go index c7f3371ca..00d6db7c9 100644 --- a/pkg/exchange/factory.go +++ b/pkg/exchange/factory.go @@ -37,7 +37,7 @@ func New(n types.ExchangeName, key, secret, passphrase string) (types.ExchangeMi return max.New(key, secret), nil case types.ExchangeOKEx: - return okex.New(key, secret, passphrase) + return okex.New(key, secret, passphrase), nil case types.ExchangeKucoin: return kucoin.New(key, secret, passphrase), nil diff --git a/pkg/exchange/okex/exchange.go b/pkg/exchange/okex/exchange.go index 06b5889b4..d09fd76bd 100644 --- a/pkg/exchange/okex/exchange.go +++ b/pkg/exchange/okex/exchange.go @@ -34,7 +34,7 @@ type Exchange struct { client *okexapi.RestClient } -func New(key, secret, passphrase string) (*Exchange, error) { +func New(key, secret, passphrase string) *Exchange { client := okexapi.NewClient() if len(key) > 0 && len(secret) > 0 { @@ -46,7 +46,7 @@ func New(key, secret, passphrase string) (*Exchange, error) { secret: secret, passphrase: passphrase, client: client, - }, nil + } } func (e *Exchange) Name() types.ExchangeName { diff --git a/pkg/exchange/okex/query_order_test.go b/pkg/exchange/okex/query_order_test.go index 025e045ba..3c32da40c 100644 --- a/pkg/exchange/okex/query_order_test.go +++ b/pkg/exchange/okex/query_order_test.go @@ -22,8 +22,7 @@ func Test_QueryOrder(t *testing.T) { return } - e, err := New(key, secret, passphrase) - assert.NoError(t, err) + e := New(key, secret, passphrase) queryOrder := types.OrderQuery{ Symbol: "BTC-USDT",