remove err since handling init for client

This commit is contained in:
Alan.sung 2023-09-07 11:25:12 +08:00
parent dbf29f8cd2
commit 9a66f82d8c
3 changed files with 4 additions and 5 deletions

View File

@ -37,7 +37,7 @@ func New(n types.ExchangeName, key, secret, passphrase string) (types.ExchangeMi
return max.New(key, secret), nil return max.New(key, secret), nil
case types.ExchangeOKEx: case types.ExchangeOKEx:
return okex.New(key, secret, passphrase) return okex.New(key, secret, passphrase), nil
case types.ExchangeKucoin: case types.ExchangeKucoin:
return kucoin.New(key, secret, passphrase), nil return kucoin.New(key, secret, passphrase), nil

View File

@ -34,7 +34,7 @@ type Exchange struct {
client *okexapi.RestClient client *okexapi.RestClient
} }
func New(key, secret, passphrase string) (*Exchange, error) { func New(key, secret, passphrase string) *Exchange {
client := okexapi.NewClient() client := okexapi.NewClient()
if len(key) > 0 && len(secret) > 0 { if len(key) > 0 && len(secret) > 0 {
@ -46,7 +46,7 @@ func New(key, secret, passphrase string) (*Exchange, error) {
secret: secret, secret: secret,
passphrase: passphrase, passphrase: passphrase,
client: client, client: client,
}, nil }
} }
func (e *Exchange) Name() types.ExchangeName { func (e *Exchange) Name() types.ExchangeName {

View File

@ -22,8 +22,7 @@ func Test_QueryOrder(t *testing.T) {
return return
} }
e, err := New(key, secret, passphrase) e := New(key, secret, passphrase)
assert.NoError(t, err)
queryOrder := types.OrderQuery{ queryOrder := types.OrderQuery{
Symbol: "BTC-USDT", Symbol: "BTC-USDT",