This commit updates the CertificateRepository by changing the logic for setting the state of wallet slices. Instead of using the SetWalletSliceState method, it now directly executes an SQL query to update the state column in the wallet_slices table. The new query sets the state to WalletSliceState.Reserved only if the current state is WalletSliceState.Available. If the number of rows changed by the query is not equal to 1, an InvalidOperationException is thrown with a corresponding error message.
This change should insure extra guard against double reserving the same slice.
This commit updates the
CertificateRepository
by changing the logic for setting the state of wallet slices. Instead of using theSetWalletSliceState
method, it now directly executes an SQL query to update thestate
column in thewallet_slices
table. The new query sets the state toWalletSliceState.Reserved
only if the current state isWalletSliceState.Available
. If the number of rows changed by the query is not equal to 1, anInvalidOperationException
is thrown with a corresponding error message.This change should insure extra guard against double reserving the same slice.