Improve codre quality according CR suggestions
MODIFY
WalletWasabi/Interfaces/IExchangeRateProvider.cs
WalletWasabi/Interfaces/IExchangeRateProvider.cs
@@ -6,6 +6,6 @@ namespace WalletWasabi.Interfaces
{
public interface IExchangeRateProvider
{
- Task<List<ExchangeRate>> GetExchangeRateAsync();
+ Task<IEnumerable<ExchangeRate>> GetExchangeRateAsync();
}
}

MODIFY
WalletWasabi/WebClients/Bitstamp/BitstampExchangeRateProvider.cs
WalletWasabi/WebClients/Bitstamp/BitstampExchangeRateProvider.cs
@@ -11,7 +11,7 @@ namespace WalletWasabi.WebClients.Bitstamp
{
public class BitstampExchangeRateProvider : IExchangeRateProvider
{
- public async Task<List<ExchangeRate>> GetExchangeRateAsync()
+ public async Task<IEnumerable<ExchangeRate>> GetExchangeRateAsync()
{
using var httpClient = new HttpClient();
httpClient.BaseAddress = new Uri("https://www.bitstamp.net");

MODIFY
WalletWasabi/WebClients/BlockchainInfo/BlockchainInfoExchangeRateProvider.cs
WalletWasabi/WebClients/BlockchainInfo/BlockchainInfoExchangeRateProvider.cs
@@ -9,7 +9,7 @@ namespace WalletWasabi.WebClients.BlockchainInfo
{
public class BlockchainInfoExchangeRateProvider : IExchangeRateProvider
{
- public async Task<List<ExchangeRate>> GetExchangeRateAsync()
+ public async Task<IEnumerable<ExchangeRate>> GetExchangeRateAsync()
{
using var httpClient = new HttpClient();
httpClient.BaseAddress = new Uri("https://blockchain.info");

MODIFY
WalletWasabi/WebClients/CoinGecko/CoinGeckoExchangeRateProvider.cs
WalletWasabi/WebClients/CoinGecko/CoinGeckoExchangeRateProvider.cs
@@ -11,7 +11,7 @@ namespace WalletWasabi.WebClients.CoinGecko
{
public class CoinGeckoExchangeRateProvider : IExchangeRateProvider
{
- public async Task<List<ExchangeRate>> GetExchangeRateAsync()
+ public async Task<IEnumerable<ExchangeRate>> GetExchangeRateAsync()
{
using var httpClient = new HttpClient();
httpClient.BaseAddress = new Uri("https://api.coingecko.com");

MODIFY
WalletWasabi/WebClients/Coinbase/CoinbaseExchangeRateProvider.cs
WalletWasabi/WebClients/Coinbase/CoinbaseExchangeRateProvider.cs
@@ -9,7 +9,7 @@ namespace WalletWasabi.WebClients.Coinbase
{
public class CoinbaseExchangeRateProvider : IExchangeRateProvider
{
- public async Task<List<ExchangeRate>> GetExchangeRateAsync()
+ public async Task<IEnumerable<ExchangeRate>> GetExchangeRateAsync()
{
using var httpClient = new HttpClient();
httpClient.BaseAddress = new Uri("https://api.coinbase.com");

MODIFY
WalletWasabi/WebClients/ExchangeRateProviders.cs
WalletWasabi/WebClients/ExchangeRateProviders.cs
@@ -31,7 +31,7 @@ namespace WalletWasabi.WebClients
new SmartBitExchangeRateProvider(new SmartBitClient(Network.Main))
};
- public async Task<List<ExchangeRate>> GetExchangeRateAsync()
+ public async Task<IEnumerable<ExchangeRate>> GetExchangeRateAsync()
{
foreach (var provider in ExchangeRateProviders)
{
@@ -45,7 +45,7 @@ namespace WalletWasabi.WebClients
Logger.LogTrace(ex);
}
}
- return Enumerable.Empty<ExchangeRate>().ToList();
+ return Enumerable.Empty<ExchangeRate>();
}
}
}

MODIFY
WalletWasabi/WebClients/Gemini/GeminiExchangeRateProvider.cs
WalletWasabi/WebClients/Gemini/GeminiExchangeRateProvider.cs
@@ -9,7 +9,7 @@ namespace WalletWasabi.WebClients.Gemini
{
public class GeminiExchangeRateProvider : IExchangeRateProvider
{
- public async Task<List<ExchangeRate>> GetExchangeRateAsync()
+ public async Task<IEnumerable<ExchangeRate>> GetExchangeRateAsync()
{
using var httpClient = new HttpClient();
httpClient.BaseAddress = new Uri("https://api.gemini.com");

MODIFY
WalletWasabi/WebClients/ItBit/ItBitExchangeRateProvider.cs
WalletWasabi/WebClients/ItBit/ItBitExchangeRateProvider.cs
@@ -9,7 +9,7 @@ namespace WalletWasabi.WebClients.ItBit
{
public class ItBitExchangeRateProvider : IExchangeRateProvider
{
- public async Task<List<ExchangeRate>> GetExchangeRateAsync()
+ public async Task<IEnumerable<ExchangeRate>> GetExchangeRateAsync()
{
using var httpClient = new HttpClient();
httpClient.BaseAddress = new Uri("https://api.itbit.com");

MODIFY
WalletWasabi/WebClients/SmartBit/SmartBitExchangeRateProvider.cs
WalletWasabi/WebClients/SmartBit/SmartBitExchangeRateProvider.cs
@@ -16,7 +16,7 @@ namespace WalletWasabi.WebClients.SmartBit
private SmartBitClient Client { get; }
- public async Task<List<ExchangeRate>> GetExchangeRateAsync()
+ public async Task<IEnumerable<ExchangeRate>> GetExchangeRateAsync()
{
var rates = await Client.GetExchangeRatesAsync(CancellationToken.None);
var rate = rates.Single(x => x.Code == "USD");

Improve codre quality according CR suggestions