Create blame round
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/RegisterInputTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/RegisterInputTests.cs
@@ -330,7 +330,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend
WabiSabiConfig cfg = new();
var round = WabiSabiFactory.CreateRound(cfg);
round.Alices.Add(WabiSabiFactory.CreateAlice());
- Round blameRound = new(round);
+ Round blameRound = round.Blame();
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round, blameRound);
MockRpcClient rpc = new();
@@ -357,7 +357,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend
WabiSabiConfig cfg = new();
var round = WabiSabiFactory.CreateRound(cfg);
round.Alices.Add(WabiSabiFactory.CreateAlice(pair));
- Round blameRound = new(round);
+ Round blameRound = round.Blame();
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round, blameRound);
await using PostRequestHandler handler = new(cfg, new Prison(), arena, new MockRpcClient());
@@ -381,7 +381,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend
WabiSabiConfig cfg = new();
var round = WabiSabiFactory.CreateRound(cfg);
round.Alices.Add(WabiSabiFactory.CreateAlice(pair));
- Round blameRound = new(round);
+ Round blameRound = round.Blame();
using Arena arena = await WabiSabiFactory.CreateAndStartArenaAsync(cfg, round, blameRound);
await using PostRequestHandler handler = new(cfg, prison, arena, new MockRpcClient());

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/RoundCreationTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/RoundCreationTests.cs
@@ -80,7 +80,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend
var round = Assert.Single(arena.Rounds).Value;
round.SetPhase(Phase.ConnectionConfirmation);
- var blame = new Round(round);
+ var blame = round.Blame();
Assert.Equal(Phase.InputRegistration, blame.Phase);
arena.Rounds.Add(blame.Id, blame);
await arena.TriggerAndWaitRoundAsync(TimeSpan.FromSeconds(21)).ConfigureAwait(false);

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
@@ -205,6 +205,8 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
}
Rounds.Remove(round.Id);
+ var blameRound = round.Blame();
+ Rounds.Add(blameRound.Id, blameRound);
}
private async Task CreateRoundsAsync()

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Round.cs
WalletWasabi/WabiSabi/Backend/Rounds/Round.cs
@@ -33,7 +33,7 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
Hash = new(HashHelpers.GenerateSha256Hash($"{Id}{MaxInputCountByAlice}{MinRegistrableAmount}{MaxRegistrableAmount}{RegistrableWeightCredentials}{AmountCredentialIssuerParameters}{WeightCredentialIssuerParameters}{FeeRate.SatoshiPerByte}"));
}
- public Round(Round blameOf) : this(blameOf.RoundParameters)
+ private Round(Round blameOf) : this(blameOf.RoundParameters)
{
BlameOf = blameOf;
BlameWhitelist = blameOf
@@ -72,6 +72,8 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
public DateTimeOffset TransactionSigningStart { get; private set; }
public DateTimeOffset TransactionBroadcastingStart { get; private set; }
+ public Round Blame() => new Round(this);
+
public void SetPhase(Phase phase)
{
Phase = phase;

Create blame round