diff options
Diffstat (limited to 'packages/taler-wallet-core')
3 files changed, 7 insertions, 6 deletions
diff --git a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts index 98bb6c9cb..892d3fc8f 100644 --- a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts +++ b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts @@ -1074,13 +1074,11 @@ export const nativeCryptoR: TalerCryptoInterfaceR = { // FIXME: put extensions here if used const hExt = new Uint8Array(64); let hAgeCommitment: Uint8Array; - let maybeAgeCommitmentHash: string | undefined = undefined; let minimumAgeSig: string | undefined = undefined; if (depositInfo.ageCommitmentProof) { const ach = AgeRestriction.hashCommitment( depositInfo.ageCommitmentProof.commitment, ); - maybeAgeCommitmentHash = ach; hAgeCommitment = decodeCrock(ach); if (depositInfo.requiredMinimumAge != null) { minimumAgeSig = encodeCrock( @@ -1130,11 +1128,12 @@ export const nativeCryptoR: TalerCryptoInterfaceR = { }; if (depositInfo.requiredMinimumAge != null) { + // These are only required by the merchant s.minimum_age_sig = minimumAgeSig; s.age_commitment = depositInfo.ageCommitmentProof?.commitment.publicKeys; } else if (depositInfo.ageCommitmentProof) { - (s as any).h_age_commitment = encodeCrock(hAgeCommitment); + s.h_age_commitment = encodeCrock(hAgeCommitment); } return s; diff --git a/packages/taler-wallet-core/src/crypto/workers/nodeThreadWorker.ts b/packages/taler-wallet-core/src/crypto/workers/nodeThreadWorker.ts index de8f12902..f255e3cfd 100644 --- a/packages/taler-wallet-core/src/crypto/workers/nodeThreadWorker.ts +++ b/packages/taler-wallet-core/src/crypto/workers/nodeThreadWorker.ts @@ -19,6 +19,7 @@ */ import { Logger } from "@gnu-taler/taler-util"; import os from "os"; +import url from "url"; import { nativeCryptoR } from "../cryptoImplementation.js"; import { CryptoWorkerFactory } from "./cryptoDispatcher.js"; import { CryptoWorker } from "./cryptoWorkerInterface.js"; @@ -26,7 +27,7 @@ import { processRequestWithImpl } from "./worker-common.js"; const logger = new Logger("nodeThreadWorker.ts"); -const f = import.meta.url; +const f = url.fileURLToPath(import.meta.url); const workerCode = ` // Try loading the glue library for embedded diff --git a/packages/taler-wallet-core/src/operations/deposits.ts b/packages/taler-wallet-core/src/operations/deposits.ts index 7e87dafb8..2b27d0f8f 100644 --- a/packages/taler-wallet-core/src/operations/deposits.ts +++ b/packages/taler-wallet-core/src/operations/deposits.ts @@ -30,6 +30,7 @@ import { DepositGroupFees, durationFromSpec, encodeCrock, + ExchangeDepositRequest, GetFeeForDepositRequest, getRandomBytes, hashWire, @@ -112,8 +113,7 @@ export async function processDepositGroup( continue; } const perm = depositPermissions[i]; - let requestBody: any; - requestBody = { + const requestBody: ExchangeDepositRequest = { contribution: Amounts.stringify(perm.contribution), merchant_payto_uri: depositGroup.wire.payto_uri, wire_salt: depositGroup.wire.salt, @@ -126,6 +126,7 @@ export async function processDepositGroup( coin_sig: perm.coin_sig, denom_pub_hash: perm.h_denom, merchant_pub: depositGroup.merchantPub, + h_age_commitment: perm.h_age_commitment, }; // Check for cancellation before making network request. options.cancellationToken?.throwIfCancelled(); |