taler-typescript-core

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

commit 2867f9f6001263f1ec6ed585b92d03b580340d9b
parent e2055d929bcc2a139270d772d0fba99c122023b9
Author: Florian Dold <dold@taler.net>
Date:   Sun,  9 Aug 2026 19:27:10 +0200

util: decode auditor name in exchange keys

Diffstat:
Mpackages/taler-util/src/types-taler-exchange.test.ts | 11+++++++++++
Mpackages/taler-util/src/types-taler-exchange.ts | 6++++++
Mpackages/taler-util/src/types-taler-wallet.ts | 1+
3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/packages/taler-util/src/types-taler-exchange.test.ts b/packages/taler-util/src/types-taler-exchange.test.ts @@ -17,6 +17,7 @@ import { test } from "node:test"; import assert from "node:assert"; import { + codecForAuditor, codecForEventCounter, codecForExchangeKeysResponse, } from "./types-taler-exchange.js"; @@ -210,6 +211,16 @@ test("codecForExchangeKeysResponse accepts a real /keys document", (t) => { assert.strictEqual(keys.extensions_sig, undefined); }); +test("codecForAuditor accepts the human-readable auditor name", () => { + const auditor = codecForAuditor().decode({ + auditor_pub: "42M8YW3D31N1KZC8", + auditor_url: "https://auditor.example/", + auditor_name: "Example Auditor", + denomination_keys: [], + }); + assert.strictEqual(auditor.auditor_name, "Example Auditor"); +}); + test("codecForExchangeKeysResponse rejects a /keys document that is missing required fields", (t) => { // This is the exact shape that used to decode successfully, leaving // denominations, master_public_key and signkeys undefined behind a type diff --git a/packages/taler-util/src/types-taler-exchange.ts b/packages/taler-util/src/types-taler-exchange.ts @@ -179,6 +179,11 @@ export interface ExchangeAuditor { auditor_url: string; /** + * Human-readable name of the auditor. + */ + auditor_name: string; + + /** * List of signatures for denominations by the auditor. */ denomination_keys: AuditorDenomSig[]; @@ -649,6 +654,7 @@ export const codecForAuditor = (): Codec<ExchangeAuditor> => buildCodecForObject<ExchangeAuditor>() .property("auditor_pub", codecForString()) .property("auditor_url", codecForString()) + .property("auditor_name", codecForString()) .property("denomination_keys", codecForList(codecForAuditorDenomSig())) .build("Auditor"); diff --git a/packages/taler-util/src/types-taler-wallet.ts b/packages/taler-util/src/types-taler-wallet.ts @@ -1920,6 +1920,7 @@ const codecForExchangeAuditor = (): Codec<ExchangeAuditor> => buildCodecForObject<ExchangeAuditor>() .property("auditor_pub", codecForString()) .property("auditor_url", codecForString()) + .property("auditor_name", codecForString()) .property("denomination_keys", codecForList(codecForAuditorDenomSig())) .build("codecForExchangeAuditor");