Add missing `async` suffix
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Integration/WabiSabiHttpApiIntegrationTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Integration/WabiSabiHttpApiIntegrationTests.cs
@@ -365,7 +365,7 @@ public class WabiSabiHttpApiIntegrationTests : IClassFixture<WabiSabiApiApplicat
using var roundStateUpdater = new RoundStateUpdater(TimeSpan.FromSeconds(1), apiClient);
await roundStateUpdater.StartAsync(CancellationToken.None);
- var roundState = await roundStateUpdater.CreateRoundAwaiter(roundState => roundState.Phase == Phase.InputRegistration, cts.Token);
+ var roundState = await roundStateUpdater.CreateRoundAwaiterAsync(roundState => roundState.Phase == Phase.InputRegistration, cts.Token);
var coinJoinClient = WabiSabiFactory.CreateTestCoinJoinClient(mockHttpClientFactory.Object, keyManager1, roundStateUpdater);

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Models/RoundStateUpdaterTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Models/RoundStateUpdaterTests.cs
@@ -40,10 +40,10 @@ public class RoundStateUpdaterTests
// At this point in time the RoundStateUpdater only knows about `round1` and then we can subscribe to
// events for that round.
using var round1TSCts = new CancellationTokenSource();
- var round1IRTask = roundStatusUpdater.CreateRoundAwaiter(roundState1.Id, Phase.InputRegistration, cancellationToken);
- var round1ORTask = roundStatusUpdater.CreateRoundAwaiter(roundState1.Id, Phase.OutputRegistration, cancellationToken);
- var round1TSTask = roundStatusUpdater.CreateRoundAwaiter(roundState1.Id, Phase.TransactionSigning, round1TSCts.Token);
- var round1TBTask = roundStatusUpdater.CreateRoundAwaiter(roundState1.Id, Phase.Ended, cancellationToken);
+ var round1IRTask = roundStatusUpdater.CreateRoundAwaiterAsync(roundState1.Id, Phase.InputRegistration, cancellationToken);
+ var round1ORTask = roundStatusUpdater.CreateRoundAwaiterAsync(roundState1.Id, Phase.OutputRegistration, cancellationToken);
+ var round1TSTask = roundStatusUpdater.CreateRoundAwaiterAsync(roundState1.Id, Phase.TransactionSigning, round1TSCts.Token);
+ var round1TBTask = roundStatusUpdater.CreateRoundAwaiterAsync(roundState1.Id, Phase.Ended, cancellationToken);
// Start
await roundStatusUpdater.StartAsync(cancellationTokenSource.Token);
@@ -57,8 +57,8 @@ public class RoundStateUpdaterTests
// Force the RoundStatusUpdater to run. After this it will know about the existence of `round2` so,
// we can subscribe to events.
await roundStatusUpdater.TriggerAndWaitRoundAsync(TestTimeOut);
- var round2IRTask = roundStatusUpdater.CreateRoundAwaiter(roundState2.Id, Phase.InputRegistration, cancellationToken);
- var round2TBTask = roundStatusUpdater.CreateRoundAwaiter(roundState2.Id, Phase.Ended, cancellationToken);
+ var round2IRTask = roundStatusUpdater.CreateRoundAwaiterAsync(roundState2.Id, Phase.InputRegistration, cancellationToken);
+ var round2TBTask = roundStatusUpdater.CreateRoundAwaiterAsync(roundState2.Id, Phase.Ended, cancellationToken);
// Force the RoundStatusUpdater to run again just to make it trigger the events.
await roundStatusUpdater.TriggerAndWaitRoundAsync(TestTimeOut);
@@ -118,8 +118,8 @@ public class RoundStateUpdaterTests
// At this point in time the RoundStateUpdater only knows about `round1` and then we can subscribe to
// events for that round.
using var roundTSCts = new CancellationTokenSource();
- var roundIRTask = roundStatusUpdater.CreateRoundAwaiter(roundState.Id, Phase.InputRegistration, cancellationToken);
- var roundORTask = roundStatusUpdater.CreateRoundAwaiter(roundState.Id, Phase.OutputRegistration, cancellationToken);
+ var roundIRTask = roundStatusUpdater.CreateRoundAwaiterAsync(roundState.Id, Phase.InputRegistration, cancellationToken);
+ var roundORTask = roundStatusUpdater.CreateRoundAwaiterAsync(roundState.Id, Phase.OutputRegistration, cancellationToken);
// Start
await roundStatusUpdater.StartAsync(cancellationTokenSource.Token);
@@ -166,8 +166,8 @@ public class RoundStateUpdaterTests
// At this point in time the RoundStateUpdater only knows about `round1` and then we can subscribe to
// events for that round.
using var roundTSCts = new CancellationTokenSource();
- var roundIRTask = roundStatusUpdater.CreateRoundAwaiter(roundState.Id, Phase.InputRegistration, cancellationToken);
- var roundORTask = roundStatusUpdater.CreateRoundAwaiter(roundState.Id, Phase.OutputRegistration, cancellationToken);
+ var roundIRTask = roundStatusUpdater.CreateRoundAwaiterAsync(roundState.Id, Phase.InputRegistration, cancellationToken);
+ var roundORTask = roundStatusUpdater.CreateRoundAwaiterAsync(roundState.Id, Phase.OutputRegistration, cancellationToken);
// Start
await roundStatusUpdater.StartAsync(cancellationTokenSource.Token);
@@ -207,7 +207,7 @@ public class RoundStateUpdaterTests
using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(1));
await Assert.ThrowsAsync<TaskCanceledException>(async () =>
- await roundStatusUpdater.CreateRoundAwaiter(uint256.One, Phase.InputRegistration, cancellationTokenSource.Token));
+ await roundStatusUpdater.CreateRoundAwaiterAsync(uint256.One, Phase.InputRegistration, cancellationTokenSource.Token));
}
finally
{

MODIFY
WalletWasabi/WabiSabi/Client/AliceClient.cs
WalletWasabi/WabiSabi/Client/AliceClient.cs
@@ -163,7 +163,7 @@ public class AliceClient
try
{
await roundStatusUpdater
- .CreateRoundAwaiter(
+ .CreateRoundAwaiterAsync(
RoundId,
Phase.ConnectionConfirmation,
cts.Token)

MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
@@ -86,7 +86,7 @@ public class CoinJoinClient
{
CoinJoinClientProgress.SafeInvoke(this, new WaitingForRound());
return await RoundStatusUpdater
- .CreateRoundAwaiter(
+ .CreateRoundAwaiterAsync(
roundState =>
roundState.InputRegistrationEnd - DateTimeOffset.UtcNow > DoNotRegisterInLastMinuteTimeLimit
&& roundState.CoinjoinState.Parameters.AllowedOutputAmounts.Min < MinimumOutputAmountSanity
@@ -107,7 +107,7 @@ public class CoinJoinClient
using CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(waitForBlameRoundCts.Token, token);
var roundState = await RoundStatusUpdater
- .CreateRoundAwaiter(
+ .CreateRoundAwaiterAsync(
roundState => roundState.BlameOf == blameRoundId,
linkedCts.Token)
.ConfigureAwait(false);
@@ -241,7 +241,7 @@ public class CoinJoinClient
var (unsignedCoinJoin, aliceClientsThatSigned) = await ProceedWithSigningStateAsync(roundId, registeredAliceClients, outputTxOuts, cancellationToken).ConfigureAwait(false);
- roundState = await RoundStatusUpdater.CreateRoundAwaiter(s => s.Id == roundId && s.Phase == Phase.Ended, cancellationToken).ConfigureAwait(false);
+ roundState = await RoundStatusUpdater.CreateRoundAwaiterAsync(s => s.Id == roundId && s.Phase == Phase.Ended, cancellationToken).ConfigureAwait(false);
var msg = roundState.EndRoundState switch
{
@@ -971,7 +971,7 @@ public class CoinJoinClient
private async Task<IEnumerable<TxOut>> ProceedWithOutputRegistrationPhaseAsync(uint256 roundId, ImmutableArray<AliceClient> registeredAliceClients, CancellationToken cancellationToken)
{
// Waiting for OutputRegistration phase, all the Alices confirmed their connections, so the list of the inputs will be complete.
- var roundState = await RoundStatusUpdater.CreateRoundAwaiter(roundId, Phase.OutputRegistration, cancellationToken).ConfigureAwait(false);
+ var roundState = await RoundStatusUpdater.CreateRoundAwaiterAsync(roundId, Phase.OutputRegistration, cancellationToken).ConfigureAwait(false);
var roundParameters = roundState.CoinjoinState.Parameters;
var remainingTime = roundParameters.OutputRegistrationTimeout - RoundStatusUpdater.Period;
var now = DateTimeOffset.UtcNow;
@@ -1042,7 +1042,7 @@ public class CoinJoinClient
CancellationToken cancellationToken)
{
// Signing.
- var roundState = await RoundStatusUpdater.CreateRoundAwaiter(roundId, Phase.TransactionSigning, cancellationToken).ConfigureAwait(false);
+ var roundState = await RoundStatusUpdater.CreateRoundAwaiterAsync(roundId, Phase.TransactionSigning, cancellationToken).ConfigureAwait(false);
var remainingTime = roundState.CoinjoinState.Parameters.TransactionSigningTimeout - RoundStatusUpdater.Period;
var signingStateEndTime = DateTimeOffset.UtcNow + remainingTime;

MODIFY
WalletWasabi/WabiSabi/Client/RoundStateAwaiters/RoundStateUpdater.cs
WalletWasabi/WabiSabi/Client/RoundStateAwaiters/RoundStateUpdater.cs
@@ -86,7 +86,7 @@ public class RoundStateUpdater : PeriodicRunner
LastSuccessfulRequestTime = DateTimeOffset.UtcNow;
}
- private Task<RoundState> CreateRoundAwaiter(uint256? roundId, Phase? phase, Predicate<RoundState>? predicate, CancellationToken cancellationToken)
+ private Task<RoundState> CreateRoundAwaiterAsync(uint256? roundId, Phase? phase, Predicate<RoundState>? predicate, CancellationToken cancellationToken)
{
RoundStateAwaiter? roundStateAwaiter = null;
@@ -107,19 +107,19 @@ public class RoundStateUpdater : PeriodicRunner
return roundStateAwaiter.Task;
}
- public Task<RoundState> CreateRoundAwaiter(Predicate<RoundState> predicate, CancellationToken cancellationToken)
+ public Task<RoundState> CreateRoundAwaiterAsync(Predicate<RoundState> predicate, CancellationToken cancellationToken)
{
- return CreateRoundAwaiter(null, null, predicate, cancellationToken);
+ return CreateRoundAwaiterAsync(null, null, predicate, cancellationToken);
}
- public Task<RoundState> CreateRoundAwaiter(uint256 roundId, Phase phase, CancellationToken cancellationToken)
+ public Task<RoundState> CreateRoundAwaiterAsync(uint256 roundId, Phase phase, CancellationToken cancellationToken)
{
- return CreateRoundAwaiter(roundId, phase, null, cancellationToken);
+ return CreateRoundAwaiterAsync(roundId, phase, null, cancellationToken);
}
public Task<RoundState> CreateRoundAwaiter(Phase phase, CancellationToken cancellationToken)
{
- return CreateRoundAwaiter(null, phase, null, cancellationToken);
+ return CreateRoundAwaiterAsync(null, phase, null, cancellationToken);
}
/// <summary>

Add missing `async` suffix (#9598)