Add PrepareResponse that returns a Task
MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
@@ -528,10 +528,10 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.WrongNumberOfCreds, $"Round ({round.Id}): Incorrect requested number of weight credentials.");
}
- var realAmountTask = Task.Run(() => round.AmountCredentialIssuer.PrepareResponse(request.RealAmountCredentialRequests), cancellationToken);
- var realVsizeTask = Task.Run(() => round.VsizeCredentialIssuer.PrepareResponse(request.RealVsizeCredentialRequests), cancellationToken);
- var zeroAmountTask = Task.Run(() => round.AmountCredentialIssuer.PrepareResponse(request.ZeroAmountCredentialRequests), cancellationToken);
- var zeroVsizeTask = Task.Run(() => round.VsizeCredentialIssuer.PrepareResponse(request.ZeroVsizeCredentialsRequests), cancellationToken);
+ var realAmountTask = round.AmountCredentialIssuer.PrepareResponse(request.RealAmountCredentialRequests, cancellationToken);
+ var realVsizeTask = round.VsizeCredentialIssuer.PrepareResponse(request.RealVsizeCredentialRequests, cancellationToken);
+ var zeroAmountTask = round.AmountCredentialIssuer.PrepareResponse(request.ZeroAmountCredentialRequests, cancellationToken);
+ var zeroVsizeTask = round.VsizeCredentialIssuer.PrepareResponse(request.ZeroVsizeCredentialsRequests, cancellationToken);
var commitRealAmountCredentialResponse = await realAmountTask.ConfigureAwait(false);
var commitRealVsizeCredentialResponse = await realVsizeTask.ConfigureAwait(false);

MODIFY
WalletWasabi/WabiSabi/Crypto/CredentialIssuer.cs
WalletWasabi/WabiSabi/Crypto/CredentialIssuer.cs
@@ -4,6 +4,7 @@ using System.Collections.Immutable;
using System.Linq;
using System.Text;
using System.Threading;
+using System.Threading.Tasks;
using NBitcoin;
using NBitcoin.Secp256k1;
using WalletWasabi.Crypto;
@@ -296,6 +297,11 @@ namespace WalletWasabi.WabiSabi.Crypto
return new Transcript(encodedLabel);
}
+ public Task<ICommitableCredentialsResponse> PrepareResponse(CredentialsRequest registrationRequest, CancellationToken cancel)
+ {
+ return Task.Run(() => PrepareResponse(registrationRequest), cancel);
+ }
+
private class PreparedCredentialsResponse : ICommitableCredentialsResponse
{
private readonly CredentialIssuer _issuer;

Add PrepareResponse that returns a Task