Remove ArenaRequestHandlerAdapter
MODIFY
WalletWasabi.Backend/Controllers/WabiSabiController.cs
WalletWasabi.Backend/Controllers/WabiSabiController.cs
@@ -50,7 +50,7 @@ namespace WalletWasabi.Backend.Controllers
[HttpPost("credential-issuance")]
[Idempotent]
- public Task<ReissueCredentialResponse> ReissueCredentialAsync(ReissueCredentialRequest request, CancellationToken cancellableToken)
+ public Task<ReissueCredentialResponse> ReissuanceAsync(ReissueCredentialRequest request, CancellationToken cancellableToken)
{
return RequestHandler.ReissueCredentialAsync(request, cancellableToken);
}
@@ -68,7 +68,7 @@ namespace WalletWasabi.Backend.Controllers
}
[HttpPost("ready-to-sign")]
- public Task ReadyToSign(ReadyToSignRequestRequest request, CancellationToken cancellableToken)
+ public Task ReadyToSignAsync(ReadyToSignRequestRequest request, CancellationToken cancellableToken)
{
return RequestHandler.ReadyToSignAsync(request, cancellableToken);
}

DELETE
WalletWasabi.Tests/Helpers/ArenaRequestHandlerAdapter.cs
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using WalletWasabi.WabiSabi.Backend.PostRequests;
-using WalletWasabi.WabiSabi.Backend.Rounds;
-using WalletWasabi.WabiSabi.Models;
-
-namespace WalletWasabi.Tests.Helpers
-{
- public class ArenaRequestHandlerAdapter : IWabiSabiApiRequestHandler
- {
- private readonly Arena arena;
-
- public ArenaRequestHandlerAdapter(Arena arena)
- {
- this.arena = arena;
- }
-
- public Task<ConnectionConfirmationResponse> ConfirmConnectionAsync(ConnectionConfirmationRequest request, CancellationToken cancellationToken)
- => arena.ConfirmConnectionAsync(request, cancellationToken);
-
- public Task<RoundState[]> GetStatusAsync(CancellationToken cancellationToken)
- => arena.GetStatusAsync(cancellationToken);
-
- public Task<InputRegistrationResponse> RegisterInputAsync(InputRegistrationRequest request, CancellationToken cancellationToken)
- => arena.RegisterInputAsync(request, cancellationToken);
-
- public Task RegisterOutputAsync(OutputRegistrationRequest request, CancellationToken cancellationToken)
- => arena.RegisterOutputAsync(request, cancellationToken);
-
- public Task<ReissueCredentialResponse> ReissueCredentialAsync(ReissueCredentialRequest request, CancellationToken cancellationToken)
- => arena.ReissuanceAsync(request, cancellationToken);
-
- public Task RemoveInputAsync(InputsRemovalRequest request, CancellationToken cancellationToken)
- => arena.RemoveInputAsync(request, cancellationToken);
-
- public Task SignTransactionAsync(TransactionSignaturesRequest request, CancellationToken cancellationToken)
- => arena.SignTransactionAsync(request, cancellationToken);
-
- public Task ReadyToSign(ReadyToSignRequestRequest request, CancellationToken cancellationToken)
- => arena.ReadyToSignAsync(request, cancellationToken);
- }
-}

MODIFY
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
@@ -140,7 +140,7 @@ namespace WalletWasabi.Tests.Helpers
return new ArenaClient(
roundState.CreateAmountCredentialClient(random),
roundState.CreateVsizeCredentialClient(random),
- new ArenaRequestHandlerAdapter(arena));
+ arena);
}
public static InputRegistrationRequest CreateInputRegistrationRequest(Round round, Key? key = null, OutPoint? prevout = null)

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/AliceTimeoutTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/AliceTimeoutTests.cs
@@ -32,7 +32,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, rpc, round);
var arenaClient = WabiSabiFactory.CreateArenaClient(arena);
- using RoundStateUpdater roundStateUpdater = new(TimeSpan.FromSeconds(2), new ArenaRequestHandlerAdapter(arena));
+ using RoundStateUpdater roundStateUpdater = new(TimeSpan.FromSeconds(2), arena);
await roundStateUpdater.StartAsync(CancellationToken.None);
// Register Alices.

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepOutputRegistrationTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepOutputRegistrationTests.cs
@@ -192,7 +192,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PhaseStepping
var round = Assert.Single(arena.Rounds);
round.MaxVsizeAllocationPerAlice = 11 + 31 + MultipartyTransactionParameters.SharedOverhead;
- using RoundStateUpdater roundStateUpdater = new(TimeSpan.FromSeconds(2), new ArenaRequestHandlerAdapter(arena));
+ using RoundStateUpdater roundStateUpdater = new(TimeSpan.FromSeconds(2), arena);
await roundStateUpdater.StartAsync(CancellationToken.None);
var identificationKey = new Key();
var task1 = AliceClient.CreateRegisterAndConfirmInputAsync(RoundState.FromRound(round), arenaClient, coin1, key1.GetBitcoinSecret(round.Network), identificationKey, roundStateUpdater, CancellationToken.None);

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepTransactionSigningTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepTransactionSigningTests.cs
@@ -232,7 +232,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PhaseStepping
var arenaClient = WabiSabiFactory.CreateArenaClient(arena);
// Register Alices.
- using RoundStateUpdater roundStateUpdater = new(TimeSpan.FromSeconds(2), new ArenaRequestHandlerAdapter(arena));
+ using RoundStateUpdater roundStateUpdater = new(TimeSpan.FromSeconds(2), arena);
await roundStateUpdater.StartAsync(CancellationToken.None);
using var identificationKey = new Key();

