Rename client and fix white spaces
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Client/WabiSabiApiClientTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Client/WabiSabiApiClientTests.cs
using Moq;
using NBitcoin;
+using System;
+using System.Linq;
using System.Threading.Tasks;
using WalletWasabi.BitcoinCore.Rpc;
-using WalletWasabi.Crypto;
using WalletWasabi.Crypto.Randomness;
using WalletWasabi.Tests.Helpers;
using WalletWasabi.WabiSabi.Backend;
@@ -40,9 +41,12 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Client
var amountClient = new WabiSabiClient(round.AmountCredentialIssuerParameters, 2, rnd, 4300000000000ul);
var weightClient = new WabiSabiClient(round.WeightCredentialIssuerParameters, 2, rnd, 2000ul);
- var apiClient = new WabiSabiApiClient(amountClient, weightClient, coordinator);
+ var apiClient = new CoordinatorClient(amountClient, weightClient, coordinator);
- await apiClient.RegisterInputAsync(Money.Coins(1m), outpoint, key, round.Id, round.Hash);
+ var aliceId = await apiClient.RegisterInputAsync(Money.Coins(1m), outpoint, key, round.Id, round.Hash);
+
+ Assert.NotEqual(Guid.Empty, aliceId);
+ Assert.Empty(apiClient.WabiSabiClientAmount.Credentials.Valuable);
}
}
}
\ No newline at end of file

MODIFY
WalletWasabi/WabiSabi/Client/WabiSabiApiClient.cs
WalletWasabi/WabiSabi/Client/WabiSabiApiClient.cs
@@ -10,9 +10,9 @@ using WalletWasabi.WabiSabi.Models;
namespace WalletWasabi.WabiSabi.Client
{
- public class WabiSabiApiClient
+ public class CoordinatorClient
{
- public WabiSabiApiClient(WabiSabiClient wabiSabiClientAmount, WabiSabiClient wabiSabiClientWeight, IRequestHandler requestHandler)
+ public CoordinatorClient(WabiSabiClient wabiSabiClientAmount, WabiSabiClient wabiSabiClientWeight, IRequestHandler requestHandler)
{
WabiSabiClientAmount = wabiSabiClientAmount;
WabiSabiClientWeight = wabiSabiClientWeight;
@@ -23,7 +23,7 @@ namespace WalletWasabi.WabiSabi.Client
public WabiSabiClient WabiSabiClientWeight { get; }
public IRequestHandler RequestHandler { get; }
- public Task RegisterInputAsync(Money amount, OutPoint outPoint, Key key, Guid roundId, uint256 roundHash) =>
+ public ValueTask<Guid> RegisterInputAsync(Money amount, OutPoint outPoint, Key key, Guid roundId, uint256 roundHash) =>
RegisterInputAsync(
new[] { amount },
new[] { outPoint },
@@ -31,7 +31,7 @@ namespace WalletWasabi.WabiSabi.Client
roundId,
roundHash);
- public async Task RegisterInputAsync(
+ public async ValueTask<Guid> RegisterInputAsync(
IEnumerable<Money> amounts,
IEnumerable<OutPoint> outPoints,
IEnumerable<Key> keys,
@@ -58,6 +58,8 @@ namespace WalletWasabi.WabiSabi.Client
WabiSabiClientAmount.HandleResponse(inputRegistrationResponse.AmountCredentials, zeroAmountCredentialResponseValidation);
WabiSabiClientWeight.HandleResponse(inputRegistrationResponse.WeightCredentials, zeroWeightCredentialResponseValidation);
+
+ return inputRegistrationResponse.AliceId;
}
}
}

Rename client and fix white spaces