Fix Excess Number of Function Arguments
MODIFY
WalletWasabi/WabiSabi/Backend/PostRequests/PostRequestHandler.cs
WalletWasabi/WabiSabi/Backend/PostRequests/PostRequestHandler.cs
@@ -111,12 +111,7 @@ namespace WalletWasabi.WabiSabi.Backend.PostRequests
throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.RoundNotFound);
}
- return round.ConfirmAlice(
- request.AliceId,
- request.ZeroAmountCredentialRequests,
- request.RealAmountCredentialRequests,
- request.ZeroWeightCredentialRequests,
- request.RealWeightCredentialRequests);
+ return round.ConfirmAlice(request);
}
}

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Round.cs
WalletWasabi/WabiSabi/Backend/Rounds/Round.cs
@@ -131,19 +131,22 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
return new(alice.Id, amountCredentialResponse, weightCredentialResponse);
}
- public ConnectionConfirmationResponse ConfirmAlice(Guid aliceId, ZeroCredentialsRequest zeroAmountCredentialRequests, RealCredentialsRequest realAmountCredentialRequests, ZeroCredentialsRequest zeroWeightCredentialRequests, RealCredentialsRequest realWeightCredentialRequests)
+ public ConnectionConfirmationResponse ConfirmAlice(ConnectionConfirmationRequest request)
{
- var amountZeroCredentialResponse = AmountCredentialIssuer.HandleRequest(zeroAmountCredentialRequests);
- var weightZeroCredentialResponse = WeightCredentialIssuer.HandleRequest(zeroWeightCredentialRequests);
+ var amountZeroCredentialResponse = AmountCredentialIssuer.HandleRequest(request.ZeroAmountCredentialRequests);
+ var weightZeroCredentialResponse = WeightCredentialIssuer.HandleRequest(request.ZeroWeightCredentialRequests);
lock (Lock)
{
- var alice = Alices.FirstOrDefault(x => x.Id == aliceId);
+ var alice = Alices.FirstOrDefault(x => x.Id == request.AliceId);
if (alice is null)
{
throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.AliceNotFound);
}
+ var realAmountCredentialRequests = request.RealAmountCredentialRequests;
+ var realWeightCredentialRequests = request.RealWeightCredentialRequests;
+
if (realWeightCredentialRequests.Delta != alice.CalculateRemainingWeightCredentials(RegistrableWeightCredentials))
{
throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.IncorrectRequestedWeightCredentials);

Fix Excess Number of Function Arguments