mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2026-04-08 10:41:08 +00:00
Fixed Shared GetOrderBookOptions and GetRecentTradesOptions request validation not calling base validation
This commit is contained in:
parent
0d3ccf25a7
commit
25a392ee38
@ -45,7 +45,7 @@ namespace CryptoExchange.Net.SharedApis
|
|||||||
public override Error? ValidateRequest(string exchange, GetOrderBookRequest request, TradingMode? tradingMode, TradingMode[] supportedApiTypes)
|
public override Error? ValidateRequest(string exchange, GetOrderBookRequest request, TradingMode? tradingMode, TradingMode[] supportedApiTypes)
|
||||||
{
|
{
|
||||||
if (request.Limit == null)
|
if (request.Limit == null)
|
||||||
return null;
|
return base.ValidateRequest(exchange, request, tradingMode, supportedApiTypes);
|
||||||
|
|
||||||
if (MaxLimit.HasValue && request.Limit.Value > MaxLimit)
|
if (MaxLimit.HasValue && request.Limit.Value > MaxLimit)
|
||||||
return ArgumentError.Invalid(nameof(GetOrderBookRequest.Limit), $"Max limit is {MaxLimit}");
|
return ArgumentError.Invalid(nameof(GetOrderBookRequest.Limit), $"Max limit is {MaxLimit}");
|
||||||
|
|||||||
@ -22,8 +22,12 @@ namespace CryptoExchange.Net.SharedApis
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Error? Validate(GetRecentTradesRequest request)
|
public override Error? ValidateRequest(string exchange, GetRecentTradesRequest request, TradingMode? tradingMode, TradingMode[] supportedApiTypes)
|
||||||
{
|
{
|
||||||
|
var baseError = base.ValidateRequest(exchange, request, tradingMode, supportedApiTypes);
|
||||||
|
if (baseError != null)
|
||||||
|
return baseError;
|
||||||
|
|
||||||
if (request.Limit > MaxLimit)
|
if (request.Limit > MaxLimit)
|
||||||
return ArgumentError.Invalid(nameof(GetRecentTradesRequest.Limit), $"Only the most recent {MaxLimit} trades are available");
|
return ArgumentError.Invalid(nameof(GetRecentTradesRequest.Limit), $"Only the most recent {MaxLimit} trades are available");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user