MODIFY
WalletWasabi/WabiSabi/Backend/PostRequests/IWabiSabiApiRequestHandler.cs
WalletWasabi/WabiSabi/Backend/PostRequests/IWabiSabiApiRequestHandler.cs
@@ -16,10 +16,10 @@ namespace WalletWasabi.WabiSabi.Backend.PostRequests
Task SignTransactionAsync(TransactionSignaturesRequest request, CancellationToken cancellationToken);
- Task<ReissueCredentialResponse> ReissueCredentialAsync(ReissueCredentialRequest request, CancellationToken cancellationToken);
+ Task<ReissueCredentialResponse> ReissuanceAsync(ReissueCredentialRequest request, CancellationToken cancellationToken);
Task<RoundState[]> GetStatusAsync(CancellationToken cancellationToken);
- Task ReadyToSign(ReadyToSignRequestRequest request, CancellationToken cancellationToken);
+ Task ReadyToSignAsync(ReadyToSignRequestRequest request, CancellationToken cancellationToken);
}
}

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
@@ -21,7 +21,7 @@ using WalletWasabi.WabiSabi.Backend.Rounds.Utils;
namespace WalletWasabi.WabiSabi.Backend.Rounds
{
- public class Arena : PeriodicRunner
+ public class Arena : PeriodicRunner, IWabiSabiApiRequestHandler
{
public Arena(TimeSpan period, Network network, WabiSabiConfig config, IRPCClient rpc, Prison prison, CoinJoinTransactionArchiver? archiver = null) : base(period)
{

MODIFY
WalletWasabi/WabiSabi/Client/ArenaClient.cs
WalletWasabi/WabiSabi/Client/ArenaClient.cs
@@ -118,7 +118,7 @@ namespace WalletWasabi.WabiSabi.Client
var zeroAmountCredentialRequestData = AmountCredentialClient.CreateRequestForZeroAmount();
var zeroVsizeCredentialRequestData = VsizeCredentialClient.CreateRequestForZeroAmount();
- var reissuanceResponse = await RequestHandler.ReissueCredentialAsync(
+ var reissuanceResponse = await RequestHandler.ReissuanceAsync(
new ReissueCredentialRequest(
roundId,
realAmountCredentialRequest,
@@ -224,7 +224,7 @@ namespace WalletWasabi.WabiSabi.Client
Guid aliceId,
CancellationToken cancellationToken)
{
- await RequestHandler.ReadyToSign(
+ await RequestHandler.ReadyToSignAsync(
new ReadyToSignRequestRequest(
roundId,
aliceId),

MODIFY
WalletWasabi/WabiSabi/Client/WabiSabiHttpApiClient.cs
WalletWasabi/WabiSabi/Client/WabiSabiHttpApiClient.cs
@@ -43,7 +43,7 @@ namespace WalletWasabi.WabiSabi.Client
public Task RegisterOutputAsync(OutputRegistrationRequest request, CancellationToken cancellationToken) =>
SendAndReceiveAsync<OutputRegistrationRequest>(RemoteAction.RegisterOutput, request, cancellationToken);
- public Task<ReissueCredentialResponse> ReissueCredentialAsync(ReissueCredentialRequest request, CancellationToken cancellationToken) =>
+ public Task<ReissueCredentialResponse> ReissuanceAsync(ReissueCredentialRequest request, CancellationToken cancellationToken) =>
SendAndReceiveAsync<ReissueCredentialRequest, ReissueCredentialResponse>(RemoteAction.ReissueCredential, request, cancellationToken);
public Task RemoveInputAsync(InputsRemovalRequest request, CancellationToken cancellationToken) =>
@@ -64,7 +64,7 @@ namespace WalletWasabi.WabiSabi.Client
return Deserialize<RoundState[]>(jsonString);
}
- public Task ReadyToSign(ReadyToSignRequestRequest request, CancellationToken cancellationToken) =>
+ public Task ReadyToSignAsync(ReadyToSignRequestRequest request, CancellationToken cancellationToken) =>
SendAndReceiveAsync<ReadyToSignRequestRequest>(RemoteAction.ReadyToSign, request, cancellationToken);
private async Task<string> SendAsync<TRequest>(RemoteAction action, TRequest request, CancellationToken cancellationToken) where TRequest : class

Remove ArenaRequestHandlerAdapter