I ve learned how to write the word average correctly
MODIFY
WalletWasabi.Backend/Controllers/WabiSabiController.cs
WalletWasabi.Backend/Controllers/WabiSabiController.cs
@@ -31,8 +31,8 @@ public class WabiSabiController : ControllerBase, IWabiSabiApiRequestHandler
public async Task<RoundStateResponse> GetStatusAsync(RoundStateRequest request, CancellationToken cancellationToken)
{
var response = await Arena.GetStatusAsync(request, cancellationToken);
- var avarages = CoinJoinFeeRateStatStore.GetDefaultAvarages();
- return new RoundStateResponse(response.RoundStates, avarages);
+ var averages = CoinJoinFeeRateStatStore.GetDefaultAverages();
+ return new RoundStateResponse(response.RoundStates, averages);
}
[HttpPost("connection-confirmation")]

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Models/RoundStateUpdaterTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Models/RoundStateUpdaterTests.cs
@@ -28,11 +28,11 @@ public class RoundStateUpdaterTests
// Each line represents a response for each request.
var mockApiClient = new Mock<IWabiSabiApiRequestHandler>();
mockApiClient.SetupSequence(apiClient => apiClient.GetStatusAsync(It.IsAny<RoundStateRequest>(), It.IsAny<CancellationToken>()))
- .ReturnsAsync(() => new RoundStateResponse(new[] { roundState1 with { Phase = Phase.InputRegistration } }, Array.Empty<CoinJoinFeeRateAvarage>()))
- .ReturnsAsync(() => new RoundStateResponse(new[] { roundState1 with { Phase = Phase.OutputRegistration } }, Array.Empty<CoinJoinFeeRateAvarage>()))
- .ReturnsAsync(() => new RoundStateResponse(new[] { roundState1 with { Phase = Phase.OutputRegistration }, roundState2 with { Phase = Phase.InputRegistration } }, Array.Empty<CoinJoinFeeRateAvarage>()))
- .ReturnsAsync(() => new RoundStateResponse(new[] { roundState2 with { Phase = Phase.OutputRegistration } }, Array.Empty<CoinJoinFeeRateAvarage>()))
- .ReturnsAsync(() => new RoundStateResponse(Array.Empty<RoundState>(), Array.Empty<CoinJoinFeeRateAvarage>()));
+ .ReturnsAsync(() => new RoundStateResponse(new[] { roundState1 with { Phase = Phase.InputRegistration } }, Array.Empty<CoinJoinFeeRateAverage>()))
+ .ReturnsAsync(() => new RoundStateResponse(new[] { roundState1 with { Phase = Phase.OutputRegistration } }, Array.Empty<CoinJoinFeeRateAverage>()))
+ .ReturnsAsync(() => new RoundStateResponse(new[] { roundState1 with { Phase = Phase.OutputRegistration }, roundState2 with { Phase = Phase.InputRegistration } }, Array.Empty<CoinJoinFeeRateAverage>()))
+ .ReturnsAsync(() => new RoundStateResponse(new[] { roundState2 with { Phase = Phase.OutputRegistration } }, Array.Empty<CoinJoinFeeRateAverage>()))
+ .ReturnsAsync(() => new RoundStateResponse(Array.Empty<RoundState>(), Array.Empty<CoinJoinFeeRateAverage>()));
using RoundStateUpdater roundStatusUpdater = new(TimeSpan.FromDays(1), mockApiClient.Object);
@@ -104,13 +104,13 @@ public class RoundStateUpdaterTests
// Exceptions, Problems, Errors everywhere!!!
var mockApiClient = new Mock<IWabiSabiApiRequestHandler>();
mockApiClient.SetupSequence(apiClient => apiClient.GetStatusAsync(It.IsAny<RoundStateRequest>(), It.IsAny<CancellationToken>()))
- .ReturnsAsync(() => new RoundStateResponse(new[] { roundState with { Phase = Phase.InputRegistration } }, Array.Empty<CoinJoinFeeRateAvarage>()))
+ .ReturnsAsync(() => new RoundStateResponse(new[] { roundState with { Phase = Phase.InputRegistration } }, Array.Empty<CoinJoinFeeRateAverage>()))
.ThrowsAsync(new Exception())
.ThrowsAsync(new OperationCanceledException())
.ThrowsAsync(new InvalidOperationException())
.ThrowsAsync(new HttpRequestException())
- .ReturnsAsync(() => new RoundStateResponse(new[] { roundState with { Phase = Phase.OutputRegistration } }, Array.Empty<CoinJoinFeeRateAvarage>()))
- .ReturnsAsync(() => new RoundStateResponse(Array.Empty<RoundState>(), Array.Empty<CoinJoinFeeRateAvarage>()));
+ .ReturnsAsync(() => new RoundStateResponse(new[] { roundState with { Phase = Phase.OutputRegistration } }, Array.Empty<CoinJoinFeeRateAverage>()))
+ .ReturnsAsync(() => new RoundStateResponse(Array.Empty<RoundState>(), Array.Empty<CoinJoinFeeRateAverage>()));
using RoundStateUpdater roundStatusUpdater = new(TimeSpan.FromMilliseconds(100), mockApiClient.Object);
@@ -152,13 +152,13 @@ public class RoundStateUpdaterTests
// Exceptions, Problems, Errors everywhere!!!
var mockApiClient = new Mock<IWabiSabiApiRequestHandler>();
mockApiClient.SetupSequence(apiClient => apiClient.GetStatusAsync(It.IsAny<RoundStateRequest>(), It.IsAny<CancellationToken>()))
- .ReturnsAsync(() => new RoundStateResponse(new[] { roundState with { Phase = Phase.InputRegistration } }, Array.Empty<CoinJoinFeeRateAvarage>()))
+ .ReturnsAsync(() => new RoundStateResponse(new[] { roundState with { Phase = Phase.InputRegistration } }, Array.Empty<CoinJoinFeeRateAverage>()))
.ThrowsAsync(new Exception())
.ThrowsAsync(new OperationCanceledException())
.ThrowsAsync(new InvalidOperationException())
.ThrowsAsync(new HttpRequestException())
- .ReturnsAsync(() => new RoundStateResponse(new[] { roundState with { Phase = Phase.Ended } }, Array.Empty<CoinJoinFeeRateAvarage>()))
- .ReturnsAsync(() => new RoundStateResponse(Array.Empty<RoundState>(), Array.Empty<CoinJoinFeeRateAvarage>()));
+ .ReturnsAsync(() => new RoundStateResponse(new[] { roundState with { Phase = Phase.Ended } }, Array.Empty<CoinJoinFeeRateAverage>()))
+ .ReturnsAsync(() => new RoundStateResponse(Array.Empty<RoundState>(), Array.Empty<CoinJoinFeeRateAverage>()));
using RoundStateUpdater roundStatusUpdater = new(TimeSpan.FromMilliseconds(100), mockApiClient.Object);

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Models/SerializationTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Models/SerializationTests.cs
@@ -175,8 +175,8 @@ public class SerializationTests
{
var round = WabiSabiFactory.CreateRound(new WalletWasabi.WabiSabi.Backend.WabiSabiConfig());
var roundState = RoundState.FromRound(round);
- CoinJoinFeeRateAvarage avarage = new(TimeSpan.FromHours(24), new FeeRate(120m));
- RoundStateResponse response = new(new[] { roundState }, new[] { avarage });
+ CoinJoinFeeRateAverage average = new(TimeSpan.FromHours(24), new FeeRate(120m));
+ RoundStateResponse response = new(new[] { roundState }, new[] { average });
AssertSerialization(response);
}

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.Partial.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.Partial.cs
@@ -367,7 +367,7 @@ public partial class Arena : IWabiSabiApiRequestHandler
return RoundState.FromRound(x, checkPoint == default ? 0 : checkPoint.StateId);
}).ToArray();
- return new RoundStateResponse(roundStates, Array.Empty<CoinJoinFeeRateAvarage>());
+ return new RoundStateResponse(roundStates, Array.Empty<CoinJoinFeeRateAverage>());
}
}

