Fix/remove tests
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/AliceTimeoutTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/AliceTimeoutTests.cs
@@ -29,6 +29,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend
var arenaClient = WabiSabiFactory.CreateArenaClient(arena);
using RoundStateUpdater roundStateUpdater = new(TimeSpan.FromSeconds(2), new ArenaRequestHandlerAdapter(arena));
+ await roundStateUpdater.StartAsync(CancellationToken.None);
// Register Alices.
var aliceClient = new AliceClient(RoundState.FromRound(round), arenaClient, coin, key.GetBitcoinSecret(round.Network));
@@ -50,6 +51,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend
cancellationTokenSource.Cancel();
await Assert.ThrowsAsync<OperationCanceledException>(async () => await task);
+ await roundStateUpdater.StopAsync(CancellationToken.None);
await arena.StopAsync(CancellationToken.None);
}

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepOutputRegistrationTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepOutputRegistrationTests.cs
@@ -207,6 +207,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PhaseStepping
var aliceClient2 = new AliceClient(RoundState.FromRound(round), arenaClient, coin2, key2.GetBitcoinSecret(round.Network));
using RoundStateUpdater roundStateUpdater = new(TimeSpan.FromSeconds(2), new ArenaRequestHandlerAdapter(arena));
+ await roundStateUpdater.StartAsync(CancellationToken.None);
var task1 = aliceClient1.RegisterInputAsync(roundStateUpdater, CancellationToken.None);
var task2 = aliceClient2.RegisterInputAsync(roundStateUpdater, CancellationToken.None);
@@ -220,6 +221,8 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PhaseStepping
await arena.TriggerAndWaitRoundAsync(TimeSpan.FromSeconds(21));
Assert.Equal(Phase.OutputRegistration, round.Phase);
+ await roundStateUpdater.StopAsync(CancellationToken.None);
+
return (round,
arenaClient,
new[]

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepTransactionSigningTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepTransactionSigningTests.cs
@@ -244,6 +244,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PhaseStepping
var aliceClient2 = new AliceClient(RoundState.FromRound(round), arenaClient, coin2, key2.GetBitcoinSecret(round.Network));
using RoundStateUpdater roundStateUpdater = new(TimeSpan.FromSeconds(2), new ArenaRequestHandlerAdapter(arena));
+ await roundStateUpdater.StartAsync(CancellationToken.None);
var task1 = aliceClient1.RegisterInputAsync(roundStateUpdater, CancellationToken.None);
var task2 = aliceClient2.RegisterInputAsync(roundStateUpdater, CancellationToken.None);
@@ -273,6 +274,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PhaseStepping
aliceClient2.IssuedVsizeCredentials.Take(ProtocolConstants.CredentialNumber),
CancellationToken.None).ConfigureAwait(false);
+ await roundStateUpdater.StopAsync(CancellationToken.None);
return (round, aliceClient1, aliceClient2);
}
}

