From afd479ac69cb76b0926c314e4fa92d8fa247c8c7 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Thu, 17 Jun 2021 14:17:14 +0900 Subject: [PATCH] Remove the DerivationSchemeViewmodel.Enabled property --- BTCPayServer.Tests/TestAccount.cs | 1 - BTCPayServer/Controllers/StoresController.Onchain.cs | 6 +----- .../Models/StoreViewModels/DerivationSchemeViewModel.cs | 1 - .../Views/Stores/ImportWallet/ConfirmAddresses.cshtml | 1 - 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/BTCPayServer.Tests/TestAccount.cs b/BTCPayServer.Tests/TestAccount.cs index 66771847d..0bd3ad91b 100644 --- a/BTCPayServer.Tests/TestAccount.cs +++ b/BTCPayServer.Tests/TestAccount.cs @@ -191,7 +191,6 @@ namespace BTCPayServer.Tests { StoreId = StoreId, Method = importKeysToNBX ? WalletSetupMethod.HotWallet : WalletSetupMethod.WatchOnly, - Enabled = true, CryptoCode = cryptoCode, Network = SupportedNetwork, RootFingerprint = GenerateWalletResponseV.AccountKeyPath.MasterFingerprint.ToString(), diff --git a/BTCPayServer/Controllers/StoresController.Onchain.cs b/BTCPayServer/Controllers/StoresController.Onchain.cs index bd7ee0326..4403d3b71 100644 --- a/BTCPayServer/Controllers/StoresController.Onchain.cs +++ b/BTCPayServer/Controllers/StoresController.Onchain.cs @@ -157,7 +157,6 @@ namespace BTCPayServer.Controllers var configChanged = oldConfig != vm.Config; PaymentMethodId paymentMethodId = new PaymentMethodId(network.CryptoCode, PaymentTypes.BTCLike); var storeBlob = store.GetStoreBlob(); - var willBeExcluded = !vm.Enabled; var showAddress = // Show addresses if: // - The user is clicking on continue after changing the config @@ -171,7 +170,7 @@ namespace BTCPayServer.Controllers if (strategy != null) await wallet.TrackAsync(strategy.AccountDerivation); store.SetSupportedPaymentMethod(paymentMethodId, strategy); - storeBlob.SetExcluded(paymentMethodId, willBeExcluded); + storeBlob.SetExcluded(paymentMethodId, false); storeBlob.Hints.Wallet = false; store.SetStoreBlob(storeBlob); } @@ -215,7 +214,6 @@ namespace BTCPayServer.Controllers vm.Config = derivation.ToJson(); } - vm.Enabled = !store.GetStoreBlob().IsExcluded(new PaymentMethodId(vm.CryptoCode, PaymentTypes.BTCLike)); vm.CanUseHotWallet = hotWallet; vm.CanUseRPCImport = rpcImport; vm.RootKeyPath = network.GetRootKeyPath(); @@ -259,7 +257,6 @@ namespace BTCPayServer.Controllers Confirmation = string.IsNullOrEmpty(request.ExistingMnemonic), Network = network, RootKeyPath = network.GetRootKeyPath(), - Enabled = !store.GetStoreBlob().IsExcluded(new PaymentMethodId(cryptoCode, PaymentTypes.BTCLike)), Source = "NBXplorer", DerivationSchemeFormat = "BTCPay", CanUseHotWallet = true, @@ -371,7 +368,6 @@ namespace BTCPayServer.Controllers vm.DerivationScheme = derivation.AccountDerivation.ToString(); vm.KeyPath = derivation.GetSigningAccountKeySettings().AccountKeyPath?.ToString(); vm.Config = derivation.ToJson(); - vm.Enabled = !store.GetStoreBlob().IsExcluded(new PaymentMethodId(vm.CryptoCode, PaymentTypes.BTCLike)); vm.IsHotWallet = isHotWallet; return View(vm); diff --git a/BTCPayServer/Models/StoreViewModels/DerivationSchemeViewModel.cs b/BTCPayServer/Models/StoreViewModels/DerivationSchemeViewModel.cs index 1b0408548..14d40d918 100644 --- a/BTCPayServer/Models/StoreViewModels/DerivationSchemeViewModel.cs +++ b/BTCPayServer/Models/StoreViewModels/DerivationSchemeViewModel.cs @@ -21,7 +21,6 @@ namespace BTCPayServer.Models.StoreViewModels [Display(Name = "Root fingerprint")] public string RootFingerprint { get; set; } public bool Confirmation { get; set; } - public bool Enabled { get; set; } = true; public KeyPath RootKeyPath { get; set; } diff --git a/BTCPayServer/Views/Stores/ImportWallet/ConfirmAddresses.cshtml b/BTCPayServer/Views/Stores/ImportWallet/ConfirmAddresses.cshtml index f795e4243..11577a00c 100644 --- a/BTCPayServer/Views/Stores/ImportWallet/ConfirmAddresses.cshtml +++ b/BTCPayServer/Views/Stores/ImportWallet/ConfirmAddresses.cshtml @@ -50,7 +50,6 @@ -