Remove currentdenom, (so denom gets serialized)
MODIFY
WalletWasabi.Tests/RegTests.cs
WalletWasabi.Tests/RegTests.cs
@@ -1697,19 +1697,19 @@ namespace WalletWasabi.Tests
httpRequestException = await Assert.ThrowsAsync<HttpRequestException>(async () => await AliceClient.CreateNewAsync(network, inputsRequest, baseUri));
Assert.StartsWith($"{HttpStatusCode.BadRequest.ToReasonString()}\nNot enough inputs are provided. Fee to pay:", httpRequestException.Message);
- roundConfig.SetDenomination(Money.Coins(0.01m)); // exactly the same as our output
+ roundConfig.Denomination = Money.Coins(0.01m); // exactly the same as our output
coordinator.UpdateRoundConfig(roundConfig);
coordinator.AbortAllRoundsInInputRegistration(nameof(RegTests), "");
httpRequestException = await Assert.ThrowsAsync<HttpRequestException>(async () => await AliceClient.CreateNewAsync(network, inputsRequest, baseUri));
Assert.StartsWith($"{HttpStatusCode.BadRequest.ToReasonString()}\nNot enough inputs are provided. Fee to pay:", httpRequestException.Message);
- roundConfig.SetDenomination(Money.Coins(0.00999999m)); // one satoshi less than our output
+ roundConfig.Denomination = Money.Coins(0.00999999m); // one satoshi less than our output
coordinator.UpdateRoundConfig(roundConfig);
coordinator.AbortAllRoundsInInputRegistration(nameof(RegTests), "");
httpRequestException = await Assert.ThrowsAsync<HttpRequestException>(async () => await AliceClient.CreateNewAsync(network, inputsRequest, baseUri));
Assert.StartsWith($"{HttpStatusCode.BadRequest.ToReasonString()}\nNot enough inputs are provided. Fee to pay:", httpRequestException.Message);
- roundConfig.SetDenomination(Money.Coins(0.008m)); // one satoshi less than our output
+ roundConfig.Denomination = Money.Coins(0.008m); // one satoshi less than our output
roundConfig.ConnectionConfirmationTimeout = 2;
coordinator.UpdateRoundConfig(roundConfig);
coordinator.AbortAllRoundsInInputRegistration(nameof(RegTests), "");
@@ -2545,7 +2545,7 @@ namespace WalletWasabi.Tests
Assert.True(2 * feeRateReal.FeePerK > feeRateTx.FeePerK); // Max 200% mistake.
var activeOutput = finalCoinjoin.GetIndistinguishableOutputs().OrderByDescending(x => x.count).First();
- Assert.True(activeOutput.value >= roundConfig.CurrentDenomination);
+ Assert.True(activeOutput.value >= roundConfig.Denomination);
Assert.True(activeOutput.value >= roundConfig.AnonymitySet);
foreach (var aliceClient in aliceClients)

MODIFY
WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
@@ -131,7 +131,7 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
UtxoReferee = Guard.NotNull(nameof(utxoReferee), utxoReferee);
Guard.NotNull(nameof(config), config);
- Denomination = config.CurrentDenomination;
+ Denomination = config.Denomination;
ConfirmationTarget = (int)config.ConfirmationTarget;
CoordinatorFeePercent = (decimal)config.CoordinatorFeePercent;
AnonymitySet = (int)config.AnonymitySet;

MODIFY
WalletWasabi/Models/ChaumianCoinJoin/CcjRoundConfig.cs
WalletWasabi/Models/ChaumianCoinJoin/CcjRoundConfig.cs
@@ -14,32 +14,12 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
[JsonObject(MemberSerialization.OptIn)]
public class CcjRoundConfig : IConfig
{
- private Money _denomination;
-
/// <inheritdoc />
public string FilePath { get; internal set; }
- public Money CurrentDenomination { get; internal set; }
-
[JsonProperty(PropertyName = "Denomination")]
[JsonConverter(typeof(MoneyBtcJsonConverter))]
- private Money Denomination
- {
- get => _denomination;
- set
- {
- if (value != _denomination)
- {
- _denomination = value;
- CurrentDenomination = value;
- }
- }
- }
-
- internal void SetDenomination(Money denomination)
- {
- Denomination = denomination;
- }
+ public Money Denomination { get; internal set; }
[JsonProperty(PropertyName = "ConfirmationTarget")]
public int? ConfirmationTarget { get; internal set; }

MODIFY
WalletWasabi/Services/CcjCoordinator.cs
WalletWasabi/Services/CcjCoordinator.cs
@@ -240,11 +240,12 @@ namespace WalletWasabi.Services
feePerOutputs = fees.feePerOutputs;
Money newDenominationToGetInWithactiveOutputs = activeOutputAmount - (feePerInputs + 2 * feePerOutputs);
- if (newDenominationToGetInWithactiveOutputs < RoundConfig.CurrentDenomination)
+ if (newDenominationToGetInWithactiveOutputs < RoundConfig.Denomination)
{
if (newDenominationToGetInWithactiveOutputs > Money.Coins(0.01m))
{
- RoundConfig.CurrentDenomination = newDenominationToGetInWithactiveOutputs;
+ RoundConfig.Denomination = newDenominationToGetInWithactiveOutputs;
+ await RoundConfig.ToFileAsync();
}
}
}

Remove currentdenom, (so denom gets serialized)