Use the same class name as the file name is
MODIFY
WalletWasabi.Tests/UnitTests/IoTests.cs
WalletWasabi.Tests/UnitTests/IoTests.cs
@@ -31,7 +31,7 @@ namespace WalletWasabi.Tests.UnitTests
// Single thread file operations.
- DigestableIoManager ioman1 = new DigestableIoManager(file1);
+ DigestableSafeIoManager ioman1 = new DigestableSafeIoManager(file1);
// Delete the file if Exist.
@@ -155,7 +155,7 @@ namespace WalletWasabi.Tests.UnitTests
var file = Path.Combine(Common.GetWorkDir(), $"file.dat");
AsyncLock asyncLock = new AsyncLock();
- DigestableIoManager ioman = new DigestableIoManager(file);
+ DigestableSafeIoManager ioman = new DigestableSafeIoManager(file);
ioman.DeleteMe();
await ioman.WriteAllLinesAsync(Array.Empty<string>());
Assert.False(File.Exists(ioman.FilePath));

MODIFY
WalletWasabi/Io/DigestableSafeIoManager.cs
WalletWasabi/Io/DigestableSafeIoManager.cs
@@ -14,12 +14,12 @@ namespace WalletWasabi.Io
/// <summary>
/// Safely manager file operations.
/// </summary>
- public class DigestableIoManager : SafeIoManager
+ public class DigestableSafeIoManager : SafeIoManager
{
private const string DigestExtension = ".dig";
/// <param name="digestRandomIndex">Use the random index of the line to create digest faster. -1 is special value, it means the last character. If null then hash whole file.</param>
- public DigestableIoManager(string filePath, int? digestRandomIndex = null) : base(filePath)
+ public DigestableSafeIoManager(string filePath, int? digestRandomIndex = null) : base(filePath)
{
DigestRandomIndex = digestRandomIndex;

MODIFY
WalletWasabi/Stores/IndexStore.cs
WalletWasabi/Stores/IndexStore.cs
@@ -29,9 +29,9 @@ namespace WalletWasabi.Stores
WorkFolderPath = Guard.NotNullOrEmptyOrWhitespace(nameof(workFolderPath), workFolderPath, trim: true);
IoHelpers.EnsureDirectoryExists(WorkFolderPath);
var indexFilePath = Path.Combine(WorkFolderPath, "MatureIndex.dat");
- MatureIndexFileManager = new DigestableIoManager(indexFilePath, digestRandomIndex: -1);
+ MatureIndexFileManager = new DigestableSafeIoManager(indexFilePath, digestRandomIndex: -1);
var immatureIndexFilePath = Path.Combine(WorkFolderPath, "ImmatureIndex.dat");
- ImmatureIndexFileManager = new DigestableIoManager(immatureIndexFilePath, digestRandomIndex: -1);
+ ImmatureIndexFileManager = new DigestableSafeIoManager(immatureIndexFilePath, digestRandomIndex: -1);
Network = Guard.NotNull(nameof(network), network);
@@ -47,8 +47,8 @@ namespace WalletWasabi.Stores
private string WorkFolderPath { get; }
private Network Network { get; }
- private DigestableIoManager MatureIndexFileManager { get; }
- private DigestableIoManager ImmatureIndexFileManager { get; }
+ private DigestableSafeIoManager MatureIndexFileManager { get; }
+ private DigestableSafeIoManager ImmatureIndexFileManager { get; }
/// <summary>
/// Lock for accessing MatureIndex file. This should be locked #2.
@@ -114,7 +114,7 @@ namespace WalletWasabi.Stores
}
}
- private async Task DeleteIfDeprecatedAsync(DigestableIoManager ioManager)
+ private async Task DeleteIfDeprecatedAsync(DigestableSafeIoManager ioManager)
{
string? firstLine;
using (var content = ioManager.OpenText())

Use the same class name as the file name is