diff options
author | Florian Dold <florian@dold.me> | 2023-01-02 21:00:43 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-01-02 21:00:43 +0100 |
commit | d48ea17c6345abaa732deb5fab6141449d463e41 (patch) | |
tree | 8983639bb6441965fd5d77b742409c87b9497797 /packages/taler-wallet-core/src | |
parent | 13d6810937255a136dcd098d142037cfb143a34e (diff) | |
download | wallet-core-d48ea17c6345abaa732deb5fab6141449d463e41.tar.xz |
-logging, skip defaults in test
Diffstat (limited to 'packages/taler-wallet-core/src')
4 files changed, 14 insertions, 5 deletions
diff --git a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts index 5d2820fdb..624ddf1d3 100644 --- a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts +++ b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts @@ -664,7 +664,8 @@ export const nativeCryptoR: TalerCryptoInterfaceR = { const salt = new Uint8Array(saltArrBuf); const saltDataView = new DataView(saltArrBuf); saltDataView.setUint32(0, req.coinNumber); - const out = kdf(64, decodeCrock(req.secretSeed), salt, info); + const secretSeedDec = decodeCrock(req.secretSeed); + const out = kdf(64, secretSeedDec, salt, info); const coinPriv = out.slice(0, 32); const bks = out.slice(32, 64); const coinPrivEnc = encodeCrock(coinPriv); diff --git a/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerPlain.ts b/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerPlain.ts index 058896828..c80f2f58f 100644 --- a/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerPlain.ts +++ b/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerPlain.ts @@ -17,7 +17,7 @@ /** * Imports. */ -import { Logger } from "@gnu-taler/taler-util"; +import { j2s, Logger } from "@gnu-taler/taler-util"; import { nativeCryptoR, TalerCryptoInterfaceR, @@ -84,6 +84,8 @@ export class SynchronousCryptoWorkerPlain implements CryptoWorker { }; handleRequest().catch((e) => { logger.error("Error while handling crypto request:", e); + logger.error("Stack:", e.stack); + logger.error(`request was ${j2s(msg)}`); }); } diff --git a/packages/taler-wallet-core/src/crypto/workers/worker-common.ts b/packages/taler-wallet-core/src/crypto/workers/worker-common.ts index 459033526..8a74a5231 100644 --- a/packages/taler-wallet-core/src/crypto/workers/worker-common.ts +++ b/packages/taler-wallet-core/src/crypto/workers/worker-common.ts @@ -17,7 +17,12 @@ /** * Imports. */ -import { j2s, Logger, TalerErrorCode } from "@gnu-taler/taler-util"; +import { + j2s, + Logger, + stringifyError as safeStringifyError, + TalerErrorCode, +} from "@gnu-taler/taler-util"; import { getErrorDetailFromException, makeErrorDetail } from "../../errors.js"; import { TalerCryptoInterfaceR } from "../cryptoImplementation.js"; import { @@ -88,7 +93,7 @@ export async function processRequestWithImpl( const result = await (impl as any)[operation](impl, reqMsg.req); responseMsg = { type: "success", result, id }; } catch (e: any) { - logger.error(`error during operation: ${e.stack ?? e.toString()}`); + logger.error(`error during operation: ${safeStringifyError(e)}`); responseMsg = { type: "error", error: getErrorDetailFromException(e), diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts b/packages/taler-wallet-core/src/wallet-api-types.ts index f4fb16e80..1ea57a27d 100644 --- a/packages/taler-wallet-core/src/wallet-api-types.ts +++ b/packages/taler-wallet-core/src/wallet-api-types.ts @@ -106,6 +106,7 @@ import { WithdrawTestBalanceRequest, WithdrawUriInfoResponse, UserAttentionByIdRequest, + InitRequest, } from "@gnu-taler/taler-util"; import { WalletContractData } from "./db.js"; import { @@ -200,7 +201,7 @@ type EmptyObject = Record<string, never>; */ export type InitWalletOp = { op: WalletApiOperation.InitWallet; - request: EmptyObject; + request: InitRequest; response: InitResponse; }; |