diff options
| author | Özgür Kesim <oec-taler@kesim.org> | 2023-08-15 13:48:37 +0200 |
|---|---|---|
| committer | Özgür Kesim <oec-taler@kesim.org> | 2023-08-15 13:48:37 +0200 |
| commit | 70fca92e781696a057089bc8bc48adebdf6e017e (patch) | |
| tree | 705614c28e8e2f46798a82db206b3fc8f06e3d34 /packages/taler-wallet-core | |
| parent | 819949d7f2cfcce8d334cbfdb701255daac64951 (diff) | |
[age-withdraw] WiP: first types and adjustments
Diffstat (limited to 'packages/taler-wallet-core')
| -rw-r--r-- | packages/taler-wallet-core/src/db.ts | 14 | ||||
| -rw-r--r-- | packages/taler-wallet-core/src/operations/withdraw.ts | 7 |
2 files changed, 20 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts index c7d0b0bda..72b4fdfcb 100644 --- a/packages/taler-wallet-core/src/db.ts +++ b/packages/taler-wallet-core/src/db.ts @@ -657,6 +657,7 @@ export interface PlanchetRecord { */ coinIdx: number; + planchetStatus: PlanchetStatus; lastError: TalerErrorDetail | undefined; @@ -671,6 +672,12 @@ export interface PlanchetRecord { coinEvHash: string; + /** + * Index into the kappa-many planchet commitments per coin + * for the age-withdraw operation. + */ + ageWithdrawIdx?: number; + ageCommitmentProof?: AgeCommitmentProof; } @@ -1423,7 +1430,7 @@ export interface KycPendingInfo { } /** * Group of withdrawal operations that need to be executed. - * (Either for a normal withdrawal or from a reward.) + * (Either for a normal {single-|batch-|age-} withdrawal or from a reward.) * * The withdrawal group record is only created after we know * the coin selection we want to withdraw. @@ -2513,6 +2520,11 @@ export const WalletStoresV1 = { "planchets", describeContents<PlanchetRecord>({ keyPath: "coinPub" }), { + byGroupAgeCoin: describeIndex("byGroupAgeCoin", [ + "withdrawalGroupId", + "ageWithdrawIdx", + "coinIdx", + ]), byGroupAndIndex: describeIndex("byGroupAndIndex", [ "withdrawalGroupId", "coinIdx", diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index a1cb29e07..a6622d3fe 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -62,6 +62,10 @@ import { ExchangeWithdrawResponse, WithdrawUriInfoResponse, ExchangeBatchWithdrawRequest, + ExchangeAgeWithdrawRequest, + ExchangeAgeWithdrawRevealRequest, + ExchangeAgeWithdrawResponse, + ExchangeAgeWithdrawRevealResponse, TransactionState, TransactionMajorState, TransactionMinorState, @@ -861,6 +865,7 @@ async function processPlanchetExchangeBatchRequest( coinIdx < wgContext.numPlanchets; coinIdx++ ) { + // FIXME[oec]: Add lookup of planchet for age-withdraw here let planchet = await tx.planchets.indexes.byGroupAndIndex.get([ withdrawalGroup.withdrawalGroupId, coinIdx, @@ -923,6 +928,8 @@ async function processPlanchetExchangeBatchRequest( // FIXME: handle individual error codes better! + // FIXME[oec]: add age-withdraw-request here + if (args.useBatchRequest) { const reqUrl = new URL( `reserves/${withdrawalGroup.reservePub}/batch-withdraw`, |
