mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-19 21:24:22 +01:00
(Fix): Fixed Yadio exchange rate lookup failing (#6743)
* (Fix): Fixed Yadio exchange rate lookup failing Signed-off-by: Abhijay jain <Abhijay007j@gmail.com> * Adding XPT check as well, since it was causing failures --------- Signed-off-by: Abhijay jain <Abhijay007j@gmail.com> Co-authored-by: rockstardev <5191402+rockstardev@users.noreply.github.com>
This commit is contained in:
@@ -30,10 +30,10 @@ namespace BTCPayServer.Services.Rates
|
||||
var list = new List<PairRate>();
|
||||
foreach (var item in results)
|
||||
{
|
||||
|
||||
string name = ((JProperty)item).Name;
|
||||
var value = results[name].Value<decimal>();
|
||||
list.Add(new PairRate(new CurrencyPair("BTC", name), new BidAsk(value)));
|
||||
var value = results[name].Value<decimal?>();
|
||||
if (value.HasValue)
|
||||
list.Add(new PairRate(new CurrencyPair("BTC", name), new BidAsk(value.Value)));
|
||||
}
|
||||
|
||||
return list.ToArray();
|
||||
|
||||
@@ -138,13 +138,14 @@ namespace BTCPayServer.Tests
|
||||
var factory = FastTests.CreateBTCPayRateFactory();
|
||||
var directlySupported = factory.AvailableRateProviders.Where(s => s.Source == RateSource.Direct)
|
||||
.Select(s => s.Id).ToHashSet();
|
||||
foreach (var result in factory
|
||||
var providerList = factory
|
||||
.Providers
|
||||
.Where(p => p.Value is BackgroundFetcherRateProvider bf &&
|
||||
!(bf.Inner is CoinGeckoRateProvider cg && cg.UnderlyingExchange != null))
|
||||
.Select(p => (ExpectedName: p.Key, ResultAsync: p.Value.GetRatesAsync(default),
|
||||
Fetcher: (BackgroundFetcherRateProvider)p.Value))
|
||||
.ToList())
|
||||
.ToList();
|
||||
foreach (var result in providerList)
|
||||
{
|
||||
var name = result.ExpectedName;
|
||||
if (brokenShitcoinCasinos.Contains(name))
|
||||
@@ -207,6 +208,9 @@ namespace BTCPayServer.Tests
|
||||
Assert.Contains(exchangeRates.ByExchange[name],
|
||||
e => e.CurrencyPair == new CurrencyPair("BTC", "LBP") &&
|
||||
e.BidAsk.Bid > 1.0m); // 1 BTC will always be more than 1 LBP (I hope)
|
||||
Assert.Contains(exchangeRates.ByExchange[name],
|
||||
e => e.CurrencyPair == new CurrencyPair("BTC", "XPT") &&
|
||||
e.BidAsk.Bid > 1.0m); // 1 BTC will always be more than 1 LBP (I hope)
|
||||
}
|
||||
else if (name == "bitmynt")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user