From a3cfb9e5e4e9198a8a83f3ed588dd8ef2cb0266b Mon Sep 17 00:00:00 2001 From: Nicolas Dorier Date: Fri, 30 Aug 2024 08:34:23 +0900 Subject: [PATCH] Removal of the Altcoins build (#6177) * Remove some useless #if ALTCOINS * Removal of the Altcoins build --- .../BTCPayServer.Client.csproj | 2 +- .../BTCPayServer.Common.csproj | 3 - BTCPayServer.Tests/BTCPayServer.Tests.csproj | 3 - BTCPayServer.Tests/BTCPayServerTester.cs | 20 +--- BTCPayServer.Tests/FastTests.cs | 5 +- BTCPayServer.Tests/ServerTester.cs | 13 +-- BTCPayServer.Tests/UnitTestBase.cs | 4 +- BTCPayServer.Tests/UtilitiesTests.cs | 2 +- .../docker-compose.altcoins.yml | 3 +- BTCPayServer.Tests/docker-compose.yml | 1 - BTCPayServer/BTCPayServer.csproj | 9 -- BTCPayServer/Components/MainNav/MainNav.cs | 3 - .../Components/MainNav/MainNavViewModel.cs | 1 - .../Configuration/DefaultConfiguration.cs | 4 +- .../Controllers/UIInvoiceController.UI.cs | 17 +-- .../Controllers/UIInvoiceController.cs | 5 +- .../UIStoresController.Dashboard.cs | 6 +- .../Controllers/UIWalletsController.cs | 2 - BTCPayServer/Extensions/MoneyExtensions.cs | 2 - BTCPayServer/Hosting/BTCPayServerServices.cs | 10 -- BTCPayServer/Payments/PaymentTypes.cs | 4 - .../Configuration/MoneroLikeConfiguration.cs | 2 - .../MoneroLikeOnChainPaymentMethodDetails.cs | 2 - .../Monero/Payments/MoneroLikePaymentData.cs | 2 - .../MoneroLikePaymentMethodHandler.cs | 2 - .../Payments/MoneroPaymentLinkExtension.cs | 2 - .../Payments/MoneroPaymentPromptDetails.cs | 2 - .../RPC/MoneroDaemonCallbackController.cs | 2 - .../Altcoins/Monero/RPC/MoneroEvent.cs | 2 - .../MoneroLikeSummaryUpdaterHostedService.cs | 2 - .../Monero/Services/MoneroListener.cs | 2 - .../Monero/Services/MoneroRPCProvider.cs | 2 - .../Services/MoneroSyncSummaryProvider.cs | 2 - .../Monero/UI/MoneroLikeStoreController.cs | 2 - .../Monero/UI/MoneroPaymentViewModel.cs | 2 - .../Configuration/ZcashLikeConfiguration.cs | 2 - .../Zcash/Payments/ZcashLikePaymentData.cs | 2 - .../Payments/ZcashLikePaymentMethodHandler.cs | 2 - .../Payments/ZcashPaymentLinkExtension.cs | 2 - .../Payments/ZcashPaymentMethodConfig.cs | 2 - .../Payments/ZcashPaymentPromptDetails.cs | 2 - .../RPC/ZcashDaemonCallbackController.cs | 2 - .../Services/Altcoins/Zcash/RPC/ZcashEvent.cs | 2 - .../ZcashLikeSummaryUpdaterHostedService.cs | 2 - .../Altcoins/Zcash/Services/ZcashListener.cs | 2 - .../Zcash/Services/ZcashRPCProvider.cs | 2 - .../Services/ZcashSyncSummaryProvider.cs | 2 - .../Zcash/UI/ZcashLikeStoreController.cs | 2 - .../Zcash/UI/ZcashPaymentViewModel.cs | 2 - .../Services/BTCPayServerEnvironment.cs | 8 -- BTCPayServer/Services/Cheater.cs | 3 +- .../Reporting/OnChainWalletReportProvider.cs | 8 +- Build/Common.csproj | 19 +--- btcpayserver.sln | 102 ------------------ 54 files changed, 23 insertions(+), 292 deletions(-) diff --git a/BTCPayServer.Client/BTCPayServer.Client.csproj b/BTCPayServer.Client/BTCPayServer.Client.csproj index e19700961..831d89474 100644 --- a/BTCPayServer.Client/BTCPayServer.Client.csproj +++ b/BTCPayServer.Client/BTCPayServer.Client.csproj @@ -12,7 +12,7 @@ MIT https://github.com/btcpayserver/btcpayserver git - Debug;Release;Altcoins-Debug;Altcoins-Release + Debug;Release AnyCPU diff --git a/BTCPayServer.Common/BTCPayServer.Common.csproj b/BTCPayServer.Common/BTCPayServer.Common.csproj index 3cdf1ac7a..e7f8a5130 100644 --- a/BTCPayServer.Common/BTCPayServer.Common.csproj +++ b/BTCPayServer.Common/BTCPayServer.Common.csproj @@ -7,9 +7,6 @@ - - - diff --git a/BTCPayServer.Tests/BTCPayServer.Tests.csproj b/BTCPayServer.Tests/BTCPayServer.Tests.csproj index 97255a70c..eb427b619 100644 --- a/BTCPayServer.Tests/BTCPayServer.Tests.csproj +++ b/BTCPayServer.Tests/BTCPayServer.Tests.csproj @@ -41,9 +41,6 @@ runtime; build; native; contentfiles; analyzers - - - Dockerfile diff --git a/BTCPayServer.Tests/BTCPayServerTester.cs b/BTCPayServer.Tests/BTCPayServerTester.cs index 31c7c6baa..faac5cd20 100644 --- a/BTCPayServer.Tests/BTCPayServerTester.cs +++ b/BTCPayServer.Tests/BTCPayServerTester.cs @@ -31,12 +31,6 @@ using AuthenticationSchemes = BTCPayServer.Abstractions.Constants.Authentication namespace BTCPayServer.Tests { - public enum TestDatabases - { - Postgres, - MySQL, - } - public class BTCPayServerTester : IDisposable { internal readonly string _Directory; @@ -69,11 +63,6 @@ namespace BTCPayServer.Tests set; } - public string MySQL - { - get; set; - } - public string Postgres { get; set; @@ -89,11 +78,6 @@ namespace BTCPayServer.Tests get; set; } - public TestDatabases TestDatabase - { - get; set; - } - public async Task RestartStartupTask() { var startupTask = GetService().GetServices() @@ -164,9 +148,7 @@ namespace BTCPayServer.Tests if (!string.IsNullOrEmpty(SSHConnection)) config.AppendLine($"sshconnection={SSHConnection}"); - if (TestDatabase == TestDatabases.MySQL && !String.IsNullOrEmpty(MySQL)) - config.AppendLine($"mysql=" + MySQL); - else if (!String.IsNullOrEmpty(Postgres)) + if (!String.IsNullOrEmpty(Postgres)) config.AppendLine($"postgres=" + Postgres); if (!string.IsNullOrEmpty(ExplorerPostgres)) diff --git a/BTCPayServer.Tests/FastTests.cs b/BTCPayServer.Tests/FastTests.cs index 76f21e51a..d6122b532 100644 --- a/BTCPayServer.Tests/FastTests.cs +++ b/BTCPayServer.Tests/FastTests.cs @@ -250,12 +250,10 @@ namespace BTCPayServer.Tests Assert.Equal(id, id1); Assert.Equal(id, id2); Assert.Equal("LTC-LN", id.ToString()); -#if ALTCOINS id = PaymentMethodId.Parse("XMR"); id1 = PaymentMethodId.Parse("XMR-MoneroLike"); Assert.Equal(id, id1); Assert.Equal("XMR-CHAIN", id.ToString()); -#endif } [Fact] @@ -487,7 +485,7 @@ namespace BTCPayServer.Tests #pragma warning restore CS0618 } -#if ALTCOINS + [Fact] public void CanCalculateCryptoDue() { @@ -658,7 +656,6 @@ namespace BTCPayServer.Tests Assert.Equal(accounting.Paid, accounting.TotalDue); #pragma warning restore CS0618 } -#endif [Fact] public void DeterministicUTXOSorter() diff --git a/BTCPayServer.Tests/ServerTester.cs b/BTCPayServer.Tests/ServerTester.cs index 7d045a86a..46aaf21f9 100644 --- a/BTCPayServer.Tests/ServerTester.cs +++ b/BTCPayServer.Tests/ServerTester.cs @@ -51,19 +51,16 @@ namespace BTCPayServer.Tests PayTester = new BTCPayServerTester(TestLogs, LoggerProvider, Path.Combine(_Directory, "pay")) { NBXplorerUri = ExplorerClient.Address, - TestDatabase = Enum.Parse(GetEnvironment("TESTS_DB", TestDatabases.Postgres.ToString()), true), // TODO: The fact that we use same conn string as development database can cause huge problems with tests // since in dev we already can have some users / stores registered, while on CI database is being initalized // for the first time and first registered user gets admin status by default Postgres = GetEnvironment("TESTS_POSTGRES", DefaultConnectionString), ExplorerPostgres = GetEnvironment("TESTS_EXPLORER_POSTGRES", "User ID=postgres;Include Error Detail=true;Host=127.0.0.1;Port=39372;Database=nbxplorer"), - MySQL = GetEnvironment("TESTS_MYSQL", "User ID=root;Host=127.0.0.1;Port=33036;Database=btcpayserver") }; if (newDb) { var r = RandomUtils.GetUInt32(); PayTester.Postgres = PayTester.Postgres.Replace("btcpayserver", $"btcpayserver{r}"); - PayTester.MySQL = PayTester.MySQL.Replace("btcpayserver", $"btcpayserver{r}"); TestLogs.LogInformation($"Database used: btcpayserver{r}"); } PayTester.Port = int.Parse(GetEnvironment("TESTS_PORT", Utils.FreeTcpPort().ToString(CultureInfo.InvariantCulture)), CultureInfo.InvariantCulture); @@ -86,7 +83,7 @@ namespace BTCPayServer.Tests File.Copy(file, Path.Combine(langdir, Path.GetFileName(file))); } -#if ALTCOINS + public void ActivateLTC() { LTCExplorerNode = new RPCClient(RPCCredentialString.Parse(GetEnvironment("TESTS_LTCRPCCONNECTION", "server=http://127.0.0.1:43783;ceiwHEbqWI83:DwubwWsoo3")), NetworkProvider.GetNetwork("LTC").NBitcoinNetwork); @@ -101,12 +98,7 @@ namespace BTCPayServer.Tests PayTester.Chains.Add("LBTC"); PayTester.LBTCNBXplorerUri = LBTCExplorerClient.Address; } - public void ActivateETH() - { - PayTester.Chains.Add("ETH"); - } -#endif public void ActivateLightning() { ActivateLightning(LightningConnectionType.CLightning); @@ -240,7 +232,7 @@ namespace BTCPayServer.Tests { get; set; } -#if ALTCOINS + public RPCClient LTCExplorerNode { get; set; @@ -249,7 +241,6 @@ namespace BTCPayServer.Tests public RPCClient LBTCExplorerNode { get; set; } public ExplorerClient LTCExplorerClient { get; set; } public ExplorerClient LBTCExplorerClient { get; set; } -#endif public ExplorerClient ExplorerClient { diff --git a/BTCPayServer.Tests/UnitTestBase.cs b/BTCPayServer.Tests/UnitTestBase.cs index 20ed9fa37..fe63547a3 100644 --- a/BTCPayServer.Tests/UnitTestBase.cs +++ b/BTCPayServer.Tests/UnitTestBase.cs @@ -63,9 +63,9 @@ namespace BTCPayServer.Tests var bootstrap = Startup.CreateBootstrap(conf); var services = new PluginServiceCollection(new ServiceCollection(), bootstrap); var plugins = new List() { new BitcoinPlugin() }; -#if ALTCOINS + plugins.Add(new BTCPayServer.Plugins.Altcoins.AltcoinsPlugin()); -#endif + foreach (var p in plugins) { p.Execute(services); diff --git a/BTCPayServer.Tests/UtilitiesTests.cs b/BTCPayServer.Tests/UtilitiesTests.cs index 543809a02..082de12fe 100644 --- a/BTCPayServer.Tests/UtilitiesTests.cs +++ b/BTCPayServer.Tests/UtilitiesTests.cs @@ -321,7 +321,7 @@ retry: base.VisitTagHelper(node); } - private string ToString(IntermediateNode? node) + private string ToString(IntermediateNode node) { return _txt.Substring(node.Source.Value.AbsoluteIndex, node.Source.Value.Length); } diff --git a/BTCPayServer.Tests/docker-compose.altcoins.yml b/BTCPayServer.Tests/docker-compose.altcoins.yml index 54805adda..cc5123238 100644 --- a/BTCPayServer.Tests/docker-compose.altcoins.yml +++ b/BTCPayServer.Tests/docker-compose.altcoins.yml @@ -10,14 +10,13 @@ services: context: .. dockerfile: BTCPayServer.Tests/Dockerfile args: - CONFIGURATION_NAME: Altcoins-Release + CONFIGURATION_NAME: Release environment: TESTS_EXPERIMENTALV2_CONFIRM: "true" TESTS_BTCRPCCONNECTION: server=http://bitcoind:43782;ceiwHEbqWI83:DwubwWsoo3 TESTS_LTCRPCCONNECTION: server=http://litecoind:43782;ceiwHEbqWI83:DwubwWsoo3 TESTS_BTCNBXPLORERURL: http://nbxplorer:32838/ TESTS_LTCNBXPLORERURL: http://nbxplorer:32838/ - TESTS_DB: "Postgres" TESTS_POSTGRES: User ID=postgres;Include Error Detail=true;Host=postgres;Port=5432;Database=btcpayserver TESTS_EXPLORER_POSTGRES: User ID=postgres;Include Error Detail=true;Host=postgres;Port=5432;Database=nbxplorer TESTS_HOSTNAME: tests diff --git a/BTCPayServer.Tests/docker-compose.yml b/BTCPayServer.Tests/docker-compose.yml index 57ed0229a..a82b8af91 100644 --- a/BTCPayServer.Tests/docker-compose.yml +++ b/BTCPayServer.Tests/docker-compose.yml @@ -15,7 +15,6 @@ services: TESTS_EXPERIMENTALV2_CONFIRM: "true" TESTS_BTCRPCCONNECTION: server=http://bitcoind:43782;ceiwHEbqWI83:DwubwWsoo3 TESTS_BTCNBXPLORERURL: http://nbxplorer:32838/ - TESTS_DB: "Postgres" TESTS_POSTGRES: User ID=postgres;Include Error Detail=true;Host=postgres;Port=5432;Database=btcpayserver TESTS_EXPLORER_POSTGRES: User ID=postgres;Include Error Detail=true;Host=postgres;Port=5432;Database=nbxplorer TESTS_HOSTNAME: tests diff --git a/BTCPayServer/BTCPayServer.csproj b/BTCPayServer/BTCPayServer.csproj index 6fd1ad5ed..0c53dc495 100644 --- a/BTCPayServer/BTCPayServer.csproj +++ b/BTCPayServer/BTCPayServer.csproj @@ -36,15 +36,6 @@ - - - - - - - - - diff --git a/BTCPayServer/Components/MainNav/MainNav.cs b/BTCPayServer/Components/MainNav/MainNav.cs index 1ebb1e99d..e04bfc036 100644 --- a/BTCPayServer/Components/MainNav/MainNav.cs +++ b/BTCPayServer/Components/MainNav/MainNav.cs @@ -66,9 +66,6 @@ namespace BTCPayServer.Components.MainNav Store = store, ContactUrl = serverSettings.ContactUrl }; -#if ALTCOINS - vm.AltcoinsBuild = true; -#endif if (store != null) { var storeBlob = store.GetStoreBlob(); diff --git a/BTCPayServer/Components/MainNav/MainNavViewModel.cs b/BTCPayServer/Components/MainNav/MainNavViewModel.cs index ec0c25e5b..d5083d117 100644 --- a/BTCPayServer/Components/MainNav/MainNavViewModel.cs +++ b/BTCPayServer/Components/MainNav/MainNavViewModel.cs @@ -10,7 +10,6 @@ namespace BTCPayServer.Components.MainNav public List DerivationSchemes { get; set; } public List LightningNodes { get; set; } public List Apps { get; set; } - public bool AltcoinsBuild { get; set; } public int ArchivedAppsCount { get; set; } public string ContactUrl { get; set; } public string UserName { get; set; } diff --git a/BTCPayServer/Configuration/DefaultConfiguration.cs b/BTCPayServer/Configuration/DefaultConfiguration.cs index f7bef2382..e1c724493 100644 --- a/BTCPayServer/Configuration/DefaultConfiguration.cs +++ b/BTCPayServer/Configuration/DefaultConfiguration.cs @@ -163,10 +163,10 @@ namespace BTCPayServer.Configuration var services = new PluginServiceCollection(collection, Startup.CreateBootstrap(conf)); var p1 = new BitcoinPlugin(); p1.Execute(services); -#if ALTCOINS + var p2 = new Plugins.Altcoins.AltcoinsPlugin(); p2.Execute(services); -#endif + services.AddSingleton(services.BootstrapServices.GetRequiredService()); services.AddSingleton(services.BootstrapServices.GetRequiredService()); services.AddSingleton(services.BootstrapServices.GetRequiredService()); diff --git a/BTCPayServer/Controllers/UIInvoiceController.UI.cs b/BTCPayServer/Controllers/UIInvoiceController.UI.cs index f535c2605..1182083ee 100644 --- a/BTCPayServer/Controllers/UIInvoiceController.UI.cs +++ b/BTCPayServer/Controllers/UIInvoiceController.UI.cs @@ -858,11 +858,6 @@ namespace BTCPayServer.Controllers Request.Host, Request.PathBase) : null; - var isAltcoinsBuild = false; -#if ALTCOINS - isAltcoinsBuild = true; -#endif - var orderId = invoice.Metadata.OrderId; var supportUrl = !string.IsNullOrEmpty(storeBlob.StoreSupportUrl) ? storeBlob.StoreSupportUrl @@ -870,11 +865,6 @@ namespace BTCPayServer.Controllers .Replace("{InvoiceId}", Uri.EscapeDataString(invoice.Id)) : null; - string GetPaymentMethodName(PaymentMethodId paymentMethodId) - { - _paymentModelExtensions.TryGetValue(paymentMethodId, out var extension); - return extension?.DisplayName ?? paymentMethodId.ToString(); - } string GetPaymentMethodImage(PaymentMethodId paymentMethodId) { _paymentModelExtensions.TryGetValue(paymentMethodId, out var extension); @@ -883,7 +873,7 @@ namespace BTCPayServer.Controllers var model = new PaymentModel { Activated = prompt.Activated, - PaymentMethodName = GetPaymentMethodName(paymentMethodId), + PaymentMethodName = _prettyName.PrettyName(paymentMethodId), CryptoCode = prompt.Currency, RootPath = Request.PathBase.Value.WithTrailingSlash(), OrderId = orderId, @@ -939,15 +929,12 @@ namespace BTCPayServer.Controllers .Select(kv => { var handler = _handlers[kv.PaymentMethodId]; - var pmName = GetPaymentMethodName(kv.PaymentMethodId); return new PaymentModel.AvailableCrypto { Displayed = displayedPaymentMethods.Contains(kv.PaymentMethodId), PaymentMethodId = kv.PaymentMethodId.ToString(), CryptoCode = kv.Currency, - PaymentMethodName = isAltcoinsBuild - ? pmName - : pmName.Replace("Bitcoin (", "").Replace(")", "").Replace("Lightning ", ""), + PaymentMethodName = _prettyName.PrettyName(kv.PaymentMethodId), IsLightning = handler is ILightningPaymentHandler, CryptoImage = Request.GetRelativePathOrAbsolute(GetPaymentMethodImage(kv.PaymentMethodId)), Link = Url.Action(nameof(Checkout), diff --git a/BTCPayServer/Controllers/UIInvoiceController.cs b/BTCPayServer/Controllers/UIInvoiceController.cs index 5934fea90..3793800d8 100644 --- a/BTCPayServer/Controllers/UIInvoiceController.cs +++ b/BTCPayServer/Controllers/UIInvoiceController.cs @@ -64,6 +64,7 @@ namespace BTCPayServer.Controllers private readonly TransactionLinkProviders _transactionLinkProviders; private readonly Dictionary _paymentModelExtensions; private readonly PaymentMethodViewProvider _viewProvider; + private readonly PrettyNameProvider _prettyName; private readonly AppService _appService; private readonly IFileService _fileService; private readonly UriResolver _uriResolver; @@ -98,7 +99,8 @@ namespace BTCPayServer.Controllers IAuthorizationService authorizationService, TransactionLinkProviders transactionLinkProviders, Dictionary paymentModelExtensions, - PaymentMethodViewProvider viewProvider) + PaymentMethodViewProvider viewProvider, + PrettyNameProvider prettyName) { _displayFormatter = displayFormatter; _CurrencyNameTable = currencyNameTable ?? throw new ArgumentNullException(nameof(currencyNameTable)); @@ -123,6 +125,7 @@ namespace BTCPayServer.Controllers _transactionLinkProviders = transactionLinkProviders; _paymentModelExtensions = paymentModelExtensions; _viewProvider = viewProvider; + _prettyName = prettyName; _fileService = fileService; _uriResolver = uriResolver; _defaultRules = defaultRules; diff --git a/BTCPayServer/Controllers/UIStoresController.Dashboard.cs b/BTCPayServer/Controllers/UIStoresController.Dashboard.cs index bb1d5b8f4..5d1ece628 100644 --- a/BTCPayServer/Controllers/UIStoresController.Dashboard.cs +++ b/BTCPayServer/Controllers/UIStoresController.Dashboard.cs @@ -141,7 +141,6 @@ public partial class UIStoresController { var strategy = derivationByCryptoCode.TryGet(network.CryptoCode); var value = strategy?.ToPrettyString() ?? string.Empty; - derivationSchemes.Add(new StoreDerivationScheme { Crypto = network.CryptoCode, @@ -150,9 +149,8 @@ public partial class UIStoresController Value = value, WalletId = new WalletId(store.Id, network.CryptoCode), Enabled = !excludeFilters.Match(handler.PaymentMethodId) && strategy != null, -#if ALTCOINS - Collapsed = network is Plugins.Altcoins.ElementsBTCPayNetwork elementsBTCPayNetwork && elementsBTCPayNetwork.NetworkCryptoCode != elementsBTCPayNetwork.CryptoCode && string.IsNullOrEmpty(value) -#endif + Collapsed = network is Plugins.Altcoins.ElementsBTCPayNetwork { IsNativeAsset : false } && string.IsNullOrEmpty(value) + }); } else if (handler is LightningLikePaymentHandler) diff --git a/BTCPayServer/Controllers/UIWalletsController.cs b/BTCPayServer/Controllers/UIWalletsController.cs index 51b774e78..73c2b20f9 100644 --- a/BTCPayServer/Controllers/UIWalletsController.cs +++ b/BTCPayServer/Controllers/UIWalletsController.cs @@ -401,12 +401,10 @@ namespace BTCPayServer.Controllers { var c = this.ExplorerClientProvider.GetExplorerClient(walletId.CryptoCode); var cashCow = cheater.GetCashCow(walletId.CryptoCode); -#if ALTCOINS if (walletId.CryptoCode == "LBTC") { await cashCow.SendCommandAsync("rescanblockchain"); } -#endif var addresses = Enumerable.Range(0, 200).Select(_ => c.GetUnusedAsync(paymentMethod.AccountDerivation, DerivationFeature.Deposit, reserve: true)).ToArray(); await Task.WhenAll(addresses); diff --git a/BTCPayServer/Extensions/MoneyExtensions.cs b/BTCPayServer/Extensions/MoneyExtensions.cs index 28c2265e5..87ce62dac 100644 --- a/BTCPayServer/Extensions/MoneyExtensions.cs +++ b/BTCPayServer/Extensions/MoneyExtensions.cs @@ -18,7 +18,6 @@ namespace BTCPayServer return money.ToDecimal(MoneyUnit.BTC); case MoneyBag mb: return mb.Select(money => money.GetValue(network)).Sum(); -#if ALTCOINS case AssetMoney assetMoney: if (network is BTCPayServer.Plugins.Altcoins.ElementsBTCPayNetwork elementsBTCPayNetwork) { @@ -27,7 +26,6 @@ namespace BTCPayServer : 0; } throw new NotSupportedException("IMoney type not supported"); -#endif default: throw new NotSupportedException("IMoney type not supported"); } diff --git a/BTCPayServer/Hosting/BTCPayServerServices.cs b/BTCPayServer/Hosting/BTCPayServerServices.cs index 586898c4e..d9d454224 100644 --- a/BTCPayServer/Hosting/BTCPayServerServices.cs +++ b/BTCPayServer/Hosting/BTCPayServerServices.cs @@ -71,19 +71,9 @@ using BTCPayServer.Payments.LNURLPay; using System.Collections.Generic; using BTCPayServer.Payouts; using ExchangeSharp; - - - - - using Microsoft.Extensions.Localization; using Microsoft.AspNetCore.Mvc.Localization; - -#if ALTCOINS -using BTCPayServer.Services.Altcoins.Monero; -using BTCPayServer.Services.Altcoins.Zcash; -#endif namespace BTCPayServer.Hosting { public static class BTCPayServerServices diff --git a/BTCPayServer/Payments/PaymentTypes.cs b/BTCPayServer/Payments/PaymentTypes.cs index 8b57425c4..d6e270d23 100644 --- a/BTCPayServer/Payments/PaymentTypes.cs +++ b/BTCPayServer/Payments/PaymentTypes.cs @@ -1,8 +1,4 @@ #nullable enable -#if ALTCOINS -using BTCPayServer.Services.Altcoins.Monero.Payments; -using BTCPayServer.Services.Altcoins.Zcash.Payments; -#endif namespace BTCPayServer.Payments { diff --git a/BTCPayServer/Services/Altcoins/Monero/Configuration/MoneroLikeConfiguration.cs b/BTCPayServer/Services/Altcoins/Monero/Configuration/MoneroLikeConfiguration.cs index b8cd4c4bc..c99002abe 100644 --- a/BTCPayServer/Services/Altcoins/Monero/Configuration/MoneroLikeConfiguration.cs +++ b/BTCPayServer/Services/Altcoins/Monero/Configuration/MoneroLikeConfiguration.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System; using System.Collections.Generic; @@ -19,4 +18,3 @@ namespace BTCPayServer.Services.Altcoins.Monero.Configuration public string Password { get; set; } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroLikeOnChainPaymentMethodDetails.cs b/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroLikeOnChainPaymentMethodDetails.cs index 064ce6c62..a0d29ec23 100644 --- a/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroLikeOnChainPaymentMethodDetails.cs +++ b/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroLikeOnChainPaymentMethodDetails.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using BTCPayServer.Payments; namespace BTCPayServer.Services.Altcoins.Monero.Payments @@ -10,4 +9,3 @@ namespace BTCPayServer.Services.Altcoins.Monero.Payments public long? InvoiceSettledConfirmationThreshold { get; set; } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroLikePaymentData.cs b/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroLikePaymentData.cs index 9456cc625..8c81fb03c 100644 --- a/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroLikePaymentData.cs +++ b/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroLikePaymentData.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using BTCPayServer.Client.Models; using BTCPayServer.Payments; using BTCPayServer.Plugins.Altcoins; @@ -23,4 +22,3 @@ namespace BTCPayServer.Services.Altcoins.Monero.Payments } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroLikePaymentMethodHandler.cs b/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroLikePaymentMethodHandler.cs index 6e824c20e..aa4705b61 100644 --- a/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroLikePaymentMethodHandler.cs +++ b/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroLikePaymentMethodHandler.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System; using System.Collections.Generic; using System.Globalization; @@ -129,4 +128,3 @@ namespace BTCPayServer.Services.Altcoins.Monero.Payments } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroPaymentLinkExtension.cs b/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroPaymentLinkExtension.cs index 32e087423..88a3718df 100644 --- a/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroPaymentLinkExtension.cs +++ b/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroPaymentLinkExtension.cs @@ -1,4 +1,3 @@ -#if ALTCOINS #nullable enable using System.Globalization; using BTCPayServer.Payments; @@ -26,4 +25,3 @@ namespace BTCPayServer.Services.Altcoins.Monero.Payments } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroPaymentPromptDetails.cs b/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroPaymentPromptDetails.cs index 7624896cd..7e7212b91 100644 --- a/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroPaymentPromptDetails.cs +++ b/BTCPayServer/Services/Altcoins/Monero/Payments/MoneroPaymentPromptDetails.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using BTCPayServer.Payments; using Newtonsoft.Json; @@ -10,4 +9,3 @@ namespace BTCPayServer.Services.Altcoins.Monero.Payments public long? InvoiceSettledConfirmationThreshold { get; set; } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Monero/RPC/MoneroDaemonCallbackController.cs b/BTCPayServer/Services/Altcoins/Monero/RPC/MoneroDaemonCallbackController.cs index f812bcfd8..9db2d24e3 100644 --- a/BTCPayServer/Services/Altcoins/Monero/RPC/MoneroDaemonCallbackController.cs +++ b/BTCPayServer/Services/Altcoins/Monero/RPC/MoneroDaemonCallbackController.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using BTCPayServer.Filters; using Microsoft.AspNetCore.Mvc; @@ -37,4 +36,3 @@ namespace BTCPayServer.Services.Altcoins.Monero.RPC } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Monero/RPC/MoneroEvent.cs b/BTCPayServer/Services/Altcoins/Monero/RPC/MoneroEvent.cs index 77250b4ab..4821730ec 100644 --- a/BTCPayServer/Services/Altcoins/Monero/RPC/MoneroEvent.cs +++ b/BTCPayServer/Services/Altcoins/Monero/RPC/MoneroEvent.cs @@ -1,4 +1,3 @@ -#if ALTCOINS namespace BTCPayServer.Services.Altcoins.Monero.RPC { public class MoneroEvent @@ -14,4 +13,3 @@ namespace BTCPayServer.Services.Altcoins.Monero.RPC } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Monero/Services/MoneroLikeSummaryUpdaterHostedService.cs b/BTCPayServer/Services/Altcoins/Monero/Services/MoneroLikeSummaryUpdaterHostedService.cs index f0cc18fbf..0aeff2c58 100644 --- a/BTCPayServer/Services/Altcoins/Monero/Services/MoneroLikeSummaryUpdaterHostedService.cs +++ b/BTCPayServer/Services/Altcoins/Monero/Services/MoneroLikeSummaryUpdaterHostedService.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System; using System.Threading; using System.Threading.Tasks; @@ -69,4 +68,3 @@ namespace BTCPayServer.Services.Altcoins.Monero.Services } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Monero/Services/MoneroListener.cs b/BTCPayServer/Services/Altcoins/Monero/Services/MoneroListener.cs index aff07a2ae..d52ad2d4a 100644 --- a/BTCPayServer/Services/Altcoins/Monero/Services/MoneroListener.cs +++ b/BTCPayServer/Services/Altcoins/Monero/Services/MoneroListener.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -409,4 +408,3 @@ namespace BTCPayServer.Services.Altcoins.Monero.Services } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Monero/Services/MoneroRPCProvider.cs b/BTCPayServer/Services/Altcoins/Monero/Services/MoneroRPCProvider.cs index f016951a4..72a81bf9f 100644 --- a/BTCPayServer/Services/Altcoins/Monero/Services/MoneroRPCProvider.cs +++ b/BTCPayServer/Services/Altcoins/Monero/Services/MoneroRPCProvider.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System; using System.Collections.Concurrent; using System.Collections.Immutable; @@ -117,4 +116,3 @@ namespace BTCPayServer.Services.Altcoins.Monero.Services } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Monero/Services/MoneroSyncSummaryProvider.cs b/BTCPayServer/Services/Altcoins/Monero/Services/MoneroSyncSummaryProvider.cs index 0af5ba3dc..7a5f88892 100644 --- a/BTCPayServer/Services/Altcoins/Monero/Services/MoneroSyncSummaryProvider.cs +++ b/BTCPayServer/Services/Altcoins/Monero/Services/MoneroSyncSummaryProvider.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System.Collections.Generic; using System.Linq; using BTCPayServer.Abstractions.Contracts; @@ -43,4 +42,3 @@ namespace BTCPayServer.Services.Altcoins.Monero.Services public MoneroRPCProvider.MoneroLikeSummary Summary { get; set; } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Monero/UI/MoneroLikeStoreController.cs b/BTCPayServer/Services/Altcoins/Monero/UI/MoneroLikeStoreController.cs index decdfa6c1..1d66d4fa3 100644 --- a/BTCPayServer/Services/Altcoins/Monero/UI/MoneroLikeStoreController.cs +++ b/BTCPayServer/Services/Altcoins/Monero/UI/MoneroLikeStoreController.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -393,4 +392,3 @@ namespace BTCPayServer.Services.Altcoins.Monero.UI } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Monero/UI/MoneroPaymentViewModel.cs b/BTCPayServer/Services/Altcoins/Monero/UI/MoneroPaymentViewModel.cs index 8ef7efbdc..5b1f0ac82 100644 --- a/BTCPayServer/Services/Altcoins/Monero/UI/MoneroPaymentViewModel.cs +++ b/BTCPayServer/Services/Altcoins/Monero/UI/MoneroPaymentViewModel.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System; namespace BTCPayServer.Services.Altcoins.Monero.UI @@ -14,4 +13,3 @@ namespace BTCPayServer.Services.Altcoins.Monero.UI public string TransactionLink { get; set; } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Zcash/Configuration/ZcashLikeConfiguration.cs b/BTCPayServer/Services/Altcoins/Zcash/Configuration/ZcashLikeConfiguration.cs index 8c03a0b12..3d223c02b 100644 --- a/BTCPayServer/Services/Altcoins/Zcash/Configuration/ZcashLikeConfiguration.cs +++ b/BTCPayServer/Services/Altcoins/Zcash/Configuration/ZcashLikeConfiguration.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System; using System.Collections.Generic; @@ -17,4 +16,3 @@ namespace BTCPayServer.Services.Altcoins.Zcash.Configuration public string WalletDirectory { get; set; } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashLikePaymentData.cs b/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashLikePaymentData.cs index 8d5301c3d..3e199d801 100644 --- a/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashLikePaymentData.cs +++ b/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashLikePaymentData.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using BTCPayServer.Client.Models; using BTCPayServer.Payments; using BTCPayServer.Plugins.Altcoins; @@ -20,4 +19,3 @@ namespace BTCPayServer.Services.Altcoins.Zcash.Payments } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashLikePaymentMethodHandler.cs b/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashLikePaymentMethodHandler.cs index 720849eea..623a67d53 100644 --- a/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashLikePaymentMethodHandler.cs +++ b/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashLikePaymentMethodHandler.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System; using System.Collections.Generic; using System.Globalization; @@ -123,4 +122,3 @@ namespace BTCPayServer.Services.Altcoins.Zcash.Payments } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashPaymentLinkExtension.cs b/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashPaymentLinkExtension.cs index 8ba2f45ac..27b9f3d5e 100644 --- a/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashPaymentLinkExtension.cs +++ b/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashPaymentLinkExtension.cs @@ -1,4 +1,3 @@ -#if ALTCOINS #nullable enable using System.Globalization; using BTCPayServer.Payments; @@ -26,4 +25,3 @@ namespace BTCPayServer.Services.Altcoins.Zcash.Payments } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashPaymentMethodConfig.cs b/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashPaymentMethodConfig.cs index 7e692f4bc..9b83b15c4 100644 --- a/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashPaymentMethodConfig.cs +++ b/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashPaymentMethodConfig.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using BTCPayServer.Payments; using Newtonsoft.Json; @@ -9,4 +8,3 @@ namespace BTCPayServer.Services.Altcoins.Zcash.Payments public long AccountIndex { get; set; } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashPaymentPromptDetails.cs b/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashPaymentPromptDetails.cs index ed133f42f..c4bfa73b9 100644 --- a/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashPaymentPromptDetails.cs +++ b/BTCPayServer/Services/Altcoins/Zcash/Payments/ZcashPaymentPromptDetails.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using BTCPayServer.Payments; namespace BTCPayServer.Services.Altcoins.Zcash.Payments @@ -10,4 +9,3 @@ namespace BTCPayServer.Services.Altcoins.Zcash.Payments public string DepositAddress { get; set; } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Zcash/RPC/ZcashDaemonCallbackController.cs b/BTCPayServer/Services/Altcoins/Zcash/RPC/ZcashDaemonCallbackController.cs index 15fa861b7..d191b9f3c 100644 --- a/BTCPayServer/Services/Altcoins/Zcash/RPC/ZcashDaemonCallbackController.cs +++ b/BTCPayServer/Services/Altcoins/Zcash/RPC/ZcashDaemonCallbackController.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using BTCPayServer.Filters; using Microsoft.AspNetCore.Mvc; @@ -37,4 +36,3 @@ namespace BTCPayServer.Services.Altcoins.Zcash.RPC } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Zcash/RPC/ZcashEvent.cs b/BTCPayServer/Services/Altcoins/Zcash/RPC/ZcashEvent.cs index ca06dde76..486e9d542 100644 --- a/BTCPayServer/Services/Altcoins/Zcash/RPC/ZcashEvent.cs +++ b/BTCPayServer/Services/Altcoins/Zcash/RPC/ZcashEvent.cs @@ -1,4 +1,3 @@ -#if ALTCOINS namespace BTCPayServer.Services.Altcoins.Zcash.RPC { public class ZcashEvent @@ -14,4 +13,3 @@ namespace BTCPayServer.Services.Altcoins.Zcash.RPC } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashLikeSummaryUpdaterHostedService.cs b/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashLikeSummaryUpdaterHostedService.cs index 9a4590319..274dff203 100644 --- a/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashLikeSummaryUpdaterHostedService.cs +++ b/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashLikeSummaryUpdaterHostedService.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System; using System.Threading; using System.Threading.Tasks; @@ -70,4 +69,3 @@ namespace BTCPayServer.Services.Altcoins.Zcash.Services } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashListener.cs b/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashListener.cs index 8904b3f14..04bc3cbb0 100644 --- a/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashListener.cs +++ b/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashListener.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -397,4 +396,3 @@ namespace BTCPayServer.Services.Altcoins.Zcash.Services } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashRPCProvider.cs b/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashRPCProvider.cs index a9c2c0183..82e2cb6e5 100644 --- a/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashRPCProvider.cs +++ b/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashRPCProvider.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System; using System.Collections.Concurrent; using System.Collections.Immutable; @@ -122,4 +121,3 @@ namespace BTCPayServer.Services.Altcoins.Zcash.Services } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashSyncSummaryProvider.cs b/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashSyncSummaryProvider.cs index 1328db180..c943bbfe9 100644 --- a/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashSyncSummaryProvider.cs +++ b/BTCPayServer/Services/Altcoins/Zcash/Services/ZcashSyncSummaryProvider.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System.Collections.Generic; using System.Linq; using BTCPayServer.Abstractions.Contracts; @@ -43,4 +42,3 @@ namespace BTCPayServer.Services.Altcoins.Zcash.Services public ZcashRPCProvider.ZcashLikeSummary Summary { get; set; } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Zcash/UI/ZcashLikeStoreController.cs b/BTCPayServer/Services/Altcoins/Zcash/UI/ZcashLikeStoreController.cs index 7541ecabe..eb628630e 100644 --- a/BTCPayServer/Services/Altcoins/Zcash/UI/ZcashLikeStoreController.cs +++ b/BTCPayServer/Services/Altcoins/Zcash/UI/ZcashLikeStoreController.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -308,4 +307,3 @@ namespace BTCPayServer.Services.Altcoins.Zcash.UI } } } -#endif diff --git a/BTCPayServer/Services/Altcoins/Zcash/UI/ZcashPaymentViewModel.cs b/BTCPayServer/Services/Altcoins/Zcash/UI/ZcashPaymentViewModel.cs index 7c32c04ce..eb692e58f 100644 --- a/BTCPayServer/Services/Altcoins/Zcash/UI/ZcashPaymentViewModel.cs +++ b/BTCPayServer/Services/Altcoins/Zcash/UI/ZcashPaymentViewModel.cs @@ -1,4 +1,3 @@ -#if ALTCOINS using System; namespace BTCPayServer.Services.Altcoins.Zcash.UI @@ -14,4 +13,3 @@ namespace BTCPayServer.Services.Altcoins.Zcash.UI public string TransactionLink { get; set; } } } -#endif diff --git a/BTCPayServer/Services/BTCPayServerEnvironment.cs b/BTCPayServer/Services/BTCPayServerEnvironment.cs index 791683670..9f55b38e9 100644 --- a/BTCPayServer/Services/BTCPayServerEnvironment.cs +++ b/BTCPayServer/Services/BTCPayServerEnvironment.cs @@ -25,11 +25,6 @@ namespace BTCPayServer.Services #else Build = "Release"; #endif -#if ALTCOINS - AltcoinsVersion = true; -#else - AltcoinsVersion = false; -#endif Environment = env; NetworkType = provider.NetworkType; @@ -60,7 +55,6 @@ namespace BTCPayServer.Services { get; set; } - public bool AltcoinsVersion { get; set; } public bool IsDeveloping { @@ -86,8 +80,6 @@ namespace BTCPayServer.Services txt.Append(CultureInfo.InvariantCulture, $"© BTCPay Server v{Version}"); if (Commit != null) txt.Append($"+{Commit}"); - if (AltcoinsVersion) - txt.Append(" (Altcoins)"); if (!Environment.IsProduction() || !Build.Equals("Release", StringComparison.OrdinalIgnoreCase)) { txt.Append(CultureInfo.InvariantCulture, $" Environment: {Environment.EnvironmentName} ({Build})"); diff --git a/BTCPayServer/Services/Cheater.cs b/BTCPayServer/Services/Cheater.cs index be4504634..205849c5e 100644 --- a/BTCPayServer/Services/Cheater.cs +++ b/BTCPayServer/Services/Cheater.cs @@ -34,7 +34,6 @@ namespace BTCPayServer.Services async Task IHostedService.StartAsync(CancellationToken cancellationToken) { -#if ALTCOINS var liquid = _prov.GetNetwork("LBTC"); if (liquid is not null) { @@ -56,7 +55,7 @@ namespace BTCPayServer.Services } } } -#endif + await Task.WhenAll(_prov.GetAll().Select(o => o.Item2.RPCClient.ScanRPCCapabilitiesAsync())); } diff --git a/BTCPayServer/Services/Reporting/OnChainWalletReportProvider.cs b/BTCPayServer/Services/Reporting/OnChainWalletReportProvider.cs index 885ee2da8..1a5ce361a 100644 --- a/BTCPayServer/Services/Reporting/OnChainWalletReportProvider.cs +++ b/BTCPayServer/Services/Reporting/OnChainWalletReportProvider.cs @@ -123,14 +123,8 @@ public class OnChainWalletReportProvider : ReportProvider private string? GetAssetId(BTCPayNetwork network) { -#if ALTCOINS if (network is Plugins.Altcoins.ElementsBTCPayNetwork elNetwork) - { - if (elNetwork.CryptoCode == elNetwork.NetworkCryptoCode) - return ""; - return elNetwork.AssetId.ToString(); - } -#endif + return elNetwork.IsNativeAsset ? "" : elNetwork.AssetId.ToString(); return null; } } diff --git a/Build/Common.csproj b/Build/Common.csproj index a8ad37a86..d3a4bf8b1 100644 --- a/Build/Common.csproj +++ b/Build/Common.csproj @@ -9,26 +9,11 @@ - Debug;Release;Altcoins-Release;Altcoins-Debug + Debug;Release AnyCPU - - - true - true - - - $(DefineConstants);DEBUG - true - - - - + false - - - $(DefineConstants);ALTCOINS - diff --git a/btcpayserver.sln b/btcpayserver.sln index b4c3f6030..b7d014ad6 100644 --- a/btcpayserver.sln +++ b/btcpayserver.sln @@ -34,12 +34,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BTCPayServer.PluginPacker", EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Altcoins-Debug|Any CPU = Altcoins-Debug|Any CPU - Altcoins-Debug|x64 = Altcoins-Debug|x64 - Altcoins-Debug|x86 = Altcoins-Debug|x86 - Altcoins-Release|Any CPU = Altcoins-Release|Any CPU - Altcoins-Release|x64 = Altcoins-Release|x64 - Altcoins-Release|x86 = Altcoins-Release|x86 Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 @@ -48,18 +42,6 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {949A0870-8D8C-4DE5-8845-DDD560489177}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU - {949A0870-8D8C-4DE5-8845-DDD560489177}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU - {949A0870-8D8C-4DE5-8845-DDD560489177}.Altcoins-Debug|x64.ActiveCfg = Altcoins-Debug|Any CPU - {949A0870-8D8C-4DE5-8845-DDD560489177}.Altcoins-Debug|x64.Build.0 = Altcoins-Debug|Any CPU - {949A0870-8D8C-4DE5-8845-DDD560489177}.Altcoins-Debug|x86.ActiveCfg = Altcoins-Debug|Any CPU - {949A0870-8D8C-4DE5-8845-DDD560489177}.Altcoins-Debug|x86.Build.0 = Altcoins-Debug|Any CPU - {949A0870-8D8C-4DE5-8845-DDD560489177}.Altcoins-Release|Any CPU.ActiveCfg = Altcoins-Release|Any CPU - {949A0870-8D8C-4DE5-8845-DDD560489177}.Altcoins-Release|Any CPU.Build.0 = Altcoins-Release|Any CPU - {949A0870-8D8C-4DE5-8845-DDD560489177}.Altcoins-Release|x64.ActiveCfg = Altcoins-Release|Any CPU - {949A0870-8D8C-4DE5-8845-DDD560489177}.Altcoins-Release|x64.Build.0 = Altcoins-Release|Any CPU - {949A0870-8D8C-4DE5-8845-DDD560489177}.Altcoins-Release|x86.ActiveCfg = Altcoins-Release|Any CPU - {949A0870-8D8C-4DE5-8845-DDD560489177}.Altcoins-Release|x86.Build.0 = Altcoins-Release|Any CPU {949A0870-8D8C-4DE5-8845-DDD560489177}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {949A0870-8D8C-4DE5-8845-DDD560489177}.Debug|Any CPU.Build.0 = Debug|Any CPU {949A0870-8D8C-4DE5-8845-DDD560489177}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -72,18 +54,6 @@ Global {949A0870-8D8C-4DE5-8845-DDD560489177}.Release|x64.Build.0 = Release|Any CPU {949A0870-8D8C-4DE5-8845-DDD560489177}.Release|x86.ActiveCfg = Release|Any CPU {949A0870-8D8C-4DE5-8845-DDD560489177}.Release|x86.Build.0 = Release|Any CPU - {B373F439-6E75-4A94-985D-10A0C7C500D0}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU - {B373F439-6E75-4A94-985D-10A0C7C500D0}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU - {B373F439-6E75-4A94-985D-10A0C7C500D0}.Altcoins-Debug|x64.ActiveCfg = Altcoins-Debug|Any CPU - {B373F439-6E75-4A94-985D-10A0C7C500D0}.Altcoins-Debug|x64.Build.0 = Altcoins-Debug|Any CPU - {B373F439-6E75-4A94-985D-10A0C7C500D0}.Altcoins-Debug|x86.ActiveCfg = Altcoins-Debug|Any CPU - {B373F439-6E75-4A94-985D-10A0C7C500D0}.Altcoins-Debug|x86.Build.0 = Altcoins-Debug|Any CPU - {B373F439-6E75-4A94-985D-10A0C7C500D0}.Altcoins-Release|Any CPU.ActiveCfg = Altcoins-Release|Any CPU - {B373F439-6E75-4A94-985D-10A0C7C500D0}.Altcoins-Release|Any CPU.Build.0 = Altcoins-Release|Any CPU - {B373F439-6E75-4A94-985D-10A0C7C500D0}.Altcoins-Release|x64.ActiveCfg = Altcoins-Release|Any CPU - {B373F439-6E75-4A94-985D-10A0C7C500D0}.Altcoins-Release|x64.Build.0 = Altcoins-Release|Any CPU - {B373F439-6E75-4A94-985D-10A0C7C500D0}.Altcoins-Release|x86.ActiveCfg = Altcoins-Release|Any CPU - {B373F439-6E75-4A94-985D-10A0C7C500D0}.Altcoins-Release|x86.Build.0 = Altcoins-Release|Any CPU {B373F439-6E75-4A94-985D-10A0C7C500D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B373F439-6E75-4A94-985D-10A0C7C500D0}.Debug|Any CPU.Build.0 = Debug|Any CPU {B373F439-6E75-4A94-985D-10A0C7C500D0}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -96,18 +66,6 @@ Global {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.Build.0 = Release|Any CPU - {6DC77459-D52F-45EE-B3F3-315043D33A1B}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU - {6DC77459-D52F-45EE-B3F3-315043D33A1B}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU - {6DC77459-D52F-45EE-B3F3-315043D33A1B}.Altcoins-Debug|x64.ActiveCfg = Altcoins-Debug|Any CPU - {6DC77459-D52F-45EE-B3F3-315043D33A1B}.Altcoins-Debug|x64.Build.0 = Altcoins-Debug|Any CPU - {6DC77459-D52F-45EE-B3F3-315043D33A1B}.Altcoins-Debug|x86.ActiveCfg = Altcoins-Debug|Any CPU - {6DC77459-D52F-45EE-B3F3-315043D33A1B}.Altcoins-Debug|x86.Build.0 = Altcoins-Debug|Any CPU - {6DC77459-D52F-45EE-B3F3-315043D33A1B}.Altcoins-Release|Any CPU.ActiveCfg = Altcoins-Release|Any CPU - {6DC77459-D52F-45EE-B3F3-315043D33A1B}.Altcoins-Release|Any CPU.Build.0 = Altcoins-Release|Any CPU - {6DC77459-D52F-45EE-B3F3-315043D33A1B}.Altcoins-Release|x64.ActiveCfg = Altcoins-Release|Any CPU - {6DC77459-D52F-45EE-B3F3-315043D33A1B}.Altcoins-Release|x64.Build.0 = Altcoins-Release|Any CPU - {6DC77459-D52F-45EE-B3F3-315043D33A1B}.Altcoins-Release|x86.ActiveCfg = Altcoins-Release|Any CPU - {6DC77459-D52F-45EE-B3F3-315043D33A1B}.Altcoins-Release|x86.Build.0 = Altcoins-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 @@ -120,18 +78,6 @@ Global {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}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU - {4BE42370-6114-4176-BFB3-37C6B6DA094D}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU - {4BE42370-6114-4176-BFB3-37C6B6DA094D}.Altcoins-Debug|x64.ActiveCfg = Altcoins-Debug|Any CPU - {4BE42370-6114-4176-BFB3-37C6B6DA094D}.Altcoins-Debug|x64.Build.0 = Altcoins-Debug|Any CPU - {4BE42370-6114-4176-BFB3-37C6B6DA094D}.Altcoins-Debug|x86.ActiveCfg = Altcoins-Debug|Any CPU - {4BE42370-6114-4176-BFB3-37C6B6DA094D}.Altcoins-Debug|x86.Build.0 = Altcoins-Debug|Any CPU - {4BE42370-6114-4176-BFB3-37C6B6DA094D}.Altcoins-Release|Any CPU.ActiveCfg = Altcoins-Release|Any CPU - {4BE42370-6114-4176-BFB3-37C6B6DA094D}.Altcoins-Release|Any CPU.Build.0 = Altcoins-Release|Any CPU - {4BE42370-6114-4176-BFB3-37C6B6DA094D}.Altcoins-Release|x64.ActiveCfg = Altcoins-Release|Any CPU - {4BE42370-6114-4176-BFB3-37C6B6DA094D}.Altcoins-Release|x64.Build.0 = Altcoins-Release|Any CPU - {4BE42370-6114-4176-BFB3-37C6B6DA094D}.Altcoins-Release|x86.ActiveCfg = Altcoins-Release|Any CPU - {4BE42370-6114-4176-BFB3-37C6B6DA094D}.Altcoins-Release|x86.Build.0 = Altcoins-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 @@ -144,18 +90,6 @@ Global {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 - {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU - {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU - {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Altcoins-Debug|x64.ActiveCfg = Altcoins-Debug|Any CPU - {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Altcoins-Debug|x64.Build.0 = Altcoins-Debug|Any CPU - {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Altcoins-Debug|x86.ActiveCfg = Altcoins-Debug|Any CPU - {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Altcoins-Debug|x86.Build.0 = Altcoins-Debug|Any CPU - {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Altcoins-Release|Any CPU.ActiveCfg = Altcoins-Release|Any CPU - {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Altcoins-Release|Any CPU.Build.0 = Altcoins-Release|Any CPU - {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Altcoins-Release|x64.ActiveCfg = Altcoins-Release|Any CPU - {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Altcoins-Release|x64.Build.0 = Altcoins-Release|Any CPU - {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Altcoins-Release|x86.ActiveCfg = Altcoins-Release|Any CPU - {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Altcoins-Release|x86.Build.0 = Altcoins-Release|Any CPU {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Debug|Any CPU.Build.0 = Debug|Any CPU {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -168,18 +102,6 @@ Global {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Release|x64.Build.0 = Release|Any CPU {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Release|x86.ActiveCfg = Release|Any CPU {4D7A865D-3945-4C70-9CC8-B09A274A697E}.Release|x86.Build.0 = Release|Any CPU - {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Altcoins-Debug|Any CPU.ActiveCfg = Debug|Any CPU - {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Altcoins-Debug|Any CPU.Build.0 = Debug|Any CPU - {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Altcoins-Debug|x64.ActiveCfg = Debug|Any CPU - {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Altcoins-Debug|x64.Build.0 = Debug|Any CPU - {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Altcoins-Debug|x86.ActiveCfg = Debug|Any CPU - {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Altcoins-Debug|x86.Build.0 = Debug|Any CPU - {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Altcoins-Release|Any CPU.ActiveCfg = Release|Any CPU - {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Altcoins-Release|Any CPU.Build.0 = Release|Any CPU - {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Altcoins-Release|x64.ActiveCfg = Release|Any CPU - {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Altcoins-Release|x64.Build.0 = Release|Any CPU - {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Altcoins-Release|x86.ActiveCfg = Release|Any CPU - {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Altcoins-Release|x86.Build.0 = Release|Any CPU {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Debug|Any CPU.Build.0 = Debug|Any CPU {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -192,18 +114,6 @@ Global {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Release|x64.Build.0 = Release|Any CPU {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Release|x86.ActiveCfg = Release|Any CPU {21A13304-7168-49A0-86C2-0A1A9453E9C7}.Release|x86.Build.0 = Release|Any CPU - {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Altcoins-Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Altcoins-Debug|Any CPU.Build.0 = Debug|Any CPU - {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Altcoins-Debug|x64.ActiveCfg = Debug|Any CPU - {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Altcoins-Debug|x64.Build.0 = Debug|Any CPU - {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Altcoins-Debug|x86.ActiveCfg = Debug|Any CPU - {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Altcoins-Debug|x86.Build.0 = Debug|Any CPU - {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Altcoins-Release|Any CPU.ActiveCfg = Debug|Any CPU - {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Altcoins-Release|Any CPU.Build.0 = Debug|Any CPU - {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Altcoins-Release|x64.ActiveCfg = Debug|Any CPU - {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Altcoins-Release|x64.Build.0 = Debug|Any CPU - {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Altcoins-Release|x86.ActiveCfg = Debug|Any CPU - {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Altcoins-Release|x86.Build.0 = Debug|Any CPU {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Debug|Any CPU.Build.0 = Debug|Any CPU {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -216,18 +126,6 @@ Global {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Release|x64.Build.0 = Release|Any CPU {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Release|x86.ActiveCfg = Release|Any CPU {A0D50BB6-FE2C-4671-8693-F7582B66178F}.Release|x86.Build.0 = Release|Any CPU - {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Altcoins-Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Altcoins-Debug|Any CPU.Build.0 = Debug|Any CPU - {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Altcoins-Debug|x64.ActiveCfg = Debug|Any CPU - {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Altcoins-Debug|x64.Build.0 = Debug|Any CPU - {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Altcoins-Debug|x86.ActiveCfg = Debug|Any CPU - {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Altcoins-Debug|x86.Build.0 = Debug|Any CPU - {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Altcoins-Release|Any CPU.ActiveCfg = Debug|Any CPU - {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Altcoins-Release|Any CPU.Build.0 = Debug|Any CPU - {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Altcoins-Release|x64.ActiveCfg = Debug|Any CPU - {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Altcoins-Release|x64.Build.0 = Debug|Any CPU - {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Altcoins-Release|x86.ActiveCfg = Debug|Any CPU - {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Altcoins-Release|x86.Build.0 = Debug|Any CPU {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Debug|Any CPU.Build.0 = Debug|Any CPU {7DC94B25-1CFC-4170-AA41-7BA983E4C0B8}.Debug|x64.ActiveCfg = Debug|Any CPU