diff options
author | Florian Dold <florian@dold.me> | 2021-06-09 15:14:17 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-06-09 15:24:19 +0200 |
commit | 5c26461247040c07c86291babf0c87631df638b5 (patch) | |
tree | 8ff93454d0c21d2675d6734f210d4e8ff91d2bfb /packages/taler-wallet-core/src/operations/state.ts | |
parent | 68dddc848f2f650d74697bb3a5c05d649e5db3c7 (diff) | |
download | wallet-core-5c26461247040c07c86291babf0c87631df638b5.tar.xz |
database access refactor
Diffstat (limited to 'packages/taler-wallet-core/src/operations/state.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/state.ts | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/packages/taler-wallet-core/src/operations/state.ts b/packages/taler-wallet-core/src/operations/state.ts index 0d07f293d..9bf73142c 100644 --- a/packages/taler-wallet-core/src/operations/state.ts +++ b/packages/taler-wallet-core/src/operations/state.ts @@ -17,12 +17,22 @@ /** * Imports. */ -import { WalletNotification, BalancesResponse, Logger } from "@gnu-taler/taler-util"; -import { Stores } from "../db.js"; -import { CryptoApi, OpenedPromise, Database, CryptoWorkerFactory, openPromise } from "../index.js"; +import { + WalletNotification, + BalancesResponse, + Logger, +} from "@gnu-taler/taler-util"; +import { WalletStoresV1 } from "../db.js"; +import { + CryptoApi, + OpenedPromise, + CryptoWorkerFactory, + openPromise, +} from "../index.js"; import { PendingOperationsResponse } from "../pending-types.js"; import { AsyncOpMemoMap, AsyncOpMemoSingle } from "../util/asyncMemo.js"; import { HttpRequestLibrary } from "../util/http"; +import { DbAccess } from "../util/query.js"; type NotificationListener = (n: WalletNotification) => void; @@ -34,9 +44,7 @@ export const EXCHANGE_RESERVES_LOCK = "exchange-reserves-lock"; export class InternalWalletState { memoProcessReserve: AsyncOpMemoMap<void> = new AsyncOpMemoMap(); memoMakePlanchet: AsyncOpMemoMap<void> = new AsyncOpMemoMap(); - memoGetPending: AsyncOpMemoSingle< - PendingOperationsResponse - > = new AsyncOpMemoSingle(); + memoGetPending: AsyncOpMemoSingle<PendingOperationsResponse> = new AsyncOpMemoSingle(); memoGetBalance: AsyncOpMemoSingle<BalancesResponse> = new AsyncOpMemoSingle(); memoProcessRefresh: AsyncOpMemoMap<void> = new AsyncOpMemoMap(); memoProcessRecoup: AsyncOpMemoMap<void> = new AsyncOpMemoMap(); @@ -60,7 +68,7 @@ export class InternalWalletState { // the actual value nullable. // Check if we are in a DB migration / garbage collection // and throw an error in that case. - public db: Database<typeof Stores>, + public db: DbAccess<typeof WalletStoresV1>, public http: HttpRequestLibrary, cryptoWorkerFactory: CryptoWorkerFactory, ) { |