DELETE
WalletWasabi.Tests/UnitTests/WabiSabi/Client/AliceClientTests.cs
-using Moq;
-using NBitcoin;
-using System;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using WalletWasabi.Backend.Controllers;
-using WalletWasabi.BitcoinCore.Rpc;
-using WalletWasabi.Blockchain.TransactionOutputs;
-using WalletWasabi.Crypto.Randomness;
-using WalletWasabi.Tests.Helpers;
-using WalletWasabi.WabiSabi.Backend;
-using WalletWasabi.WabiSabi.Backend.Banning;
-using WalletWasabi.WabiSabi.Backend.PostRequests;
-using WalletWasabi.WabiSabi.Backend.Rounds;
-using WalletWasabi.WabiSabi.Client;
-using WalletWasabi.WabiSabi.Crypto;
-using WalletWasabi.WabiSabi.Models;
-using Xunit;
-
-namespace WalletWasabi.Tests.UnitTests.WabiSabi.Client
-{
- public class AliceClientTests
- {
- [Fact]
- public async Task CreateNewAsync()
- {
- var config = new WabiSabiConfig { MaxInputCountByRound = 1 };
- var round = WabiSabiFactory.CreateRound(config);
- var km = ServiceFactory.CreateKeyManager("");
- var key = BitcoinFactory.CreateHdPubKey(km);
- SmartCoin coin1 = BitcoinFactory.CreateSmartCoin(key, Money.Coins(1m));
-
- var mockRpc = WabiSabiFactory.CreatePreconfiguredRpcClient(coin1.Coin);
- using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(config, mockRpc, round);
- await arena.TriggerAndWaitRoundAsync(TimeSpan.FromMinutes(1));
-
- await using var coordinator = new ArenaRequestHandler(config, new Prison(), arena, mockRpc.Object);
- var wabiSabiApi = new WabiSabiController(coordinator);
-
- var insecureRandom = new InsecureRandom();
- var roundState = RoundState.FromRound(round);
- var arenaClient = new ArenaClient(
- roundState.CreateAmountCredentialClient(insecureRandom),
- roundState.CreateVsizeCredentialClient(insecureRandom),
- wabiSabiApi);
- Assert.Equal(Phase.InputRegistration, arena.Rounds.First().Phase);
-
- var bitcoinSecret = km.GetSecrets("", coin1.ScriptPubKey).Single().PrivateKey.GetBitcoinSecret(Network.Main);
-
- var aliceClient = new AliceClient(RoundState.FromRound(round), arenaClient, coin1.Coin, bitcoinSecret);
- using RoundStateUpdater roundStateUpdater = new(TimeSpan.FromSeconds(2), wabiSabiApi);
-
- await aliceClient.RegisterInputAsync(roundStateUpdater, CancellationToken.None);
-
- //Task confirmationTask = aliceClient.ConfirmConnectionAsync(
- // TimeSpan.FromSeconds(1),
- // new long[] { coin1.EffectiveValue(round.FeeRate) },
- // new long[] { roundState.MaxVsizeAllocationPerAlice - coin1.ScriptPubKey.EstimateInputVsize() },
- // roundStateUpdater,
- // CancellationToken.None);
-
- await arena.TriggerAndWaitRoundAsync(TimeSpan.FromMinutes(1));
- //await confirmationTask;
-
- Assert.Equal(Phase.ConnectionConfirmation, arena.Rounds.First().Phase);
- }
- }
-}

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Client/BobClientTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Client/BobClientTests.cs
@@ -52,18 +52,16 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Client
var aliceClient = new AliceClient(RoundState.FromRound(round), aliceArenaClient, coin1.Coin, bitcoinSecret);
using RoundStateUpdater roundStateUpdater = new(TimeSpan.FromSeconds(2), wabiSabiApi);
- await aliceClient.RegisterInputAsync(roundStateUpdater, CancellationToken.None);
+ await roundStateUpdater.StartAsync(CancellationToken.None);
- //Task confirmationTask = aliceClient.ConfirmConnectionAsync(
- // TimeSpan.FromSeconds(1),
- // new long[] { coin1.EffectiveValue(round.FeeRate) },
- // new long[] { roundState.MaxVsizeAllocationPerAlice - coin1.ScriptPubKey.EstimateInputVsize() },
- // roundStateUpdater,
- // CancellationToken.None);
+ var task = aliceClient.RegisterInputAsync(roundStateUpdater, CancellationToken.None);
+ do
+ {
await arena.TriggerAndWaitRoundAsync(TimeSpan.FromMinutes(1));
- //await confirmationTask;
- Assert.Equal(Phase.ConnectionConfirmation, round.Phase);
+ } while (round.Phase != Phase.ConnectionConfirmation);
+
+ await task;
await arena.TriggerAndWaitRoundAsync(TimeSpan.FromMinutes(1));
Assert.Equal(Phase.OutputRegistration, round.Phase);

Fix/remove tests