Kraken: Fix GetLatestFundingRates requiring pair enabled (#1522)

* Kraken: Fix GetLatestFundingRates requiring pair enabled

* Tests: Add latestRateRequests to all asset tests
This commit is contained in:
Gareth Kirwan
2024-04-19 09:16:17 +02:00
committed by GitHub
parent fdf6014dca
commit 44d50a3617
4 changed files with 71 additions and 16 deletions

View File

@@ -185,17 +185,15 @@ func executeExchangeWrapperTests(ctx context.Context, t *testing.T, exch exchang
var assetLen int
for y := 0; y < method.Type().NumIn(); y++ {
input := method.Type().In(y)
if input.AssignableTo(assetParam) ||
input.AssignableTo(orderSubmitParam) ||
input.AssignableTo(orderModifyParam) ||
input.AssignableTo(orderCancelParam) ||
input.AssignableTo(orderCancelsParam) ||
input.AssignableTo(pairKeySliceParam) ||
input.AssignableTo(getOrdersRequestParam) ||
input.AssignableTo(pairKeySliceParam) {
// this allows wrapper functions that support assets types
// to be tested with all supported assets
assetLen = len(assetParams) - 1
for _, t := range []reflect.Type{
assetParam, orderSubmitParam, orderModifyParam, orderCancelParam, orderCancelsParam, pairKeySliceParam, getOrdersRequestParam, latestRateRequest,
} {
if input.AssignableTo(t) {
// this allows wrapper functions that support assets types
// to be tested with all supported assets
assetLen = len(assetParams) - 1
break
}
}
}
tt := time.Now()