Return creds from ReissueCredentialAsync
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Client/ArenaClientTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Client/ArenaClientTests.cs
@@ -99,7 +99,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Client
using var destinationKey1 = new Key();
using var destinationKey2 = new Key();
- await bobArenaClient.ReissueCredentialAsync(
+ var result = await bobArenaClient.ReissueCredentialAsync(
round.Id,
reissuanceAmounts[0],
destinationKey1.PubKey.WitHash.ScriptPubKey,
@@ -111,11 +111,11 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Client
Assert.Equal(6, amountCredentials.ZeroValue.Count());
Assert.Equal(6, vsizeCredentials.ZeroValue.Count());
- Credential amountCred1 = amountCredentials.Valuable.First(ac => ac.Amount.ToMoney().Satoshi == reissuanceAmounts[0].Satoshi);
- Credential amountCred2 = amountCredentials.Valuable.First(ac => ac.Amount.ToMoney().Satoshi == reissuanceAmounts[1].Satoshi);
+ Credential amountCred1 = result.RealAmountCredentials.ElementAt(0);
+ Credential amountCred2 = result.RealAmountCredentials.ElementAt(1);
- Credential vsizeCred1 = vsizeCredentials.Valuable.First();
- Credential vsizeCred2 = vsizeCredentials.Valuable.Last();
+ Credential vsizeCred1 = result.RealVsizeCredentials.ElementAt(0);
+ Credential vsizeCred2 = result.RealVsizeCredentials.ElementAt(1);
await bobArenaClient.RegisterOutputAsync(
round.Id,

MODIFY
WalletWasabi/WabiSabi/Client/ArenaClient.cs
WalletWasabi/WabiSabi/Client/ArenaClient.cs
@@ -110,7 +110,14 @@ namespace WalletWasabi.WabiSabi.Client
VsizeCredentialClient.HandleResponse(outputRegistrationResponse.VsizeCredentials, realVsizeCredentialResponseValidation);
}
- public async Task ReissueCredentialAsync(Guid roundId, long value1, Script scriptPubKey1, long value2, Script scriptPubKey2, IEnumerable<Credential> amountCredentialsToPresent, IEnumerable<Credential> vsizeCredentialsToPresent)
+ public async Task<(IEnumerable<Credential> RealAmountCredentials, IEnumerable<Credential> RealVsizeCredentials)> ReissueCredentialAsync(
+ Guid roundId,
+ long value1,
+ Script scriptPubKey1,
+ long value2,
+ Script scriptPubKey2,
+ IEnumerable<Credential> amountCredentialsToPresent,
+ IEnumerable<Credential> vsizeCredentialsToPresent)
{
Guard.InRange(nameof(amountCredentialsToPresent), amountCredentialsToPresent, 0, AmountCredentialClient.NumberOfCredentials);
@@ -140,10 +147,12 @@ namespace WalletWasabi.WabiSabi.Client
zeroAmountCredentialRequestData.CredentialsRequest,
zeroVsizeCredentialRequestData.CredentialsRequest)).ConfigureAwait(false);
- AmountCredentialClient.HandleResponse(reissuanceResponse.RealAmountCredentials, realAmountCredentialResponseValidation);
- VsizeCredentialClient.HandleResponse(reissuanceResponse.RealVsizeCredentials, realVsizeCredentialResponseValidation);
+ var realAmountCredentials = AmountCredentialClient.HandleResponse(reissuanceResponse.RealAmountCredentials, realAmountCredentialResponseValidation);
+ var realVsizeCredentials = VsizeCredentialClient.HandleResponse(reissuanceResponse.RealVsizeCredentials, realVsizeCredentialResponseValidation);
AmountCredentialClient.HandleResponse(reissuanceResponse.ZeroAmountCredentials, zeroAmountCredentialRequestData.CredentialsResponseValidation);
VsizeCredentialClient.HandleResponse(reissuanceResponse.ZeroVsizeCredentials, zeroVsizeCredentialRequestData.CredentialsResponseValidation);
+
+ return (realAmountCredentials, realVsizeCredentials);
}
public async Task<bool> ConfirmConnectionAsync(Guid roundId, Guid aliceId, IEnumerable<long> inputsRegistrationVsize, IEnumerable<Credential> amountCredentialsToPresent, IEnumerable<Money> newAmount)

MODIFY
WalletWasabi/WabiSabi/Crypto/WabiSabiClient.cs
WalletWasabi/WabiSabi/Crypto/WabiSabiClient.cs
@@ -194,7 +194,7 @@ namespace WalletWasabi.WabiSabi.Crypto
/// </remarks>
/// <param name="registrationResponse">The registration response message received from the coordinator.</param>
/// <param name="registrationValidationData">The state data required to validate the issued credentials and the proofs.</param>
- public void HandleResponse(CredentialsResponse registrationResponse, CredentialsResponseValidation registrationValidationData)
+ public IEnumerable<Credential> HandleResponse(CredentialsResponse registrationResponse, CredentialsResponseValidation registrationValidationData)
{
Guard.NotNull(nameof(registrationResponse), registrationResponse);
Guard.NotNull(nameof(registrationValidationData), registrationValidationData);
@@ -225,6 +225,7 @@ namespace WalletWasabi.WabiSabi.Crypto
new Credential(new Scalar((ulong)x.Requested.Amount), x.Requested.Randomness, x.Issued));
Credentials.UpdateCredentials(credentialReceived, registrationValidationData.Presented);
+ return credentialReceived;
}
private Transcript BuildTransnscript(bool isNullRequest)

Return creds from ReissueCredentialAsync