taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 54fdd64ea8df045417eca8c8c3ffe98959535f5b
parent 182a46fd633e2808c0da3da1e18bea700905b560
Author: Florian Dold <dold@taler.net>
Date:   Fri,  4 Sep 2026 19:07:22 +0200

source tree: fix misspellings in text and identifiers

Diffstat:
Meslint.config.mjs | 2+-
Mpackages/anastasis-core/src/index.ts | 4++--
Mpackages/libeufin-bank-webui/src/pages/SolveMFA.tsx | 2+-
Mpackages/pogen/src/potextract.ts | 4++--
Mpackages/taler-harness/src/integrationtests/test-deposit-twice.ts | 2+-
Mpackages/taler-harness/src/stagefright/merchant-webui.ts | 19+++++++++++++------
Mpackages/taler-util/src/amounts.ts | 2+-
Mpackages/taler-util/src/libtool-version.test.ts | 4++--
Mpackages/taler-util/src/payto.test.ts | 2+-
Mpackages/taler-util/src/taler-crypto.test.ts | 4++--
Mpackages/taler-util/src/taler-crypto.ts | 8++++----
Mpackages/taler-util/src/taler-form-attributes.ts | 2+-
Mpackages/taler-util/src/time.ts | 2+-
Mpackages/taler-util/src/types-taler-wallet.ts | 2+-
Mpackages/taler-wallet-core/src/db/sqlite/transaction.ts | 18++++++++++--------
Mpackages/taler-wallet-core/src/db/testing/conformance-cases.ts | 2+-
Mpackages/taler-wallet-core/src/exchanges.ts | 2+-
Mpackages/taler-wallet-core/src/pay-merchant.ts | 6+++---
Mpackages/taler-wallet-core/src/pay-template.ts | 2+-
Mpackages/taler-wallet-core/src/refresh.ts | 17++++++++++-------
Mpackages/taler-wallet-core/src/tokenSelection.test.ts | 2+-
21 files changed, 60 insertions(+), 48 deletions(-)

