`CredentialClient` methods return record type
MODIFY
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
@@ -320,8 +320,8 @@ namespace WalletWasabi.Tests.Helpers
ret.Add(new OutputRegistrationRequest(
round.Id,
script,
- ccresp.amountClient.CreateRequest(Array.Empty<long>(), ccresp.amountClient.Credentials.Valuable).Item1,
- ccresp.weightClient.CreateRequest(new[] { startingWeightCredentialAmount - weight }, ccresp.weightClient.Credentials.Valuable).Item1));
+ ccresp.amountClient.CreateRequest(Array.Empty<long>(), ccresp.amountClient.Credentials.Valuable).CredentialsRequest,
+ ccresp.weightClient.CreateRequest(new[] { startingWeightCredentialAmount - weight }, ccresp.weightClient.Credentials.Valuable).CredentialsRequest));
}
return ret;

MODIFY
WalletWasabi/WabiSabi/Client/ArenaClient.cs
WalletWasabi/WabiSabi/Client/ArenaClient.cs
@@ -67,51 +67,51 @@ namespace WalletWasabi.WabiSabi.Client
.Zip(keys, (outPoint, key) => (outPoint, key))
.Select(x => new InputRoundSignaturePair(x.outPoint, GenerateOwnershipProof(x.key, roundHash)));
- var (zeroAmountCredentialRequest, zeroAmountCredentialResponseValidation) = AmountCredentialClient.CreateRequestForZeroAmount();
- var (zeroWeightCredentialRequest, zeroWeightCredentialResponseValidation) = WeightCredentialClient.CreateRequestForZeroAmount();
+ var zeroAmountCredentialRequestData = AmountCredentialClient.CreateRequestForZeroAmount();
+ var zeroWeightCredentialRequestData = WeightCredentialClient.CreateRequestForZeroAmount();
var inputRegistrationResponse = await RequestHandler.RegisterInputAsync(
new InputsRegistrationRequest(
roundId,
registrableInputs,
- zeroAmountCredentialRequest,
- zeroWeightCredentialRequest)).ConfigureAwait(false);
+ zeroAmountCredentialRequestData.CredentialsRequest,
+ zeroWeightCredentialRequestData.CredentialsRequest)).ConfigureAwait(false);
- AmountCredentialClient.HandleResponse(inputRegistrationResponse.AmountCredentials, zeroAmountCredentialResponseValidation);
- WeightCredentialClient.HandleResponse(inputRegistrationResponse.WeightCredentials, zeroWeightCredentialResponseValidation);
+ AmountCredentialClient.HandleResponse(inputRegistrationResponse.AmountCredentials, zeroAmountCredentialRequestData.CredentialsResponseValidation);
+ WeightCredentialClient.HandleResponse(inputRegistrationResponse.WeightCredentials, zeroWeightCredentialRequestData.CredentialsResponseValidation);
return inputRegistrationResponse.AliceId;
}
public async Task ConfirmConnectionAsync(Guid roundId, Guid aliceId, IEnumerable<long> inputsRegistrationWeight, IEnumerable<Credential> credentialsToPresent, IEnumerable<Money> newAmount)
{
- var (realAmountCredentialRequest, realAmountCredentialResponseValidation) = AmountCredentialClient.CreateRequest(
+ var realAmountCredentialRequestData = AmountCredentialClient.CreateRequest(
newAmount.Select(x => x.Satoshi),
credentialsToPresent);
- var (realWeightCredentialRequest, realWeightCredentialResponseValidation) = WeightCredentialClient.CreateRequest(
+ var realWeightCredentialRequestData = WeightCredentialClient.CreateRequest(
inputsRegistrationWeight,
WeightCredentialClient.Credentials.ZeroValue.Take(2));
- var (zeroAmountCredentialRequest, zeroAmountCredentialResponseValidation) = AmountCredentialClient.CreateRequestForZeroAmount();
- var (zeroWeightCredentialRequest, zeroWeightCredentialResponseValidation) = WeightCredentialClient.CreateRequestForZeroAmount();
+ var zeroAmountCredentialRequestData = AmountCredentialClient.CreateRequestForZeroAmount();
+ var zeroWeightCredentialRequestData = WeightCredentialClient.CreateRequestForZeroAmount();
var confirmConnectionResponse = await RequestHandler.ConfirmConnectionAsync(
new ConnectionConfirmationRequest(
roundId,
aliceId,
- zeroAmountCredentialRequest,
- realAmountCredentialRequest,
- zeroWeightCredentialRequest,
- realWeightCredentialRequest)).ConfigureAwait(false);
+ zeroAmountCredentialRequestData.CredentialsRequest,
+ realAmountCredentialRequestData.CredentialsRequest,
+ zeroWeightCredentialRequestData.CredentialsRequest,
+ realWeightCredentialRequestData.CredentialsRequest)).ConfigureAwait(false);
if (confirmConnectionResponse is { RealAmountCredentials: { }, RealWeightCredentials: { } })
{
- AmountCredentialClient.HandleResponse(confirmConnectionResponse.RealAmountCredentials, realAmountCredentialResponseValidation);
- WeightCredentialClient.HandleResponse(confirmConnectionResponse.RealWeightCredentials, realWeightCredentialResponseValidation);
+ AmountCredentialClient.HandleResponse(confirmConnectionResponse.RealAmountCredentials, realAmountCredentialRequestData.CredentialsResponseValidation);
+ WeightCredentialClient.HandleResponse(confirmConnectionResponse.RealWeightCredentials, realWeightCredentialRequestData.CredentialsResponseValidation);
}
- AmountCredentialClient.HandleResponse(confirmConnectionResponse.ZeroAmountCredentials, zeroAmountCredentialResponseValidation);
- WeightCredentialClient.HandleResponse(confirmConnectionResponse.ZeroWeightCredentials, zeroWeightCredentialResponseValidation);
+ AmountCredentialClient.HandleResponse(confirmConnectionResponse.ZeroAmountCredentials, zeroAmountCredentialRequestData.CredentialsResponseValidation);
+ WeightCredentialClient.HandleResponse(confirmConnectionResponse.ZeroWeightCredentials, zeroWeightCredentialRequestData.CredentialsResponseValidation);
}
public async Task SignTransactionAsync(Guid roundId, IEnumerable<ICoin> coinsToSign, BitcoinSecret bitcoinSecret, Transaction unsignedCoinJoin)

