Remove script from reissuance
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Client/ArenaClientTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Client/ArenaClientTests.cs
@@ -101,9 +101,9 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Client
var reissuanceResponse = await bobArenaClient.ReissueCredentialAsync(
round.Id,
amountsToRequest[0],
- destinationKey1.PubKey.WitHash.ScriptPubKey,
amountsToRequest[1],
- destinationKey2.PubKey.WitHash.ScriptPubKey,
+ destinationKey1.PubKey.WitHash.ScriptPubKey.EstimateOutputVsize(),
+ destinationKey2.PubKey.WitHash.ScriptPubKey.EstimateOutputVsize(),
connectionConfirmationResponse2.RealAmountCredentials,
connectionConfirmationResponse2.RealVsizeCredentials,
CancellationToken.None);

MODIFY
WalletWasabi/WabiSabi/Client/ArenaClient.cs
WalletWasabi/WabiSabi/Client/ArenaClient.cs
@@ -112,10 +112,10 @@ namespace WalletWasabi.WabiSabi.Client
public async Task<ArenaResponse> ReissueCredentialAsync(
uint256 roundId,
- long value1,
- Script scriptPubKey1,
- long value2,
- Script scriptPubKey2,
+ long amount1,
+ long amount2,
+ long vsize1,
+ long vsize2,
IEnumerable<Credential> amountCredentialsToPresent,
IEnumerable<Credential> vsizeCredentialsToPresent,
CancellationToken cancellationToken)
@@ -123,19 +123,19 @@ namespace WalletWasabi.WabiSabi.Client
Guard.InRange(nameof(amountCredentialsToPresent), amountCredentialsToPresent, 0, AmountCredentialClient.NumberOfCredentials);
var presentedAmount = amountCredentialsToPresent.Sum(x => (long)x.Amount.ToUlong());
- if (value1 + value2 != presentedAmount)
+ if (amount1 + amount2 != presentedAmount)
{
throw new InvalidOperationException($"Reissuence amounts must equal with the sum of the presented ones.");
}
var presentedVsize = vsizeCredentialsToPresent.Sum(x => (long)x.Amount.ToUlong());
var (realVsizeCredentialRequest, realVsizeCredentialResponseValidation) = VsizeCredentialClient.CreateRequest(
- new[] { (long)scriptPubKey1.EstimateOutputVsize(), scriptPubKey2.EstimateOutputVsize() },
+ new[] { vsize1, vsize2 },
vsizeCredentialsToPresent,
cancellationToken);
var (realAmountCredentialRequest, realAmountCredentialResponseValidation) = AmountCredentialClient.CreateRequest(
- new[] { value1, value2 },
+ new[] { amount1, amount2 },
amountCredentialsToPresent,
cancellationToken);

MODIFY
WalletWasabi/WabiSabi/Client/BobClient.cs
WalletWasabi/WabiSabi/Client/BobClient.cs
@@ -29,5 +29,28 @@ namespace WalletWasabi.WabiSabi.Client
vsizeCredential,
cancellationToken).ConfigureAwait(false);
}
+
+ public async Task<(Credential[] RealAmountCredentials, Credential[] RealVsizeCredentials)> ReissueCredentialsAsync(
+ long amount1,
+ long amount2,
+ long vsize1,
+ long vsize2,
+ IEnumerable<Credential> amountCredential,
+ IEnumerable<Credential> vsizeCredential,
+ CancellationToken cancellationToken)
+ {
+ var response = await ArenaClient.ReissueCredentialAsync(
+ RoundId,
+ amount1,
+ amount2,
+ vsize1,
+ vsize2,
+ amountCredential,
+ vsizeCredential,
+ cancellationToken)
+ .ConfigureAwait(false);
+
+ return (response.RealAmountCredentials, response.RealVsizeCredentials);
+ }
}
}

Remove script from reissuance