diff --git a/eslint.config.mjs b/eslint.config.mjs @@ -133,7 +133,7 @@ export default tseslint.config( // real defects; there are too many to unpick here, so they are visible // rather than blocking. "react-hooks/rules-of-hooks": "warn", - // A list rendered without keys re-uses component state across items. + // A list rendered without keys reuses component state across items. "react/jsx-key": "error", "react/jsx-no-undef": "error", // Not diagnostics: these two exist so that no-unused-vars can see the diff --git a/packages/anastasis-core/src/index.ts b/packages/anastasis-core/src/index.ts @@ -1678,8 +1678,8 @@ export function mergeDiscoveryAggregate( ): AggregatedPolicyMetaInfo[] { const aggregatedPolicies: AggregatedPolicyMetaInfo[] = [...oldAgg]; const polHashToIndex: Record<string, number> = oldAgg.reduce( - (prev, cur, indx) => { - prev[cur.policy_hash] = indx; + (prev, cur, index) => { + prev[cur.policy_hash] = index; return prev; }, {} as Record<string, number>, diff --git a/packages/libeufin-bank-webui/src/pages/SolveMFA.tsx b/packages/libeufin-bank-webui/src/pages/SolveMFA.tsx @@ -328,7 +328,7 @@ export function SolveChallengeDialog({ </div> </div> </dialog> - <Fragment key="childs">{children}</Fragment> + <Fragment key="children">{children}</Fragment> </Fragment> ); } diff --git a/packages/pogen/src/potextract.ts b/packages/pogen/src/potextract.ts @@ -1068,7 +1068,7 @@ export function potextract(searchPath: string = "./") { ); if (!cmdline) { - throw Error("cound not parse command line"); + throw Error("could not parse command line"); } const prog = ts.createProgram({ @@ -1098,7 +1098,7 @@ export function potextract(searchPath: string = "./") { const failed: string[] = []; for (const f of ownFiles) { - // One unparseable file must not cost us the whole catalogue. + // One unparsable file must not cost us the whole catalogue. try { processFile(f, entries, gitRoot); } catch (e) { diff --git a/packages/taler-harness/src/integrationtests/test-deposit-twice.ts b/packages/taler-harness/src/integrationtests/test-deposit-twice.ts @@ -89,7 +89,7 @@ export async function runDepositTwiceTest(t: GlobalTestState) { name: "booWallet", }); - // I sent 50.- to device A and 5.-- to device B from differen bank accounts. + // I sent 50.- to device A and 5.-- to device B from different bank accounts. const aliceWithdrawRes = await withdrawViaBankV3(t, { walletClient: aliceWallet, bankClient, diff --git a/packages/taler-harness/src/stagefright/merchant-webui.ts b/packages/taler-harness/src/stagefright/merchant-webui.ts @@ -235,9 +235,11 @@ export async function runStagefrightMerchantWebui( const walletDbPath = `/tmp/sf-wallet-${instanceId}.db`; let deploymentCurrency = options.currency || ""; - let configRes: any = undefined; + let configResponse: any = undefined; try { - configRes = await fetch(`${baseUrl}config`).then((r) => (r as any).json()); + configResponse = await fetch(`${baseUrl}config`).then((r) => + (r as any).json(), + ); } catch (e: any) { logger.warn( `Failed to fetch merchant backend config from ${baseUrl}: ${e?.message || e}`, @@ -246,12 +248,17 @@ export async function runStagefrightMerchantWebui( if (!deploymentCurrency) { deploymentCurrency = - configRes?.currency || configRes?.currency_specification?.name || "CHF"; + configResponse?.currency || + configResponse?.currency_specification?.name || + "CHF"; } logger.info(`Deployment currency resolved to: '${deploymentCurrency}'`); - if (configRes?.exchanges && Array.isArray(configRes.exchanges)) { - const supportedUrls = configRes.exchanges.map((ex: any) => + if ( + configResponse?.exchanges && + Array.isArray(configResponse.exchanges) + ) { + const supportedUrls = configResponse.exchanges.map((ex: any) => normalizeBaseUrl(ex.base_url || ex.url || ""), ); logger.info( @@ -1063,7 +1070,7 @@ export async function runStagefrightMerchantWebui( }); await stage.step( - "verify primary currency pre-selected and fill order details", + "verify primary currency preselected and fill order details", async (page) => { await page.fill("#order-amount", "2"); await page.fill( diff --git a/packages/taler-util/src/amounts.ts b/packages/taler-util/src/amounts.ts @@ -811,7 +811,7 @@ export class Amounts { * (e.g., `CHF 12.50`). * * If amount is undefined, null, or empty string, returns "—". - * Unparseable strings are returned unchanged. + * Unparsable strings are returned unchanged. */ static formatAmount(amount: AmountLike | undefined | null): string { if (!amount) return "—"; diff --git a/packages/taler-util/src/libtool-version.test.ts b/packages/taler-util/src/libtool-version.test.ts @@ -53,7 +53,7 @@ test("version comparison", (t) => { test("isCompatible reports incompatibility", (t) => { // compare() returns an object on incompatibility, which is truthy -- so a - // bare truthiness test on it only ever detects an unparseable version. + // bare truthiness test on it only ever detects an unparsable version. // Resolved dynamically so that this file still compiles before the helper // exists. const isCompatible = (LibtoolVersion as any).isCompatible as ( @@ -64,7 +64,7 @@ test("isCompatible reports incompatibility", (t) => { assert.strictEqual(isCompatible("41:0:0", "0:0:0"), false); assert.strictEqual(isCompatible("4:0:0", "99:0:0"), false); assert.strictEqual(isCompatible("1:0:1", "1:0:0"), true); - // Unparseable input is not compatible either. + // Unparsable input is not compatible either. assert.strictEqual(isCompatible("4:0:0", "bogus"), false); }); diff --git a/packages/taler-util/src/payto.test.ts b/packages/taler-util/src/payto.test.ts @@ -217,7 +217,7 @@ test("void payto URI", () => { ); }); -test("taler-reserve payto with an unparseable reservePub does not throw when ignoring component errors", () => { +test("taler-reserve payto with an unparsable reservePub does not throw when ignoring component errors", () => { const bad = "payto://taler-reserve/exchange.example.com/not-valid-crock!!"; // Without ignoreComponentError, this is reported as a normal error result. diff --git a/packages/taler-util/src/taler-crypto.test.ts b/packages/taler-util/src/taler-crypto.test.ts @@ -723,13 +723,13 @@ test("contract decryption honours the declared plaintext length", async (t) => { const compressed = fflate.zlibSync( stringToBytes(canonicalJson(contractTerms) + "\0"), ); - const forge = (ctype: number, clen: number): Promise<Uint8Array> => + const forge = (ctype: number, contentLength: number): Promise<Uint8Array> => encryptWithDerivedKey( nonce, key, typedArrayConcat([ bufferForUint32(ctype), - bufferForUint32(clen), + bufferForUint32(contentLength), compressed, ]), "p2p-deposit-contract", diff --git a/packages/taler-util/src/taler-crypto.ts b/packages/taler-util/src/taler-crypto.ts @@ -1703,15 +1703,15 @@ function decompressContractTerms( ): any { const dv = new DataView(dec.buffer, dec.byteOffset, dec.byteLength); const ctype = dv.getUint32(0); - const clen = dv.getUint32(4); + const contentLength = dv.getUint32(4); if (ctype !== expectedTag) { throw Error(`unexpected contract format tag ${ctype}`); } - if (clen < 1 || clen > maxContractTermsLength) { - throw Error(`contract terms length ${clen} out of range`); + if (contentLength < 1 || contentLength > maxContractTermsLength) { + throw Error(`contract terms length ${contentLength} out of range`); } const buf = fflate.unzlibSync(dec.slice(payloadOffset), { - out: new Uint8Array(clen), + out: new Uint8Array(contentLength), }); // Slice of the '\0' at the end and decode to a string return JSON.parse(bytesToString(buf.slice(0, buf.length - 1))); diff --git a/packages/taler-util/src/taler-form-attributes.ts b/packages/taler-util/src/taler-form-attributes.ts @@ -112,7 +112,7 @@ export const TalerFormAttributes = { */ COMPANY_NAME: "COMPANY_NAME" as const, /** - * Description: Document with information about the company strucutre. + * Description: Document with information about the company structure. * * GANA Type: FileUpload */ diff --git a/packages/taler-util/src/time.ts b/packages/taler-util/src/time.ts @@ -885,7 +885,7 @@ export namespace AbsoluteTime { } /** - * Parse a TimestampLike value into a valid Date object, or null if empty or unparseable. + * Parse a TimestampLike value into a valid Date object, or null if empty or unparsable. */ export function toDate(input: TimestampLike | null | undefined): Date | null { const ms = parseTimestampMs(input); diff --git a/packages/taler-util/src/types-taler-wallet.ts b/packages/taler-util/src/types-taler-wallet.ts @@ -4298,7 +4298,7 @@ export interface WithdrawalExchangeAccountDetails { transferExpiry?: TalerProtocolTimestamp; /** - * Options for transfering funds to the exchange for the withdrawal. + * Options for transferring funds to the exchange for the withdrawal. */ transferOptions: TransferOption[]; } diff --git a/packages/taler-wallet-core/src/db/sqlite/transaction.ts b/packages/taler-wallet-core/src/db/sqlite/transaction.ts @@ -1725,7 +1725,7 @@ export class SqliteWalletTransaction implements WalletDbTransaction { superseded_first_seen, superseded_shares_denoms ) VALUES ( $url, $pch, $pcs, $pt, $src, $lw, $dpmp, $dpc, $dpuc, $es, $us, $ur, - $cnu, $tce, $tae, $tat, $lu, $nus, $lke, $nrcs, $cmrri, $cap, + $cnu, $tce, $tae, $tat, $lu, $nus, $lastKeysEtag, $nrcs, $cmrri, $cap, $capub, $ppd, $ddd, $nf, $smp, $sc, $sfs, $ssd ) ON CONFLICT(base_url) DO UPDATE SET @@ -1792,7 +1792,7 @@ export class SqliteWalletTransaction implements WalletDbTransaction { tat: rec.tosAcceptedTimestamp ?? null, lu: rec.lastUpdate ?? null, nus: rec.nextUpdateStamp, - lke: rec.lastKeysEtag ?? null, + lastKeysEtag: rec.lastKeysEtag ?? null, nrcs: rec.nextRefreshCheckStamp, cmrri: rec.currentMergeReserveRowId ?? null, cap: optCrockToDb(rec.currentAccountPriv), @@ -4975,7 +4975,7 @@ export class SqliteWalletTransaction implements WalletDbTransaction { description, extra_data, token_issue_pub, description_i18n ) VALUES ( $pub, $priv, $pid, $tid, $ci, $oi, $ri, $url, $kind, $tiph, $tfh, - $va, $vb, $sig, $usig, $ev, $evh, $bk, $slug, $name, $desc, $extra, $tipub, $di18n + $va, $vb, $sig, $tokenUseSig, $ev, $evh, $bk, $slug, $name, $desc, $extra, $tipub, $di18n ) ON CONFLICT(token_use_pub) DO UPDATE SET token_use_priv = excluded.token_use_priv, @@ -5016,7 +5016,8 @@ export class SqliteWalletTransaction implements WalletDbTransaction { va: rec.validAfter, vb: rec.validBefore, sig: jsonToDb(rec.tokenIssueSig), - usig: rec.tokenUseSig === undefined ? null : jsonToDb(rec.tokenUseSig), + tokenUseSig: + rec.tokenUseSig === undefined ? null : jsonToDb(rec.tokenUseSig), ev: jsonToDb(rec.tokenEv), evh: crockToDb(rec.tokenEvHash), bk: crockToDb(rec.blindingKey), @@ -5138,7 +5139,7 @@ export class SqliteWalletTransaction implements WalletDbTransaction { description, extra_data, token_issue_pub, description_i18n ) VALUES ( $pub, $priv, $pid, $tid, $ci, $oi, $ri, $url, $kind, $tiph, $tfh, - $va, $vb, $usig, $ev, $evh, $bk, $slug, $name, $desc, $extra, $tipub, $di18n + $va, $vb, $tokenUseSig, $ev, $evh, $bk, $slug, $name, $desc, $extra, $tipub, $di18n ) ON CONFLICT(token_use_pub) DO UPDATE SET token_use_priv = excluded.token_use_priv, @@ -5177,7 +5178,8 @@ export class SqliteWalletTransaction implements WalletDbTransaction { tfh: optCrockToDb(rec.tokenFamilyHash), va: rec.validAfter, vb: rec.validBefore, - usig: rec.tokenUseSig === undefined ? null : jsonToDb(rec.tokenUseSig), + tokenUseSig: + rec.tokenUseSig === undefined ? null : jsonToDb(rec.tokenUseSig), ev: jsonToDb(rec.tokenEv), evh: crockToDb(rec.tokenEvHash), bk: crockToDb(rec.blindingKey), @@ -5241,7 +5243,7 @@ export class SqliteWalletTransaction implements WalletDbTransaction { refresh_group_id, coin_index, session_public_seed, refresh_protocol_version, amount_refresh_output, new_denoms, noreveal_index, last_error - ) VALUES ($id, $idx, $seed, $rpv, $amt, $nd, $nri, $err) + ) VALUES ($id, $idx, $seed, $rpv, $amt, $newDenoms, $nri, $err) ON CONFLICT(refresh_group_id, coin_index) DO UPDATE SET session_public_seed = excluded.session_public_seed, refresh_protocol_version = excluded.refresh_protocol_version, @@ -5255,7 +5257,7 @@ export class SqliteWalletTransaction implements WalletDbTransaction { seed: optCrockToDb(rec.sessionPublicSeed), rpv: rec.refreshProtocolVersion ?? null, amt: rec.amountRefreshOutput, - nd: jsonToDb(rec.newDenoms), + newDenoms: jsonToDb(rec.newDenoms), nri: rec.norevealIndex ?? null, err: rec.lastError === undefined ? null : jsonToDb(rec.lastError), }, diff --git a/packages/taler-wallet-core/src/db/testing/conformance-cases.ts b/packages/taler-wallet-core/src/db/testing/conformance-cases.ts @@ -4200,7 +4200,7 @@ export const conformanceCases: ConformanceCase[] = [ signed.tokenUseSig = { token_sig: "tsig", token_pub: "tpub", - ub_sig: { cipher: DenomKeyType.Rsa, rsa_signature: "usig" }, + ub_sig: { cipher: DenomKeyType.Rsa, rsa_signature: "use-sig" }, h_issue: "hissue", }; await runner.runReadWriteTx((tx) => tx.upsertSlate(signed)); diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts @@ -1818,7 +1818,7 @@ export interface ReadyExchangeSummary { } /** - * Exception to signal that an exchange that is intented + * Exception to signal that an exchange that is intended * to be used in a transaction is outdated. * * Thrown from transactions to trigger an exchange entry update diff --git a/packages/taler-wallet-core/src/pay-merchant.ts b/packages/taler-wallet-core/src/pay-merchant.ts @@ -2080,10 +2080,10 @@ export async function createOrReusePurchase( break; case PurchaseStatus.DoneRepurchaseDetected: { // Trigger replay on *old* payment - const repId = oldProposal.repurchaseProposalId; - if (repId != null) { + const repurchaseId = oldProposal.repurchaseProposalId; + if (repurchaseId != null) { await wex.runWalletDbTx(async (tx) => { - await startPayReplay(wex, tx, repId, sessionId); + await startPayReplay(wex, tx, repurchaseId, sessionId); }); } break; diff --git a/packages/taler-wallet-core/src/pay-template.ts b/packages/taler-wallet-core/src/pay-template.ts @@ -58,7 +58,7 @@ const logger = new Logger("pay-template.ts"); * @param templateContract template contract details that will be * modified by this function to match the overrides from the URI. * @param editableDefaults editable defaults passed on to the client, - * will be modified by this function to match the ovverrides from the URI + * will be modified by this function to match the overrides from the URI */ export function applyTemplateUriOverrides( parsedUri: TalerPayTemplateUri, diff --git a/packages/taler-wallet-core/src/refresh.ts b/packages/taler-wallet-core/src/refresh.ts @@ -754,10 +754,13 @@ async function deriveRefreshSession( checkLogicInvariant(refreshSession.sessionPublicSeed != null); const nks: { coin_offset: number; denom_pub_hash: string }[] = []; let coinOffset = 0; - for (const nd of newCoinDenoms) { - for (let i = 0; i < nd.count; i++, coinOffset++) { - if (nd.denomPub.cipher === DenomKeyType.ClauseSchnorr) { - nks.push({ coin_offset: coinOffset, denom_pub_hash: nd.denomPubHash }); + for (const newDenom of newCoinDenoms) { + for (let i = 0; i < newDenom.count; i++, coinOffset++) { + if (newDenom.denomPub.cipher === DenomKeyType.ClauseSchnorr) { + nks.push({ + coin_offset: coinOffset, + denom_pub_hash: newDenom.denomPubHash, + }); } } } @@ -878,16 +881,16 @@ export async function recoverRefreshCoinNonce( return undefined; } const newCoinDenoms: RefreshNewDenomInfo[] = []; - for (const nd of session.newDenoms) { + for (const newDenom of session.newDenoms) { const denom = await getDenomInfo(wex, tx, { exchangeMasterPub: oldCoin.exchangeMasterPub, - denomPubHash: nd.denomPubHash, + denomPubHash: newDenom.denomPubHash, }); if (!denom) { return undefined; } newCoinDenoms.push({ - count: nd.count, + count: newDenom.count, denomPub: denom.denomPub, denomPubHash: denom.denomPubHash, feeWithdraw: denom.feeWithdraw, diff --git a/packages/taler-wallet-core/src/tokenSelection.test.ts b/packages/taler-wallet-core/src/tokenSelection.test.ts @@ -250,7 +250,7 @@ test("payment repair retains its tokens and excludes other reservations", () => } }); -test("an unparseable issuer domain does not match instead of failing", (t) => { +test("an unparsable issuer domain does not match instead of failing", (t) => { const issuer = "https://backend.test.taler.net/"; assert.strictEqual(