From 585746d9c13322d57b18c367c5fed2e49cba2d9f Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Mon, 25 May 2020 12:00:41 -0400 Subject: [PATCH] this method no longer used --- src/_zkapauthorizer/model.py | 49 ------------------------------------ 1 file changed, 49 deletions(-) diff --git a/src/_zkapauthorizer/model.py b/src/_zkapauthorizer/model.py index 938fc57..3b23a91 100644 --- a/src/_zkapauthorizer/model.py +++ b/src/_zkapauthorizer/model.py @@ -638,55 +638,6 @@ class VoucherStore(object): """, ) - @with_cursor - def extract_unblinded_tokens(self, cursor, count): - """ - Remove and return some unblinded tokens. - - :param int count: The maximum number of unblinded tokens to remove and - return. If fewer than this are available, only as many as are - available are returned. - - :return list[UnblindedTokens]: The removed unblinded tokens. - """ - cursor.execute( - """ - SELECT COUNT(token) - FROM [unblinded-tokens] - """, - ) - [(existing_tokens,)] = cursor.fetchall() - if existing_tokens < count: - raise NotEnoughTokens() - - cursor.execute( - """ - INSERT INTO [extracting] SELECT [token] FROM [unblinded-tokens] LIMIT ? - """, - (count,), - ) - cursor.execute( - """ - DELETE FROM [unblinded-tokens] WHERE [token] IN [extracting] - """, - ) - cursor.execute( - """ - SELECT [token] FROM [extracting] - """, - ) - texts = cursor.fetchall() - cursor.execute( - """ - DELETE FROM [extracting] - """, - ) - return list( - UnblindedToken(t) - for (t,) - in texts - ) - @with_cursor def backup(self, cursor): """ -- GitLab