Finish up alice removal skeleton
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/RemoveInputTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/RemoveInputTests.cs
@@ -16,6 +16,27 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend
{
public class RemoveInputTests
{
+ [Fact]
+ public async Task SuccessAsync()
+ {
+ MockArena arena = new();
+ WabiSabiConfig cfg = new();
+ var round = WabiSabiFactory.CreateRound(cfg);
+ var alice = WabiSabiFactory.CreateAlice();
+ round.Alices.Add(alice);
+ arena.OnTryGetRound = _ => round;
+
+ await using PostRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+
+ // There's no such alice yet, so success.
+ var req = new InputsRemovalRequest(round.Id, Guid.NewGuid());
+ handler.RemoveInput(req);
+
+ // There was the alice we want to remove so success.
+ req = new InputsRemovalRequest(round.Id, alice.Id);
+ handler.RemoveInput(req);
+ }
+
[Fact]
public async Task RoundNotFoundAsync()
{

MODIFY
WalletWasabi/WabiSabi/Backend/PostRequests/PostRequestHandler.cs
WalletWasabi/WabiSabi/Backend/PostRequests/PostRequestHandler.cs
@@ -97,12 +97,7 @@ namespace WalletWasabi.WabiSabi.Backend.PostRequests
{
throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.RoundNotFound);
}
- if (round.Phase != Phase.InputRegistration)
- {
- throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.WrongPhase);
- }
-
- throw new NotImplementedException();
+ round.RemoveAlice(request.AliceId);
}
}

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Round.cs
WalletWasabi/WabiSabi/Backend/Rounds/Round.cs
@@ -157,5 +157,17 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
return new(alice.Id, amountCredentialResponse, weightCredentialResponse);
}
+
+ internal void RemoveAlice(Guid aliceId)
+ {
+ lock (Lock)
+ {
+ if (Phase != Phase.InputRegistration)
+ {
+ throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.WrongPhase);
+ }
+ Alices.RemoveAll(x => x.Id == aliceId);
+ }
+ }
}
}

Finish up alice removal skeleton