Remove obsolete `ConfirmConnectionAsync` method
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepOutputRegistrationTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepOutputRegistrationTests.cs
@@ -217,8 +217,17 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PhaseStepping
Assert.Equal(Phase.ConnectionConfirmation, round.Phase);
// Confirm connections.
- await aliceClient1.ConfirmConnectionAsync(TimeSpan.FromSeconds(1), round.MaxVsizeAllocationPerAlice, CancellationToken.None).ConfigureAwait(false);
- await aliceClient2.ConfirmConnectionAsync(TimeSpan.FromSeconds(1), round.MaxVsizeAllocationPerAlice, CancellationToken.None).ConfigureAwait(false);
+ await aliceClient1.ConfirmConnectionAsync(
+ TimeSpan.FromSeconds(1),
+ new long[] { coin1.EffectiveValue(round.FeeRate) },
+ new long[] { round.MaxVsizeAllocationPerAlice - coin1.ScriptPubKey.EstimateInputVsize() },
+ CancellationToken.None).ConfigureAwait(false);
+
+ await aliceClient2.ConfirmConnectionAsync(
+ TimeSpan.FromSeconds(1),
+ new long[] { coin2.EffectiveValue(round.FeeRate) },
+ new long[] { round.MaxVsizeAllocationPerAlice - coin2.ScriptPubKey.EstimateInputVsize() },
+ CancellationToken.None).ConfigureAwait(false);
await arena.TriggerAndWaitRoundAsync(TimeSpan.FromSeconds(21));
Assert.Equal(Phase.OutputRegistration, round.Phase);

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepTransactionSigningTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepTransactionSigningTests.cs
@@ -240,8 +240,17 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PhaseStepping
Assert.Equal(Phase.ConnectionConfirmation, round.Phase);
// Confirm connections.
- await aliceClient1.ConfirmConnectionAsync(TimeSpan.FromMilliseconds(100), round.MaxVsizeAllocationPerAlice, CancellationToken.None).ConfigureAwait(false);
- await aliceClient2.ConfirmConnectionAsync(TimeSpan.FromMilliseconds(100), round.MaxVsizeAllocationPerAlice, CancellationToken.None).ConfigureAwait(false);
+ await aliceClient1.ConfirmConnectionAsync(
+ TimeSpan.FromMilliseconds(100),
+ new long[] { coin1.EffectiveValue(round.FeeRate) },
+ new long[] { round.MaxVsizeAllocationPerAlice - coin1.ScriptPubKey.EstimateInputVsize() },
+ CancellationToken.None).ConfigureAwait(false);
+
+ await aliceClient2.ConfirmConnectionAsync(
+ TimeSpan.FromMilliseconds(100),
+ new long[] { coin2.EffectiveValue(round.FeeRate) },
+ new long[] { round.MaxVsizeAllocationPerAlice - coin2.ScriptPubKey.EstimateInputVsize() },
+ CancellationToken.None).ConfigureAwait(false);
await arena.TriggerAndWaitRoundAsync(TimeSpan.FromSeconds(21));
Assert.Equal(Phase.OutputRegistration, round.Phase);

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Client/AliceClientTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Client/AliceClientTests.cs
@@ -51,7 +51,11 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Client
var aliceClient = new AliceClient(round.Id, arenaClient, coin1.Coin, round.FeeRate, bitcoinSecret);
await aliceClient.RegisterInputAsync(CancellationToken.None);
- Task confirmationTask = aliceClient.ConfirmConnectionAsync(TimeSpan.FromSeconds(1), roundState.MaxVsizeAllocationPerAlice, CancellationToken.None);
+ Task confirmationTask = aliceClient.ConfirmConnectionAsync(
+ TimeSpan.FromSeconds(1),
+ new long[] { coin1.EffectiveValue(round.FeeRate) },
+ new long[] { roundState.MaxVsizeAllocationPerAlice - coin1.ScriptPubKey.EstimateInputVsize() },
+ CancellationToken.None);
await arena.TriggerAndWaitRoundAsync(TimeSpan.FromMinutes(1));
await confirmationTask;

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Client/BobClientTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Client/BobClientTests.cs
@@ -52,7 +52,11 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Client
var aliceClient = new AliceClient(round.Id, aliceArenaClient, coin1.Coin, round.FeeRate, bitcoinSecret);
await aliceClient.RegisterInputAsync(CancellationToken.None);
- Task confirmationTask = aliceClient.ConfirmConnectionAsync(TimeSpan.FromSeconds(1), roundState.MaxVsizeAllocationPerAlice, CancellationToken.None);
+ Task confirmationTask = aliceClient.ConfirmConnectionAsync(
+ TimeSpan.FromSeconds(1),
+ new long[] { coin1.EffectiveValue(round.FeeRate) },
+ new long[] { roundState.MaxVsizeAllocationPerAlice - coin1.ScriptPubKey.EstimateInputVsize() },
+ CancellationToken.None);
await arena.TriggerAndWaitRoundAsync(TimeSpan.FromMinutes(1));
await confirmationTask;

MODIFY
WalletWasabi/WabiSabi/Client/AliceClient.cs
WalletWasabi/WabiSabi/Client/AliceClient.cs
@@ -48,18 +48,6 @@ namespace WalletWasabi.WabiSabi.Client
Logger.LogInfo($"Round ({RoundId}), Alice ({AliceId}): Registered an input.");
}
- [ObsoleteAttribute("This method should be removed after making the tests using the overload.")]
- public async Task ConfirmConnectionAsync(TimeSpan connectionConfirmationTimeout, long vsizeAllocation, CancellationToken cancellationToken)
- {
- var inputVsize = Coin.ScriptPubKey.EstimateInputVsize();
-
- var totalFeeToPay = FeeRate.GetFee(Coin.ScriptPubKey.EstimateInputVsize());
- var totalAmount = Coin.Amount;
- var effectiveAmount = totalAmount - totalFeeToPay;
-
- await ConfirmConnectionAsync(connectionConfirmationTimeout, new long[] { effectiveAmount }, new long[] { vsizeAllocation - inputVsize }, cancellationToken).ConfigureAwait(false);
- }
-
public async Task ConfirmConnectionAsync(TimeSpan connectionConfirmationTimeout, IEnumerable<long> amountsToRequest, IEnumerable<long> vsizesToRequest, CancellationToken cancellationToken)
{
while (!await TryConfirmConnectionAsync(amountsToRequest, vsizesToRequest, cancellationToken).ConfigureAwait(false))

Remove obsolete `ConfirmConnectionAsync` method