Decouple DefaultRates from BTCPayNetwork (#5974)

This commit is contained in:
Nicolas Dorier
2024-05-09 17:20:24 +09:00
committed by GitHub
parent 4c303d358b
commit adbe5977cd
17 changed files with 85 additions and 48 deletions

View File

@@ -52,6 +52,7 @@ namespace BTCPayServer.Controllers
readonly BTCPayNetworkProvider _NetworkProvider;
private readonly PayoutMethodHandlerDictionary _payoutHandlers;
private readonly PaymentMethodHandlerDictionary _handlers;
private readonly IEnumerable<DefaultRates> _defaultRates;
private readonly ApplicationDbContextFactory _dbContextFactory;
private readonly PullPaymentHostedService _paymentHostedService;
private readonly LanguageService _languageService;
@@ -93,6 +94,7 @@ namespace BTCPayServer.Controllers
AppService appService,
IFileService fileService,
UriResolver uriResolver,
IEnumerable<DefaultRates> defaultRates,
IAuthorizationService authorizationService,
TransactionLinkProviders transactionLinkProviders,
Dictionary<PaymentMethodId, IPaymentModelExtension> paymentModelExtensions,
@@ -123,6 +125,7 @@ namespace BTCPayServer.Controllers
_viewProvider = viewProvider;
_fileService = fileService;
_uriResolver = uriResolver;
_defaultRates = defaultRates;
_appService = appService;
}
@@ -294,7 +297,7 @@ namespace BTCPayServer.Controllers
private async Task FetchRates(InvoiceCreationContext context, CancellationToken cancellationToken)
{
var rateRules = context.StoreBlob.GetRateRules(_NetworkProvider);
var rateRules = context.StoreBlob.GetRateRules(_defaultRates);
await context.FetchingRates(_RateProvider, rateRules, cancellationToken);
}
}