`ArenaRequestHandler`: Remove unneeded RPC dependency.
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/AliceTimeoutTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/AliceTimeoutTests.cs
@@ -73,7 +73,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round);
var req = WabiSabiFactory.CreateConnectionConfirmationRequest(round);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
Assert.Single(round.Alices);
DateTimeOffset preDeadline = DateTimeOffset.UtcNow - TimeSpan.FromMilliseconds(1);
@@ -97,7 +97,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round);
var req = WabiSabiFactory.CreateConnectionConfirmationRequest(round);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
Assert.Single(round.Alices);
DateTimeOffset preDeadline = DateTimeOffset.UtcNow - TimeSpan.FromMilliseconds(1);
@@ -123,7 +123,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round);
var req = WabiSabiFactory.CreateConnectionConfirmationRequest(round);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
Assert.Equal(3, round.Alices.Count);
DateTimeOffset preDeadline = DateTimeOffset.UtcNow - TimeSpan.FromMilliseconds(1);
@@ -146,7 +146,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round);
var req = WabiSabiFactory.CreateConnectionConfirmationRequest(round);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
Assert.Single(round.Alices);
DateTimeOffset preDeadline = DateTimeOffset.UtcNow - TimeSpan.FromMilliseconds(1);

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PostRequests/ConfirmConnectionTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PostRequests/ConfirmConnectionTests.cs
@@ -30,7 +30,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
var req = WabiSabiFactory.CreateConnectionConfirmationRequest(round);
var minAliceDeadline = DateTimeOffset.UtcNow + cfg.ConnectionConfirmationTimeout * 0.9;
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var resp = await handler.ConfirmConnectionAsync(req, CancellationToken.None);
Assert.NotNull(resp);
Assert.NotNull(resp.ZeroAmountCredentials);
@@ -57,7 +57,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round);
var req = WabiSabiFactory.CreateConnectionConfirmationRequest(round);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var resp = await handler.ConfirmConnectionAsync(req, CancellationToken.None);
Assert.NotNull(resp);
Assert.NotNull(resp.ZeroAmountCredentials);
@@ -76,7 +76,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
var cfg = new WabiSabiConfig();
var nonExistingRound = WabiSabiFactory.CreateRound(cfg);
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync();
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var req = WabiSabiFactory.CreateConnectionConfirmationRequest(nonExistingRound);
var ex = await Assert.ThrowsAsync<WabiSabiProtocolException>(
@@ -98,7 +98,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
await arena.TriggerAndWaitRoundAsync(TimeSpan.FromSeconds(21)).ConfigureAwait(false);
var req = WabiSabiFactory.CreateConnectionConfirmationRequest(round);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
foreach (Phase phase in Enum.GetValues(typeof(Phase)))
{
if (phase != Phase.InputRegistration && phase != Phase.ConnectionConfirmation)
@@ -124,7 +124,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round);
var req = WabiSabiFactory.CreateConnectionConfirmationRequest(round);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var ex = await Assert.ThrowsAsync<WabiSabiProtocolException>(async () => await handler.ConfirmConnectionAsync(req, CancellationToken.None));
Assert.Equal(WabiSabiProtocolErrorCode.AliceNotFound, ex.ErrorCode);
@@ -145,7 +145,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
var incorrectVsizeCredentials = WabiSabiFactory.CreateRealCredentialRequests(round, null, 234).vsizeRequest;
var req = WabiSabiFactory.CreateConnectionConfirmationRequest(round) with { RealVsizeCredentialRequests = incorrectVsizeCredentials };
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var ex = await Assert.ThrowsAsync<WabiSabiProtocolException>(async () => await handler.ConfirmConnectionAsync(req, CancellationToken.None));
Assert.Equal(WabiSabiProtocolErrorCode.IncorrectRequestedVsizeCredentials, ex.ErrorCode);
Assert.False(alice.ConfirmedConnection);
@@ -166,7 +166,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
var incorrectAmountCredentials = WabiSabiFactory.CreateRealCredentialRequests(round, Money.Coins(3), null).amountRequest;
var req = WabiSabiFactory.CreateConnectionConfirmationRequest(round) with { RealAmountCredentialRequests = incorrectAmountCredentials };
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var ex = await Assert.ThrowsAsync<WabiSabiProtocolException>(async () => await handler.ConfirmConnectionAsync(req, CancellationToken.None));
Assert.Equal(WabiSabiProtocolErrorCode.IncorrectRequestedAmountCredentials, ex.ErrorCode);
Assert.False(alice.ConfirmedConnection);
@@ -208,7 +208,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
// invalidate serial numbers
issuer.HandleRequest(credentialsRequest);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var ex = await Assert.ThrowsAsync<WabiSabiCryptoException>(async () => await handler.ConfirmConnectionAsync(req, CancellationToken.None));
Assert.Equal(WabiSabiCryptoErrorCode.SerialNumberAlreadyUsed, ex.ErrorCode);
Assert.False(alice.ConfirmedConnection);

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PostRequests/RegisterInputFailureTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PostRequests/RegisterInputFailureTests.cs
@@ -48,7 +48,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
var round = arena.Rounds.First();
using Key key = new();
var req = WabiSabiFactory.CreateInputRegistrationRequest(round, key: key);
- await using ArenaRequestHandler handler = new(cfg, new(), arena, WabiSabiFactory.CreatePreconfiguredRpcClient().Object);
+ await using ArenaRequestHandler handler = new(cfg, new(), arena);
foreach (Phase phase in Enum.GetValues(typeof(Phase)))
{

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PostRequests/RegisterInputToBlameRoundTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PostRequests/RegisterInputToBlameRoundTests.cs
@@ -25,7 +25,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
using Key key = new();
var mockRpc = WabiSabiFactory.CreatePreconfiguredRpcClient();
- await using ArenaRequestHandler handler = new(cfg, new(), arena, mockRpc.Object);
+ await using ArenaRequestHandler handler = new(cfg, new(), arena);
var req = WabiSabiFactory.CreateInputRegistrationRequest(round: blameRound);
var ex = await Assert.ThrowsAsync<WabiSabiProtocolException>(async () => await handler.RegisterInputAsync(req, CancellationToken.None));
Assert.Equal(WabiSabiProtocolErrorCode.InputNotWhitelisted, ex.ErrorCode);
@@ -43,7 +43,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
Round blameRound = WabiSabiFactory.CreateBlameRound(round, cfg);
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round, blameRound);
- await using ArenaRequestHandler handler = new(cfg, new(), arena, WabiSabiFactory.CreatePreconfiguredRpcClient().Object);
+ await using ArenaRequestHandler handler = new(cfg, new(), arena);
var req = WabiSabiFactory.CreateInputRegistrationRequest(prevout: alice.Coin.Outpoint, round: blameRound);
var ex = await Assert.ThrowsAnyAsync<Exception>(async () => await handler.RegisterInputAsync(req, CancellationToken.None));
@@ -73,7 +73,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
using Arena arena = await ArenaBuilder.From(cfg, mockRpc, prison).CreateAndStartAsync(round, blameRound);
prison.Punish(bannedCoin, Punishment.Banned, uint256.Zero);
- await using ArenaRequestHandler handler = new(cfg, prison, arena, mockRpc.Object);
+ await using ArenaRequestHandler handler = new(cfg, prison, arena);
var req = WabiSabiFactory.CreateInputRegistrationRequest(key: key, round: blameRound, prevout: bannedCoin);
var ex = await Assert.ThrowsAsync<WabiSabiProtocolException>(async () => await handler.RegisterInputAsync(req, CancellationToken.None));

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PostRequests/RegisterOutputTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PostRequests/RegisterOutputTests.cs
@@ -24,7 +24,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
round.SetPhase(Phase.OutputRegistration);
round.Alices.Add(WabiSabiFactory.CreateAlice(round));
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var req = WabiSabiFactory.CreateOutputRegistrationRequest(round);
await handler.RegisterOutputAsync(req, CancellationToken.None);
@@ -39,7 +39,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
var cfg = new WabiSabiConfig();
var nonExistingRound = WabiSabiFactory.CreateRound(cfg);
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync();
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var req = WabiSabiFactory.CreateOutputRegistrationRequest(nonExistingRound);
var ex = await Assert.ThrowsAsync<WabiSabiProtocolException>(async () => await handler.RegisterOutputAsync(req, CancellationToken.None));
Assert.Equal(WabiSabiProtocolErrorCode.RoundNotFound, ex.ErrorCode);
@@ -61,7 +61,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
round.Alices.Add(WabiSabiFactory.CreateAlice(Money.Coins(1), round));
var req = WabiSabiFactory.CreateOutputRegistrationRequest(round, key.PubKey.GetAddress(ScriptPubKeyType.Legacy, Network.Main).ScriptPubKey);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var ex = await Assert.ThrowsAsync<WabiSabiProtocolException>(async () => await handler.RegisterOutputAsync(req, CancellationToken.None));
Assert.Equal(WabiSabiProtocolErrorCode.ScriptNotAllowed, ex.ErrorCode);
@@ -81,7 +81,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
var sha256Bounty = Script.FromHex("aa20000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f87");
var req = WabiSabiFactory.CreateOutputRegistrationRequest(round, sha256Bounty);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var ex = await Assert.ThrowsAsync<WabiSabiProtocolException>(async () => await handler.RegisterOutputAsync(req, CancellationToken.None));
// The following assertion requires standardness to be checked before allowed script types
@@ -98,7 +98,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
round.SetPhase(Phase.OutputRegistration);
round.Alices.Add(WabiSabiFactory.CreateAlice(Money.Coins(1), round));
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var req = WabiSabiFactory.CreateOutputRegistrationRequest(round);
@@ -116,7 +116,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
round.SetPhase(Phase.OutputRegistration);
round.Alices.Add(WabiSabiFactory.CreateAlice(Money.Coins(2), round));
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var req = WabiSabiFactory.CreateOutputRegistrationRequest(round);
@@ -134,7 +134,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
round.SetPhase(Phase.OutputRegistration);
round.Alices.Add(WabiSabiFactory.CreateAlice(round));
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var req = WabiSabiFactory.CreateOutputRegistrationRequest(round, vsize: 30);
@@ -149,7 +149,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
{
WabiSabiConfig cfg = new();
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
await arena.TriggerAndWaitRoundAsync(TimeSpan.FromSeconds(21));
var round = arena.Rounds.First();
round.MaxVsizeAllocationPerAlice = 11 + 31 + MultipartyTransactionParameters.SharedOverhead;

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PostRequests/RemoveInputTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PostRequests/RemoveInputTests.cs
@@ -30,7 +30,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
// There's no such alice yet, so success.
var req = new InputsRemovalRequest(round.Id, Guid.NewGuid());
@@ -52,7 +52,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
{
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync();
- await using ArenaRequestHandler handler = new(new WabiSabiConfig(), new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(new WabiSabiConfig(), new Prison(), arena);
var req = new InputsRemovalRequest(uint256.Zero, Guid.NewGuid());
var ex = await Assert.ThrowsAsync<WabiSabiProtocolException>(async () => await handler.RemoveInputAsync(req, CancellationToken.None));
Assert.Equal(WabiSabiProtocolErrorCode.RoundNotFound, ex.ErrorCode);
@@ -74,7 +74,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
if (phase != Phase.InputRegistration)
{
round.SetPhase(phase);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var ex = await Assert.ThrowsAsync<WabiSabiProtocolException>(async () => await handler.RemoveInputAsync(req, CancellationToken.None));
Assert.Equal(WabiSabiProtocolErrorCode.WrongPhase, ex.ErrorCode);
}

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PostRequests/SignTransactionTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PostRequests/SignTransactionTests.cs
@@ -33,7 +33,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
aliceSignedCoinJoin.Sign(key.GetBitcoinSecret(Network.Main), alice.Coin);
var req = new TransactionSignaturesRequest(round.Id, new[] { new InputWitnessPair(0, aliceSignedCoinJoin.Inputs[0].WitScript) });
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
await handler.SignTransactionAsync(req, CancellationToken.None);
Assert.True(round.Assert<SigningState>().IsFullySigned);
await arena.StopAsync(CancellationToken.None);
@@ -43,7 +43,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
public async Task RoundNotFoundAsync()
{
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync();
- await using ArenaRequestHandler handler = new(new WabiSabiConfig(), new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(new WabiSabiConfig(), new Prison(), arena);
var req = new TransactionSignaturesRequest(uint256.Zero, null!);
var ex = await Assert.ThrowsAsync<WabiSabiProtocolException>(async () => await handler.SignTransactionAsync(req, CancellationToken.None));
Assert.Equal(WabiSabiProtocolErrorCode.RoundNotFound, ex.ErrorCode);
@@ -64,7 +64,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PostRequests
if (phase != Phase.TransactionSigning)
{
round.SetPhase(phase);
- await using ArenaRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
+ await using ArenaRequestHandler handler = new(cfg, new Prison(), arena);
var ex = await Assert.ThrowsAsync<WabiSabiProtocolException>(async () =>
await handler.SignTransactionAsync(req, CancellationToken.None));
Assert.Equal(WabiSabiProtocolErrorCode.WrongPhase, ex.ErrorCode);

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/RequestHandlerDisposeTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/RequestHandlerDisposeTests.cs
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading;
using System.Threading.Tasks;
using WalletWasabi.Tests.Helpers;
@@ -9,7 +6,6 @@ using WalletWasabi.WabiSabi.Backend;
using WalletWasabi.WabiSabi.Backend.Banning;
using WalletWasabi.WabiSabi.Backend.PostRequests;
using WalletWasabi.WabiSabi.Backend.Rounds;
-using WalletWasabi.WabiSabi.Models;
using Xunit;
namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend
@@ -20,7 +16,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend
public async Task DisposeGuardAsync()
{
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync();
- ArenaRequestHandler handler = new(new WabiSabiConfig(), new Prison(), arena, new MockRpcClient());
+ ArenaRequestHandler handler = new(new WabiSabiConfig(), new Prison(), arena);
await handler.DisposeAsync();
await Assert.ThrowsAsync<ObjectDisposedException>(async () => await handler.RegisterInputAsync(null!, CancellationToken.None));

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Client/ArenaClientTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Client/ArenaClientTests.cs
@@ -61,7 +61,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Client
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);
+ await using var coordinator = new ArenaRequestHandler(config, new Prison(), arena);
var wabiSabiApi = new WabiSabiController(coordinator);
var insecureRandom = new InsecureRandom();
var roundState = RoundState.FromRound(round);
@@ -176,7 +176,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Client
round.Alices.Add(alice);
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(config, round);
- await using var coordinator = new ArenaRequestHandler(config, new Prison(), arena, arena.Rpc);
+ await using var coordinator = new ArenaRequestHandler(config, new Prison(), arena);
var wabiSabiApi = new WabiSabiController(coordinator);
var apiClient = new ArenaClient(null!, null!, wabiSabiApi);
@@ -203,7 +203,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Client
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(config, round);
var mockRpc = new Mock<IRPCClient>();
- await using var coordinator = new ArenaRequestHandler(config, new Prison(), arena, mockRpc.Object);
+ await using var coordinator = new ArenaRequestHandler(config, new Prison(), arena);
var wabiSabiApi = new WabiSabiController(coordinator);
var rnd = new InsecureRandom();

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Client/BobClientTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Client/BobClientTests.cs
@@ -33,7 +33,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Client
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);
+ await using var coordinator = new ArenaRequestHandler(config, new Prison(), arena);
var insecureRandom = new InsecureRandom();
var wabiSabiApi = new WabiSabiController(coordinator);
var roundState = RoundState.FromRound(round);

MODIFY
WalletWasabi/WabiSabi/Backend/PostRequests/ArenaRequestHandler.cs
WalletWasabi/WabiSabi/Backend/PostRequests/ArenaRequestHandler.cs
-using NBitcoin;
using System;
using System.Threading;
using System.Threading.Tasks;
-using WalletWasabi.BitcoinCore.Rpc;
using WalletWasabi.Nito.AsyncEx;
using WalletWasabi.WabiSabi.Backend.Banning;
using WalletWasabi.WabiSabi.Backend.Rounds;
@@ -12,13 +10,11 @@ namespace WalletWasabi.WabiSabi.Backend.PostRequests
{
public class ArenaRequestHandler : IAsyncDisposable
{
- public ArenaRequestHandler(WabiSabiConfig config, Prison prison, Arena arena, IRPCClient rpc)
+ public ArenaRequestHandler(WabiSabiConfig config, Prison prison, Arena arena)
{
Config = config;
Prison = prison;
Arena = arena;
- Rpc = rpc;
- Network = rpc.Network;
}
private bool DisposeStarted { get; set; } = false;
@@ -27,8 +23,6 @@ namespace WalletWasabi.WabiSabi.Backend.PostRequests
public WabiSabiConfig Config { get; }
public Prison Prison { get; }
public Arena Arena { get; }
- public IRPCClient Rpc { get; }
- public Network Network { get; }
public async Task<InputRegistrationResponse> RegisterInputAsync(InputRegistrationRequest request, CancellationToken cancellationToken)
{

MODIFY
WalletWasabi/WabiSabi/WabiSabiCoordinator.cs
WalletWasabi/WabiSabi/WabiSabiCoordinator.cs
@@ -28,7 +28,7 @@ namespace WalletWasabi.WabiSabi
Arena = new(parameters.RoundProgressSteppingPeriod, rpc.Network, Config, rpc, Prison);
- Postman = new(Config, Prison, Arena, Rpc);
+ Postman = new(Config, Prison, Arena);
}
public ConfigWatcher ConfigWatcher { get; }

`ArenaRequestHandler`: Remove unneeded RPC dependency.