Skip to content

Commit 6032800

Browse files
committed
Changed CryptoNameResolver.cs in such way that all "binange-peg" cryptocurrency entries are filtered out.
1 parent 6a4471e commit 6032800

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CryptoStatsSource/CryptoNameResolver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public async Task Refresh()
4444

4545
// fetch all cryptocurrencies and add them to the dictionary using the symbol as a key
4646
(await _cryptoStatsSource.GetAvailableCryptocurrencies())
47-
// workaround till Coingecko removes binance-peg-cardano entry
48-
.Where(c => c.Symbol != "ada" && c.Id != "binance-peg-cardano").ToList()
47+
// workaround till Coingecko removes binance-peg entries
48+
.Where(c => !c.Id.Contains("binance-peg")).ToList()
4949
.ForEach(c =>
5050
_nameToCryptocurrencyDictionary.TryAdd(c.Symbol, c));
5151
}

Tests/Integration/CryptoStatsSource/CryptoNameResolverTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public ResolveNameTest()
1818
public async void SimpleThreeEntries()
1919
{
2020
Assert.Equal(new("bitcoin", "btc", "Bitcoin"), await _resolver.Resolve("btc"));
21-
Assert.Equal(new ("cardano", "ada", "Cardano"), await _resolver.Resolve("cardano"));
21+
Assert.Equal(new ("cardano", "ada", "Cardano"), await _resolver.Resolve("ada"));
2222
Assert.Equal(new ("litecoin", "ltc", "Litecoin"), await _resolver.Resolve("ltc"));
2323
Assert.Equal(new("ethereum", "eth", "Ethereum"), await _resolver.Resolve("eth"));
2424
Assert.Null(await _resolver.Resolve("abcefghbzbzrfoo"));

0 commit comments

Comments
 (0)