Split projects (#857)

This commit is contained in:
Nicolas Dorier
2019-05-24 18:42:22 +09:00
committed by GitHub
parent d86cc9192e
commit 15dc0d60db
46 changed files with 94 additions and 32 deletions

View File

@@ -3,8 +3,6 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using BTCPayServer.Services.Invoices;
using BTCPayServer.Services.Rates;
using NBitcoin; using NBitcoin;
using NBXplorer; using NBXplorer;
@@ -76,7 +74,7 @@ namespace BTCPayServer
return CryptoCode; return CryptoCode;
} }
internal KeyPath GetRootKeyPath() public KeyPath GetRootKeyPath()
{ {
return new KeyPath(NBitcoinNetwork.Consensus.SupportSegwit ? "49'" : "44'") return new KeyPath(NBitcoinNetwork.Consensus.SupportSegwit ? "49'" : "44'")
.Derive(CoinType); .Derive(CoinType);

View File

@@ -2,9 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin; using NBitcoin;
using NBitpayClient;
using NBXplorer; using NBXplorer;
namespace BTCPayServer namespace BTCPayServer

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin; using NBitcoin;
using NBXplorer; using NBXplorer;

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin; using NBitcoin;
using NBXplorer; using NBXplorer;

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin; using NBitcoin;
using NBXplorer; using NBXplorer;

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin; using NBitcoin;
using NBXplorer; using NBXplorer;

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin; using NBitcoin;
using NBXplorer; using NBXplorer;

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin; using NBitcoin;
using NBXplorer; using NBXplorer;

View File

@@ -2,7 +2,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin; using NBitcoin;
using NBXplorer; using NBXplorer;

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin; using NBitcoin;
using NBXplorer; using NBXplorer;

View File

@@ -2,7 +2,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin; using NBitcoin;
using NBXplorer; using NBXplorer;

View File

@@ -3,10 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using Microsoft.Extensions.Caching.Memory;
using NBitcoin; using NBitcoin;
using NBitpayClient;
using NBXplorer; using NBXplorer;
namespace BTCPayServer namespace BTCPayServer

View File

@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.9" />
<PackageReference Include="NBitcoin" Version="4.1.2.32" />
<PackageReference Include="NBXplorer.Client" Version="2.0.0.16" />
</ItemGroup>
</Project>

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace BTCPayServer namespace BTCPayServer
{ {
class CustomThreadPool : IDisposable public class CustomThreadPool : IDisposable
{ {
CancellationTokenSource _Cancel = new CancellationTokenSource(); CancellationTokenSource _Cancel = new CancellationTokenSource();
TaskCompletionSource<bool> _Exited; TaskCompletionSource<bool> _Exited;

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BTCPayServer
{
public static class UtilitiesExtensions
{
public static void AddRange<T>(this HashSet<T> hashSet, IEnumerable<T> items)
{
foreach (var item in items)
{
hashSet.Add(item);
}
}
}
}

View File

@@ -6,7 +6,7 @@ using System.Text;
namespace BTCPayServer namespace BTCPayServer
{ {
class ZipUtils public class ZipUtils
{ {
public static byte[] Zip(string unzipped) public static byte[] Zip(string unzipped)
{ {

View File

@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
<Folder Include="Providers\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.9" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="DigitalRuby.ExchangeSharp" Version="0.5.3" />
<PackageReference Include="NBitpayClient" Version="1.0.0.34" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BTCPayServer.Common\BTCPayServer.Common.csproj" />
</ItemGroup>
</Project>

View File

@@ -4,10 +4,10 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.ExceptionServices; using System.Runtime.ExceptionServices;
using System.Threading.Tasks; using System.Threading.Tasks;
using BTCPayServer.Data;
using BTCPayServer.Logging;
using BTCPayServer.Rating; using BTCPayServer.Rating;
using System.Threading; using System.Threading;
using Microsoft.Extensions.Logging.Abstractions;
using BTCPayServer.Logging;
namespace BTCPayServer.Services.Rates namespace BTCPayServer.Services.Rates
{ {
@@ -39,6 +39,7 @@ namespace BTCPayServer.Services.Rates
} }
IRateProvider _Inner; IRateProvider _Inner;
public BackgroundFetcherRateProvider(IRateProvider inner) public BackgroundFetcherRateProvider(IRateProvider inner)
{ {
if (inner == null) if (inner == null)

View File

@@ -4,7 +4,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using NBitcoin;
using BTCPayServer.Rating; using BTCPayServer.Rating;
using System.Threading; using System.Threading;

View File

@@ -7,6 +7,7 @@ using System.Threading.Tasks;
using BTCPayServer.Rating; using BTCPayServer.Rating;
using ExchangeSharp; using ExchangeSharp;
using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
namespace BTCPayServer.Services.Rates namespace BTCPayServer.Services.Rates

View File

@@ -33,6 +33,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\BTCPayServer.Rating\BTCPayServer.Rating.csproj" />
<ProjectReference Include="..\BTCPayServer\BTCPayServer.csproj" /> <ProjectReference Include="..\BTCPayServer\BTCPayServer.csproj" />
</ItemGroup> </ItemGroup>

View File

@@ -38,7 +38,6 @@
<PackageReference Include="BuildBundlerMinifier" Version="2.9.406" /> <PackageReference Include="BuildBundlerMinifier" Version="2.9.406" />
<PackageReference Include="BundlerMinifier.Core" Version="2.9.406" /> <PackageReference Include="BundlerMinifier.Core" Version="2.9.406" />
<PackageReference Include="BundlerMinifier.TagHelpers" Version="2.9.406" /> <PackageReference Include="BundlerMinifier.TagHelpers" Version="2.9.406" />
<PackageReference Include="DigitalRuby.ExchangeSharp" Version="0.5.3" />
<PackageReference Include="HtmlSanitizer" Version="4.0.207" /> <PackageReference Include="HtmlSanitizer" Version="4.0.207" />
<PackageReference Include="LedgerWallet" Version="2.0.0.3" /> <PackageReference Include="LedgerWallet" Version="2.0.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
@@ -47,10 +46,8 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="NBitcoin" Version="4.1.2.32" />
<PackageReference Include="NBitpayClient" Version="1.0.0.34" /> <PackageReference Include="NBitpayClient" Version="1.0.0.34" />
<PackageReference Include="DBriize" Version="1.0.0.4" /> <PackageReference Include="DBriize" Version="1.0.0.4" />
<PackageReference Include="NBXplorer.Client" Version="2.0.0.16" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="NicolasDorier.CommandLine" Version="1.0.0.2" /> <PackageReference Include="NicolasDorier.CommandLine" Version="1.0.0.2" />
<PackageReference Include="NicolasDorier.CommandLine.Configuration" Version="1.0.0.3" /> <PackageReference Include="NicolasDorier.CommandLine.Configuration" Version="1.0.0.3" />
@@ -140,6 +137,11 @@
<Folder Include="wwwroot\vendor\u2f" /> <Folder Include="wwwroot\vendor\u2f" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BTCPayServer.Rating\BTCPayServer.Rating.csproj" />
<ProjectReference Include="..\BTCPayServer.Common\BTCPayServer.Common.csproj" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Content Update="Views\Apps\_ViewImports.cshtml"> <Content Update="Views\Apps\_ViewImports.cshtml">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>

View File

@@ -327,13 +327,6 @@ namespace BTCPayServer
NBitcoin.Extensions.TryAdd(ctx.Items, "IsBitpayAPI", value); NBitcoin.Extensions.TryAdd(ctx.Items, "IsBitpayAPI", value);
} }
public static void AddRange<T>(this HashSet<T> hashSet, IEnumerable<T> items)
{
foreach (var item in items)
{
hashSet.Add(item);
}
}
public static bool GetIsBitpayAPI(this HttpContext ctx) public static bool GetIsBitpayAPI(this HttpContext ctx)
{ {
return ctx.Items.TryGetValue("IsBitpayAPI", out object obj) && return ctx.Items.TryGetValue("IsBitpayAPI", out object obj) &&

View File

@@ -15,6 +15,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{29290EC7-0
Dockerfile.linuxarm32v7 = Dockerfile.linuxarm32v7 Dockerfile.linuxarm32v7 = Dockerfile.linuxarm32v7
EndProjectSection EndProjectSection
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BTCPayServer.Rating", "BTCPayServer.Rating\BTCPayServer.Rating.csproj", "{6DC77459-D52F-45EE-B3F3-315043D33A1B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BTCPayServer.Common", "BTCPayServer.Common\BTCPayServer.Common.csproj", "{4BE42370-6114-4176-BFB3-37C6B6DA094D}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@@ -49,6 +53,30 @@ Global
{B373F439-6E75-4A94-985D-10A0C7C500D0}.Release|x64.Build.0 = Release|Any CPU {B373F439-6E75-4A94-985D-10A0C7C500D0}.Release|x64.Build.0 = Release|Any CPU
{B373F439-6E75-4A94-985D-10A0C7C500D0}.Release|x86.ActiveCfg = Release|Any CPU {B373F439-6E75-4A94-985D-10A0C7C500D0}.Release|x86.ActiveCfg = Release|Any CPU
{B373F439-6E75-4A94-985D-10A0C7C500D0}.Release|x86.Build.0 = Release|Any CPU {B373F439-6E75-4A94-985D-10A0C7C500D0}.Release|x86.Build.0 = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|x64.ActiveCfg = Debug|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|x64.Build.0 = Debug|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|x86.ActiveCfg = Debug|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|x86.Build.0 = Debug|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|Any CPU.Build.0 = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|x64.ActiveCfg = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|x64.Build.0 = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|x86.ActiveCfg = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|x86.Build.0 = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|x64.ActiveCfg = Debug|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|x64.Build.0 = Debug|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|x86.ActiveCfg = Debug|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|x86.Build.0 = Debug|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|Any CPU.Build.0 = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|x64.ActiveCfg = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|x64.Build.0 = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|x86.ActiveCfg = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE