From 10adb23e715473faca9431b9081d1d5124a59261 Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Thu, 20 Jan 2022 17:39:23 +0100 Subject: [PATCH] Remove obsolete store hints --- .../Controllers/UIStoresController.LightningLike.cs | 4 ---- .../Controllers/UIStoresController.Onchain.cs | 1 - BTCPayServer/Data/StoreBlob.cs | 8 -------- BTCPayServer/Data/StoreDataExtensions.cs | 3 --- BTCPayServer/Services/Stores/StoreRepository.cs | 13 ------------- 5 files changed, 29 deletions(-) diff --git a/BTCPayServer/Controllers/UIStoresController.LightningLike.cs b/BTCPayServer/Controllers/UIStoresController.LightningLike.cs index a48f539a8..ad5db449b 100644 --- a/BTCPayServer/Controllers/UIStoresController.LightningLike.cs +++ b/BTCPayServer/Controllers/UIStoresController.LightningLike.cs @@ -158,11 +158,7 @@ namespace BTCPayServer.Controllers switch (command) { case "save": - var storeBlob = store.GetStoreBlob(); - storeBlob.Hints.Lightning = false; - var lnurl = new PaymentMethodId(vm.CryptoCode, PaymentTypes.LNURLPay); - store.SetStoreBlob(storeBlob); store.SetSupportedPaymentMethod(paymentMethodId, paymentMethod); store.SetSupportedPaymentMethod(lnurl, new LNURLPaySupportedPaymentMethod() { diff --git a/BTCPayServer/Controllers/UIStoresController.Onchain.cs b/BTCPayServer/Controllers/UIStoresController.Onchain.cs index 5d6dd6f1c..aabd56b9f 100644 --- a/BTCPayServer/Controllers/UIStoresController.Onchain.cs +++ b/BTCPayServer/Controllers/UIStoresController.Onchain.cs @@ -163,7 +163,6 @@ namespace BTCPayServer.Controllers await wallet.TrackAsync(strategy.AccountDerivation); store.SetSupportedPaymentMethod(paymentMethodId, strategy); storeBlob.SetExcluded(paymentMethodId, false); - storeBlob.Hints.Wallet = false; storeBlob.PayJoinEnabled = strategy.IsHotWallet && !(vm.SetupRequest?.PayJoinEnabled is false); store.SetStoreBlob(storeBlob); } diff --git a/BTCPayServer/Data/StoreBlob.cs b/BTCPayServer/Data/StoreBlob.cs index ffe3dd792..61b782c5e 100644 --- a/BTCPayServer/Data/StoreBlob.cs +++ b/BTCPayServer/Data/StoreBlob.cs @@ -170,8 +170,6 @@ namespace BTCPayServer.Data public EmailSettings EmailSettings { get; set; } public bool PayJoinEnabled { get; set; } - public StoreHints Hints { get; set; } - [JsonExtensionData] public IDictionary AdditionalData { get; set; } = new Dictionary(); @@ -180,12 +178,6 @@ namespace BTCPayServer.Data [JsonConverter(typeof(TimeSpanJsonConverter.Days))] public TimeSpan RefundBOLT11Expiration { get; set; } - public class StoreHints - { - public bool Wallet { get; set; } - public bool Lightning { get; set; } - } - public IPaymentFilter GetExcludedPaymentMethods() { #pragma warning disable CS0618 // Type or member is obsolete diff --git a/BTCPayServer/Data/StoreDataExtensions.cs b/BTCPayServer/Data/StoreDataExtensions.cs index 35a4e320b..6ae6281a8 100644 --- a/BTCPayServer/Data/StoreDataExtensions.cs +++ b/BTCPayServer/Data/StoreDataExtensions.cs @@ -50,9 +50,6 @@ namespace BTCPayServer.Data var result = storeData.StoreBlob == null ? new StoreBlob() : new Serializer(null).ToObject(Encoding.UTF8.GetString(storeData.StoreBlob)); if (result.PreferredExchange == null) result.PreferredExchange = CoinGeckoRateProvider.CoinGeckoName; - - if (result.Hints == null) - result.Hints = new StoreBlob.StoreHints(); return result; } diff --git a/BTCPayServer/Services/Stores/StoreRepository.cs b/BTCPayServer/Services/Stores/StoreRepository.cs index d19dd1c21..e37a26950 100644 --- a/BTCPayServer/Services/Stores/StoreRepository.cs +++ b/BTCPayServer/Services/Stores/StoreRepository.cs @@ -152,17 +152,6 @@ namespace BTCPayServer.Services.Stores } } - private void SetNewStoreHints(ref StoreData storeData) - { - var blob = storeData.GetStoreBlob(); - blob.Hints = new Data.StoreBlob.StoreHints - { - Wallet = true, - Lightning = true - }; - storeData.SetStoreBlob(blob); - } - public async Task CreateStore(string ownerId, StoreData storeData) { if (!string.IsNullOrEmpty(storeData.Id)) @@ -179,8 +168,6 @@ namespace BTCPayServer.Services.Stores Role = StoreRoles.Owner, }; - SetNewStoreHints(ref storeData); - ctx.Add(storeData); ctx.Add(userStore); await ctx.SaveChangesAsync();