Remove rounds as a parameter
MODIFY
WalletWasabi/WabiSabi/Backend/PostRequests/InputRegistrationHandler.cs
WalletWasabi/WabiSabi/Backend/PostRequests/InputRegistrationHandler.cs
@@ -51,18 +51,12 @@ namespace WalletWasabi.WabiSabi.Backend.PostRequests
public static InputRegistrationResponse RegisterInput(
WabiSabiConfig config,
- uint256 roundId,
+ Round round,
Coin coin,
OwnershipProof ownershipProof,
ZeroCredentialsRequest zeroAmountCredentialRequests,
- ZeroCredentialsRequest zeroVsizeCredentialRequests,
- HashSet<Round> rounds)
+ ZeroCredentialsRequest zeroVsizeCredentialRequests)
{
- if (rounds.FirstOrDefault(x => x.Id == roundId) is not Round round)
- {
- throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.RoundNotFound);
- }
-
if (round.IsInputRegistrationEnded(config.MaxInputCountByRound, config.GetInputRegistrationTimeout(round)))
{
throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.WrongPhase);

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
@@ -307,20 +307,26 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
var coin = await InputRegistrationHandler.OutpointToCoinAsync(request, Prison, Rpc, Config, cancellationToken).ConfigureAwait(false);
using (await AsyncLock.LockAsync(cancellationToken).ConfigureAwait(false))
{
+ Round? round = Rounds.FirstOrDefault(x => x.Id == request.RoundId);
+ if (round is null)
+ {
+ throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.RoundNotFound);
+ }
+
var registeredCoins = Rounds.Where(x => !(x.Phase == Phase.Ended && !x.WasTransactionBroadcast)).SelectMany(r => r.Alices.Select(a => a.Coin));
if (registeredCoins.Any(x => x.Outpoint == coin.Outpoint))
{
throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.AliceAlreadyRegistered);
}
+
return InputRegistrationHandler.RegisterInput(
Config,
- request.RoundId,
+ round,
coin,
request.OwnershipProof,
request.ZeroAmountCredentialRequests,
- request.ZeroVsizeCredentialRequests,
- Rounds);
+ request.ZeroVsizeCredentialRequests);
}
}

Remove rounds as a parameter