mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Okx: Fix GetInsuranceFundInformation "" resp (#1405)
* Okx: Fix GetInsuranceFundInformation "" resp When amount is "" this was erroring * Test: Standardise configtest.json Simple jq formatting of configtest git diff -w or github ignore whitespaces should show no changes. Any conflicts, just accept --ours and reformat it. Or not :o)
This commit is contained in:
@@ -359,12 +359,18 @@ func TestGetPublicUnderlyings(t *testing.T) {
|
||||
|
||||
func TestGetInsuranceFundInformation(t *testing.T) {
|
||||
t.Parallel()
|
||||
if _, err := ok.GetInsuranceFundInformation(contextGenerate(), &InsuranceFundInformationRequestParams{
|
||||
r, err := ok.GetInsuranceFundInformation(contextGenerate(), &InsuranceFundInformationRequestParams{
|
||||
InstrumentType: "FUTURES",
|
||||
Underlying: "BTC-USDT",
|
||||
Limit: 2,
|
||||
}); err != nil {
|
||||
t.Error("Okx GetInsuranceFundInformation() error", err)
|
||||
})
|
||||
assert.NoError(t, err, "GetInsuranceFundInformation should not error")
|
||||
assert.Positive(t, r.Total, "Total should be positive")
|
||||
assert.NotEmpty(t, r.Details, "Should have some details")
|
||||
for _, d := range r.Details {
|
||||
assert.Positive(t, d.Balance, "Balance should be positive")
|
||||
assert.NotEmpty(t, d.Type, "Type should not be empty")
|
||||
assert.Positive(t, d.Timestamp, "Timestamp should be positive")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -505,11 +505,11 @@ type InsuranceFundInformation struct {
|
||||
// InsuranceFundInformationDetail represents an Insurance fund information item for a
|
||||
// single currency and type
|
||||
type InsuranceFundInformationDetail struct {
|
||||
Amount float64 `json:"amt,string"`
|
||||
Balance float64 `json:"balance,string"`
|
||||
Currency string `json:"ccy"`
|
||||
Timestamp okxUnixMilliTime `json:"ts"`
|
||||
Type string `json:"type"`
|
||||
Amount convert.StringToFloat64 `json:"amt"`
|
||||
Balance convert.StringToFloat64 `json:"balance"`
|
||||
Currency string `json:"ccy"`
|
||||
Timestamp okxUnixMilliTime `json:"ts"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
// SupportedCoinsData holds information about currencies supported by the trading data endpoints.
|
||||
|
||||
4798
testdata/configtest.json
vendored
4798
testdata/configtest.json
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user