Request more Zerocreds
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Client/ArenaClientTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Client/ArenaClientTests.cs
@@ -92,8 +92,13 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Client
var bobArenaClient = new ArenaClient(round.AmountCredentialIssuerParameters, round.VsizeCredentialIssuerParameters, amountCredentials, vsizeCredentials, coordinator, new InsecureRandom());
+ Assert.Equal(4, amountCredentials.ZeroValue.Count());
+
await bobArenaClient.ReissueCredentialAsync(round.Id, reissuanceAmounts[0], amountCredentials.Valuable);
+ Assert.Equal(8, amountCredentials.ZeroValue.Count());
+
await bobArenaClient.ReissueCredentialAsync(round.Id, reissuanceAmounts[1], amountCredentials.Valuable);
+ Assert.Equal(12, amountCredentials.ZeroValue.Count());
var cred1 = amountCredentials.Valuable.First(ac => ac.Amount.ToMoney().Satoshi == reissuanceAmounts[0].Satoshi);
var cred2 = amountCredentials.Valuable.First(ac => ac.Amount.ToMoney().Satoshi == reissuanceAmounts[1].Satoshi);

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
@@ -471,22 +471,19 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
throw new NotImplementedException(); // TODO
}
- if (request.ZeroAmountCredentialRequests.Requested.Count() != 2)
- {
- throw new NotImplementedException(); // TODO
- }
-
if (round.Phase is not (Phase.ConnectionConfirmation or Phase.OutputRegistration))
{
throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.WrongPhase, $"Round ({request.RoundId}): Wrong phase ({round.Phase}).");
}
var commitRealAmountCredentialResponse = round.AmountCredentialIssuer.PrepareResponse(request.RealAmountCredentialRequests);
- var commitZeroAmountCredentialResponse = round.AmountCredentialIssuer.PrepareResponse(request.ZeroAmountCredentialRequests);
+ var commitZeroAmountCredentialResponse1 = round.AmountCredentialIssuer.PrepareResponse(request.ZeroAmountCredentialRequests1);
+ var commitZeroAmountCredentialResponse2 = round.AmountCredentialIssuer.PrepareResponse(request.ZeroAmountCredentialRequests2);
return new(
commitRealAmountCredentialResponse.Commit(),
- commitZeroAmountCredentialResponse.Commit()
+ commitZeroAmountCredentialResponse1.Commit(),
+ commitZeroAmountCredentialResponse2.Commit()
);
}
}

MODIFY
WalletWasabi/WabiSabi/Client/ArenaClient.cs
WalletWasabi/WabiSabi/Client/ArenaClient.cs
@@ -120,16 +120,19 @@ namespace WalletWasabi.WabiSabi.Client
new[] { value, presentedAmount - value },
amountCredentialsToPresent);
- var zeroAmountCredentialRequestData = AmountCredentialClient.CreateRequestForZeroAmount();
+ var zeroAmountCredentialRequestData1 = AmountCredentialClient.CreateRequestForZeroAmount();
+ var zeroAmountCredentialRequestData2 = AmountCredentialClient.CreateRequestForZeroAmount();
var reissuanceResponse = await RequestHandler.ReissueCredentialAsync(
new ReissueCredentialRequest(
roundId,
realAmountCredentialRequest,
- zeroAmountCredentialRequestData.CredentialsRequest)).ConfigureAwait(false);
+ zeroAmountCredentialRequestData1.CredentialsRequest,
+ zeroAmountCredentialRequestData2.CredentialsRequest)).ConfigureAwait(false);
AmountCredentialClient.HandleResponse(reissuanceResponse.RealAmountCredentials, realAmountCredentialResponseValidation);
- AmountCredentialClient.HandleResponse(reissuanceResponse.ZeroAmountCredentials, zeroAmountCredentialRequestData.CredentialsResponseValidation);
+ AmountCredentialClient.HandleResponse(reissuanceResponse.ZeroAmountCredentials1, zeroAmountCredentialRequestData1.CredentialsResponseValidation);
+ AmountCredentialClient.HandleResponse(reissuanceResponse.ZeroAmountCredentials2, zeroAmountCredentialRequestData2.CredentialsResponseValidation);
}
public async Task<bool> ConfirmConnectionAsync(Guid roundId, Guid aliceId, IEnumerable<long> inputsRegistrationVsize, IEnumerable<Credential> amountCredentialsToPresent, IEnumerable<Money> newAmount)

MODIFY
WalletWasabi/WabiSabi/Models/ReissueCredentialRequest.cs
WalletWasabi/WabiSabi/Models/ReissueCredentialRequest.cs
@@ -6,6 +6,7 @@ namespace WalletWasabi.WabiSabi.Models
public record ReissueCredentialRequest(
Guid RoundId,
RealCredentialsRequest RealAmountCredentialRequests,
- ZeroCredentialsRequest ZeroAmountCredentialRequests
+ ZeroCredentialsRequest ZeroAmountCredentialRequests1,
+ ZeroCredentialsRequest ZeroAmountCredentialRequests2
);
}

MODIFY
WalletWasabi/WabiSabi/Models/ReissueCredentialResponse.cs
WalletWasabi/WabiSabi/Models/ReissueCredentialResponse.cs
@@ -9,6 +9,7 @@ namespace WalletWasabi.WabiSabi.Models
{
public record ReissueCredentialResponse(
CredentialsResponse RealAmountCredentials,
- CredentialsResponse ZeroAmountCredentials
+ CredentialsResponse ZeroAmountCredentials1,
+ CredentialsResponse ZeroAmountCredentials2
);
}

Request more Zerocreds