BitcoinStore: Prepare for removing `workFolderPath` & `network` parameters from the class's constructor
MODIFY
WalletWasabi/Stores/BitcoinStore.cs
WalletWasabi/Stores/BitcoinStore.cs
@@ -26,18 +26,21 @@ namespace WalletWasabi.Stores
AllTransactionStore transactionStore,
MempoolService mempoolService)
{
- WorkFolderPath = Guard.NotNullOrEmptyOrWhitespace(nameof(workFolderPath), workFolderPath, trim: true);
- IoHelpers.EnsureDirectoryExists(WorkFolderPath);
+ var workFolderPath2 = Guard.NotNullOrEmptyOrWhitespace(nameof(workFolderPath), workFolderPath, trim: true);
+ IoHelpers.EnsureDirectoryExists(workFolderPath2);
+
+ Guard.NotNull(nameof(network), network);
+ NetworkWorkFolderPath = Path.Combine(workFolderPath2, network.ToString());
+ IndexStoreFolderPath = Path.Combine(NetworkWorkFolderPath, "IndexStore");
- Network = Guard.NotNull(nameof(network), network);
IndexStore = indexStore;
TransactionStore = transactionStore;
MempoolService = mempoolService;
}
public bool IsInitialized { get; private set; }
- private string WorkFolderPath { get; }
- public Network Network { get; }
+ private string NetworkWorkFolderPath { get; }
+ private string IndexStoreFolderPath { get; }
public IndexStore IndexStore { get; }
public AllTransactionStore TransactionStore { get; }
@@ -54,13 +57,10 @@ namespace WalletWasabi.Stores
{
using (BenchmarkLogger.Measure())
{
- var networkWorkFolderPath = Path.Combine(WorkFolderPath, Network.ToString());
- var indexStoreFolderPath = Path.Combine(networkWorkFolderPath, "IndexStore");
-
var initTasks = new[]
{
- IndexStore.InitializeAsync(indexStoreFolderPath),
- TransactionStore.InitializeAsync(networkWorkFolderPath)
+ IndexStore.InitializeAsync(IndexStoreFolderPath),
+ TransactionStore.InitializeAsync(NetworkWorkFolderPath)
};
await Task.WhenAll(initTasks).ConfigureAwait(false);

BitcoinStore: Prepare for removing `workFolderPath` & `network` parameters from the class's constructor

(cherry picked from commit f77b7cfa716590cab2d564059edcf801c48bf7e0)