MODIFY
WalletWasabi/WabiSabi/Crypto/CredentialRequesting/CredentialsResponseValidation.cs
WalletWasabi/WabiSabi/Crypto/CredentialRequesting/CredentialsResponseValidation.cs
@@ -7,7 +7,7 @@ namespace WalletWasabi.WabiSabi.Crypto.CredentialRequesting
/// Maintains the state needed to validate the credentials once the coordinator
/// issues them.
/// </summary>
- public class CredentialsResponseValidation
+ public record CredentialsResponseValidation
{
internal CredentialsResponseValidation(
Transcript transcript,

ADD
WalletWasabi/WabiSabi/Crypto/CredentialRequesting/RealCredentialsRequestData.cs
+namespace WalletWasabi.WabiSabi.Crypto.CredentialRequesting
+{
+ public record RealCredentialsRequestData(RealCredentialsRequest CredentialsRequest, CredentialsResponseValidation CredentialsResponseValidation);
+}

ADD
WalletWasabi/WabiSabi/Crypto/CredentialRequesting/ZeroCredentialsRequestData.cs
+namespace WalletWasabi.WabiSabi.Crypto.CredentialRequesting
+{
+ public record ZeroCredentialsRequestData(ZeroCredentialsRequest CredentialsRequest, CredentialsResponseValidation CredentialsResponseValidation);
+}

MODIFY
WalletWasabi/WabiSabi/Crypto/WabiSabiClient.cs
WalletWasabi/WabiSabi/Crypto/WabiSabiClient.cs
@@ -59,7 +59,7 @@ namespace WalletWasabi.WabiSabi.Crypto
/// registration request message that has to be sent to the coordinator is a null request, in this
/// way the coordinator issues `k` zero-value credentials that can be used in following requests.
/// </remarks>
- public (ZeroCredentialsRequest, CredentialsResponseValidation) CreateRequestForZeroAmount()
+ public ZeroCredentialsRequestData CreateRequestForZeroAmount()
{
var credentialsToRequest = new IssuanceRequest[NumberOfCredentials];
var knowledge = new Knowledge[NumberOfCredentials];
@@ -77,7 +77,7 @@ namespace WalletWasabi.WabiSabi.Crypto
var transcript = BuildTransnscript(isNullRequest: true);
- return (
+ return new (
new ZeroCredentialsRequest(
credentialsToRequest,
ProofSystem.Prove(transcript, knowledge, RandomNumberGenerator)),
@@ -97,7 +97,7 @@ namespace WalletWasabi.WabiSabi.Crypto
/// A tuple containing the registration request message instance and the registration validation data
/// to be used to validate the coordinator response message (the issued credentials).
/// </returns>
- public (RealCredentialsRequest, CredentialsResponseValidation) CreateRequest(
+ public RealCredentialsRequestData CreateRequest(
IEnumerable<long> amountsToRequest,
IEnumerable<Credential> credentialsToPresent)
{
@@ -172,7 +172,7 @@ namespace WalletWasabi.WabiSabi.Crypto
knowledgeToProve.Add(balanceKnowledge);
var transcript = BuildTransnscript(isNullRequest: false);
- return (
+ return new (
new RealCredentialsRequest(
amountsToRequest.Sum() - credentialsToPresent.Sum(x => (long)x.Amount.ToUlong()),
presentations,

`CredentialClient` methods return record type