Skip to content

Commit

Permalink
Removed pre-send symbol validation
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Apr 3, 2024
1 parent 203c4f3 commit 86ad4f2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
18 changes: 0 additions & 18 deletions Huobi.Net.UnitTests/HuobiClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,6 @@ public string SerializeExpected<T>(T data, bool tick)
return $"{{\"status\": \"ok\", {(tick ? "tick" : "data")}: {JsonConvert.SerializeObject(data)}}}";
}

[TestCase("BTCUSDT", true)]
[TestCase("NANOUSDT", true)]
[TestCase("NANOBTC", true)]
[TestCase("ETHBTC", true)]
[TestCase("BEETC", true)]
[TestCase("BEEC", true)]
[TestCase("BEC", false)]
[TestCase("NANOUSDTD", true)]
[TestCase("BTC-USDT", false)]
[TestCase("BTC-USD", false)]
public void CheckValidHuobiSymbol(string symbol, bool isValid)
{
if (isValid)
Assert.DoesNotThrow(() => symbol.ValidateHuobiSymbol());
else
Assert.Throws(typeof(ArgumentException), () => symbol.ValidateHuobiSymbol());
}

[Test]
public void CheckRestInterfaces()
{
Expand Down
2 changes: 0 additions & 2 deletions Huobi.Net/ExtensionMethods/HuobiExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public static string ValidateHuobiSymbol(this string symbolString)
if (string.IsNullOrEmpty(symbolString))
throw new ArgumentException("Symbol is not provided");
symbolString = symbolString.ToLower(CultureInfo.InvariantCulture);
if (!Regex.IsMatch(symbolString, "^(([a-z]|[0-9]){4,})$"))
throw new ArgumentException($"{symbolString} is not a valid Huobi symbol. Should be [QuoteAsset][BaseAsset], e.g. ETHBTC");
return symbolString;
}
}
Expand Down

0 comments on commit 86ad4f2

Please sign in to comment.