From c021876b41bff11ad28c3a43808795fa0d02ce99 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 14 Sep 2022 20:34:37 +0200 Subject: wallet-core: cache fresh coin count in DB --- packages/taler-wallet-core/src/db.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'packages/taler-wallet-core/src/db.ts') diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts index da566ff24..6dfa63c06 100644 --- a/packages/taler-wallet-core/src/db.ts +++ b/packages/taler-wallet-core/src/db.ts @@ -314,6 +314,11 @@ export interface DenominationRecord { * that includes this denomination. */ listIssueDate: TalerProtocolTimestamp; + + /** + * Number of fresh coins of this denomination that are available. + */ + freshCoinCount?: number; } /** @@ -520,6 +525,13 @@ export enum CoinStatus { * Withdrawn and never shown to anybody. */ Fresh = "fresh", + + /** + * Fresh, but currently marked as "suspended", thus won't be used + * for spending. Used for testing. + */ + FreshSuspended = "fresh-suspended", + /** * A coin that has been spent and refreshed. */ @@ -605,11 +617,6 @@ export interface CoinRecord { */ exchangeBaseUrl: string; - /** - * The coin is currently suspended, and will not be used for payments. - */ - suspended: boolean; - /** * Blinding key used when withdrawing the coin. * Potentionally used again during payback. -- cgit v1.2.3