commit ea6ae2d92ea6a8cc13f1cdc8f25a13dc402f4cd6
parent e72e8e786467ff9e02e1983ab1fafa3acd4a1856
Author: Florian Dold <dold@taler.net>
Date: Tue, 21 Jul 2026 03:04:36 +0200
util: name the AML statistics counter field event, matching the wire format
The spec and the C server pack the statistic name as "event", but the interface
and codec used "name", so any non-empty AML statistics response failed to decode.
Rename the field and update the 204 fallback that synthesises the counters.
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/packages/taler-util/src/http-client/exchange-client.ts b/packages/taler-util/src/http-client/exchange-client.ts
@@ -1022,7 +1022,7 @@ export class TalerExchangeHttpClient {
case HttpStatusCode.NoContent: {
return opFixedSuccess(resp, {
statistics: names.map(
- (name) => ({ counter: 0, name }) as EventCounter,
+ (name) => ({ counter: 0, event: name }) as EventCounter,
),
});
}
diff --git a/packages/taler-util/src/types-taler-exchange.ts b/packages/taler-util/src/types-taler-exchange.ts
@@ -2134,7 +2134,7 @@ export interface AmlStatisticsResponse {
}
export interface EventCounter {
// Name of the statistic that is being returned.
- name: string;
+ event: string;
// Number of events of the specified type in
// the given range.
@@ -2631,7 +2631,7 @@ export const codecForAmlStatisticsResponse = (): Codec<AmlStatisticsResponse> =>
export const codecForEventCounter = (): Codec<EventCounter> =>
buildCodecForObject<EventCounter>()
- .property("name", codecForString())
+ .property("event", codecForString())
.property("counter", codecForNumber())
.build("TalerExchangeApi.EventCounter");