Skip to content

Commit

Permalink
Slight change on margin unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
samuael committed Jan 9, 2025
1 parent 0dde48a commit b1b120d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions exchanges/margin/margin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ func TestString(t *testing.T) {
assert.Equal(t, isolatedStr, Isolated.String())
assert.Equal(t, multiStr, Multi.String())
assert.Equal(t, unsetStr, Unset.String())
assert.Equal(t, spotIsolatedStr, SpotIsolated.String())
assert.Equal(t, cashStr, Cash.String())
assert.Equal(t, "", Type(30).String())
}

func TestUpper(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion exchanges/margin/margin_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const (
var supported = Isolated | Multi

const (
unsetStr = "unset"
unsetStr = ""
isolatedStr = "isolated"
multiStr = "multi"
cashStr = "cash"
Expand Down
5 changes: 4 additions & 1 deletion exchanges/okx/okx.go
Original file line number Diff line number Diff line change
Expand Up @@ -5673,7 +5673,10 @@ func (ok *Okx) SendHTTPRequest(ctx context.Context, ep exchange.URL, f request.E
}
err = ok.SendPayload(ctx, f, newRequest, requestType)
if err != nil {
return fmt.Errorf("%w %w", request.ErrAuthRequestFailed, err)
if authenticated == request.AuthenticatedRequest {
return fmt.Errorf("%w %w", request.ErrAuthRequestFailed, err)
}
return err
}
if rv.Kind() == reflect.Slice {
value, okay := result.([]interface{})
Expand Down
1 change: 1 addition & 0 deletions exchanges/okx/okx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ func TestGet24HTotalVolume(t *testing.T) {

func TestGetOracle(t *testing.T) {
t.Parallel()
ok.Verbose = true
result, err := ok.GetOracle(contextGenerate())
require.NoError(t, err)
assert.NotNil(t, result)
Expand Down

0 comments on commit b1b120d

Please sign in to comment.