MODIFY
WalletWasabi/WabiSabi/Backend/Statistics/CoinJoinFeeRateStatStore.cs
WalletWasabi/WabiSabi/Backend/Statistics/CoinJoinFeeRateStatStore.cs
@@ -37,7 +37,7 @@ public class CoinJoinFeeRateStatStore : PeriodicRunner
private List<CoinJoinFeeRateStat> CoinJoinFeeRateStats { get; }
- private CoinJoinFeeRateAvarage[] DefaultAvarages { get; set; } = Array.Empty<CoinJoinFeeRateAvarage>();
+ private CoinJoinFeeRateAverage[] DefaultAverages { get; set; } = Array.Empty<CoinJoinFeeRateAverage>();
private WabiSabiConfig Config { get; }
private IRPCClient Rpc { get; }
@@ -57,7 +57,7 @@ public class CoinJoinFeeRateStatStore : PeriodicRunner
{
CoinJoinFeeRateStats.Add(feeRateStat);
- DefaultAvarages = TimeFrames.Select(t => new CoinJoinFeeRateAvarage(t, GetAvarage(t))).ToArray();
+ DefaultAverages = TimeFrames.Select(t => new CoinJoinFeeRateAverage(t, GetAverage(t))).ToArray();
// Prune old items.
DateTimeOffset removeBefore = DateTimeOffset.UtcNow - MaximumTimeToStore;
@@ -67,7 +67,7 @@ public class CoinJoinFeeRateStatStore : PeriodicRunner
}
}
- public FeeRate GetAvarage(TimeSpan timeFrame)
+ private FeeRate GetAverage(TimeSpan timeFrame)
{
var from = DateTimeOffset.UtcNow - timeFrame;
return new FeeRate(CoinJoinFeeRateStats.Where(x => x.DateTimeOffset >= from).Average(x => x.FeeRate.SatoshiPerByte));
@@ -76,9 +76,9 @@ public class CoinJoinFeeRateStatStore : PeriodicRunner
/// <summary>
/// The avagares are calculated periodically in every <see cref="PeriodicRunner.Period"/> time span.
/// </summary>
- public CoinJoinFeeRateAvarage[] GetDefaultAvarages()
+ public CoinJoinFeeRateAverage[] GetDefaultAverages()
{
- return DefaultAvarages;
+ return DefaultAverages;
}
public static CoinJoinFeeRateStatStore LoadFromFile(string filePath, WabiSabiConfig config, IRPCClient rpc)

MODIFY
WalletWasabi/WabiSabi/Models/CoinJoinFeeRateAvarage.cs
WalletWasabi/WabiSabi/Models/CoinJoinFeeRateAvarage.cs
@@ -2,4 +2,4 @@ using NBitcoin;
namespace WalletWasabi.WabiSabi.Models;
-public record CoinJoinFeeRateAvarage(TimeSpan TimeFrame, FeeRate AvarageFeeRate);
+public record CoinJoinFeeRateAverage(TimeSpan TimeFrame, FeeRate AverageFeeRate);

MODIFY
WalletWasabi/WabiSabi/Models/RoundStateResponse.cs
WalletWasabi/WabiSabi/Models/RoundStateResponse.cs
namespace WalletWasabi.WabiSabi.Models;
-public record RoundStateResponse(RoundState[] RoundStates, CoinJoinFeeRateAvarage[] CoinJoinFeeRateAvarages);
+public record RoundStateResponse(RoundState[] RoundStates, CoinJoinFeeRateAverage[] CoinJoinFeeRateAverages);

I ve learned how to write the word average correctly