Core Review suggestions
MODIFY
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
@@ -193,7 +193,7 @@ namespace WalletWasabi.Tests.Helpers
new[] { amount?.Satoshi ?? alice?.CalculateRemainingAmountCredentials(round!.FeeRate).Satoshi ?? ProtocolConstants.MaxVsizePerAlice },
zeroPresentables.amountCredentials);
var (realVsizeCredentialRequest, _) = vsClient.CreateRequest(
- new[] { vsize ?? alice?.CalculateRemainingSizeCredentials(round!.PerAliceVsizeAllocation) ?? ProtocolConstants.MaxVsizePerAlice },
+ new[] { vsize ?? alice?.CalculateRemainingVsizeCredentials(round!.PerAliceVsizeAllocation) ?? ProtocolConstants.MaxVsizePerAlice },
zeroPresentables.vsizeCredentials);
return (realAmountCredentialRequest, realVsizeCredentialRequest);
@@ -209,7 +209,7 @@ namespace WalletWasabi.Tests.Helpers
new[] { alice?.CalculateRemainingAmountCredentials(round!.FeeRate).Satoshi ?? ProtocolConstants.MaxVsizePerAlice },
zeroPresentables.amountCredentials);
var (realVsizeCredentialRequest, _) = vsClient.CreateRequest(
- new[] { alice?.CalculateRemainingSizeCredentials(round!.PerAliceVsizeAllocation) ?? ProtocolConstants.MaxVsizePerAlice },
+ new[] { alice?.CalculateRemainingVsizeCredentials(round!.PerAliceVsizeAllocation) ?? ProtocolConstants.MaxVsizePerAlice },
zeroPresentables.vsizeCredentials);
var (zeroAmountCredentialRequest, _) = amClient.CreateRequestForZeroAmount();
@@ -245,7 +245,7 @@ namespace WalletWasabi.Tests.Helpers
new[] { alice.CalculateRemainingAmountCredentials(round.FeeRate).Satoshi },
zeroPresentables.amountCredentials);
var (realVsizeCredentialRequest, weVal) = vsClient.CreateRequest(
- new[] { alice.CalculateRemainingSizeCredentials(round.PerAliceVsizeAllocation) },
+ new[] { alice.CalculateRemainingVsizeCredentials(round.PerAliceVsizeAllocation) },
zeroPresentables.vsizeCredentials);
var (zeroAmountCredentialRequest, _) = amClient.CreateRequestForZeroAmount();
@@ -274,7 +274,7 @@ namespace WalletWasabi.Tests.Helpers
var (amCredentialRequest, amValid) = amClient.CreateRequest(
new[] { alice?.CalculateRemainingAmountCredentials(round!.FeeRate).Satoshi ?? ProtocolConstants.MaxVsizePerAlice },
zeroPresentables.amountCredentials);
- long startingWeightCredentialAmount = alice?.CalculateRemainingSizeCredentials(round!.PerAliceVsizeAllocation) ?? ProtocolConstants.MaxVsizePerAlice;
+ long startingWeightCredentialAmount = alice?.CalculateRemainingVsizeCredentials(round!.PerAliceVsizeAllocation) ?? ProtocolConstants.MaxVsizePerAlice;
var (vsCredentialRequest, weValid) = vsClient.CreateRequest(
new[] { startingWeightCredentialAmount },
zeroPresentables.vsizeCredentials);
@@ -295,7 +295,7 @@ namespace WalletWasabi.Tests.Helpers
}
catch (NotImplementedException)
{
- vsize = 100; // ??
+ vsize = 25;
}
var (realVsizeCredentialRequest, _) = vsClient.CreateRequest(
@@ -316,7 +316,7 @@ namespace WalletWasabi.Tests.Helpers
foreach (var ccresp in ccresps)
{
var alice = round.Alices.First(x => x.Id == ccresp.aliceId);
- var startingVsizeCredentialAmount = alice.CalculateRemainingSizeCredentials(round!.PerAliceVsizeAllocation);
+ var startingVsizeCredentialAmount = alice.CalculateRemainingVsizeCredentials(round!.PerAliceVsizeAllocation);
var script = BitcoinFactory.CreateScript();
var vsize = script.EstimateOutputVsize();
ret.Add(new OutputRegistrationRequest(

MODIFY
WalletWasabi/WabiSabi/Backend/Models/Alice.cs
WalletWasabi/WabiSabi/Backend/Models/Alice.cs
@@ -24,7 +24,7 @@ namespace WalletWasabi.WabiSabi.Backend.Models
public int TotalInputVsize => Coins.Sum(x => x.ScriptPubKey.EstimateInputVsize());
public bool ConfirmedConnetion { get; set; } = false;
- public long CalculateRemainingSizeCredentials(uint maxRegistrableSize) => maxRegistrableSize - TotalInputVsize;
+ public long CalculateRemainingVsizeCredentials(uint maxRegistrableSize) => maxRegistrableSize - TotalInputVsize;
public Money CalculateRemainingAmountCredentials(FeeRate feeRate) => TotalInputAmount - feeRate.GetFee(TotalInputVsize);

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
@@ -315,7 +315,7 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
var realAmountCredentialRequests = request.RealAmountCredentialRequests;
var realVsizeCredentialRequests = request.RealVsizeCredentialRequests;
- if (realVsizeCredentialRequests.Delta != alice.CalculateRemainingSizeCredentials(round.PerAliceVsizeAllocation))
+ if (realVsizeCredentialRequests.Delta != alice.CalculateRemainingVsizeCredentials(round.PerAliceVsizeAllocation))
{
throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.IncorrectRequestedVsizeCredentials, $"Round ({request.RoundId}): Incorrect requested weight credentials.");
}

Core Review suggestions