mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-13 19:37:37 +01:00
Make sure tests use fixed fees
This commit is contained in:
parent
7ce614f1c4
commit
1e0587af26
2 changed files with 12 additions and 1 deletions
|
@ -1,4 +1,6 @@
|
||||||
using BTCPayServer.Configuration;
|
using BTCPayServer.Configuration;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using BTCPayServer.HostedServices;
|
using BTCPayServer.HostedServices;
|
||||||
using BTCPayServer.Hosting;
|
using BTCPayServer.Hosting;
|
||||||
|
@ -179,6 +181,10 @@ namespace BTCPayServer.Tests
|
||||||
.AddProvider(Logs.LogProvider);
|
.AddProvider(Logs.LogProvider);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
.ConfigureServices(services =>
|
||||||
|
{
|
||||||
|
services.TryAddSingleton<IFeeProviderFactory>(new BTCPayServer.Services.Fees.FixedFeeProvider(new FeeRate(100L, 1)));
|
||||||
|
})
|
||||||
.UseKestrel()
|
.UseKestrel()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
.Build();
|
.Build();
|
||||||
|
|
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace BTCPayServer.Services.Fees
|
namespace BTCPayServer.Services.Fees
|
||||||
{
|
{
|
||||||
public class FixedFeeProvider : IFeeProvider
|
public class FixedFeeProvider : IFeeProvider, IFeeProviderFactory
|
||||||
{
|
{
|
||||||
public FixedFeeProvider(FeeRate feeRate)
|
public FixedFeeProvider(FeeRate feeRate)
|
||||||
{
|
{
|
||||||
|
@ -18,6 +18,11 @@ namespace BTCPayServer.Services.Fees
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IFeeProvider CreateFeeProvider(BTCPayNetworkBase network)
|
||||||
|
{
|
||||||
|
return new FixedFeeProvider(FeeRate);
|
||||||
|
}
|
||||||
|
|
||||||
public Task<FeeRate> GetFeeRateAsync(int blockTarget)
|
public Task<FeeRate> GetFeeRateAsync(int blockTarget)
|
||||||
{
|
{
|
||||||
return Task.FromResult(FeeRate);
|
return Task.FromResult(FeeRate);
|
||||||
|
|
Loading…
Add table
Reference in a new issue