wallet-core: be less spammy with self-transitions and logging

This commit is contained in:
Florian Dold 2023-06-20 15:10:51 +02:00
parent 9c708251f9
commit 26b30a462a
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
5 changed files with 15 additions and 14 deletions

View File

@ -1005,9 +1005,6 @@ export const nativeCryptoR: TalerCryptoInterfaceR = {
pb.put(hash(stringToBytes(canonicalJson(req.creditRestrictions) + "\0")));
}
const p = pb.build();
logger.info(`wire sig blob: ${encodeCrock(p)}`);
logger.info(`credit restrictions: ${j2s(req.creditRestrictions)}`);
logger.info(`debit restrictions: ${j2s(req.debitRestrictions)}`);
return { valid: eddsaVerify(p, decodeCrock(sig), decodeCrock(masterPub)) };
},

View File

@ -371,7 +371,11 @@ async function storePendingTaskPending(
retryRecord.retryInfo = RetryInfo.increment(retryRecord.retryInfo);
}
await tx.operationRetries.put(retryRecord);
return taskToTransactionNotification(ws, tx, pendingTaskId, undefined);
if (hadError) {
return taskToTransactionNotification(ws, tx, pendingTaskId, undefined);
} else {
return undefined;
}
});
if (maybeNotification) {
ws.notify(maybeNotification);

View File

@ -134,7 +134,7 @@ export async function downloadExchangeWithTermsOfService(
timeout: Duration,
contentType: string,
): Promise<ExchangeTosDownloadResult> {
logger.info(`downloading exchange tos (type ${contentType})`);
logger.trace(`downloading exchange tos (type ${contentType})`);
const reqUrl = new URL("terms", exchangeBaseUrl);
const headers = {
Accept: contentType,
@ -580,7 +580,7 @@ export async function updateExchangeFromUrlHandler(
}>
> {
const forceNow = options.forceNow ?? false;
logger.info(
logger.trace(
`updating exchange info for ${exchangeBaseUrl}, forced: ${forceNow}`,
);
@ -628,7 +628,7 @@ export async function updateExchangeFromUrlHandler(
timeout,
);
logger.info("validating exchange /wire info");
logger.trace("validating exchange /wire info");
const version = LibtoolVersion.parseVersion(keysInfo.protocolVersion);
if (!version) {
@ -663,7 +663,7 @@ export async function updateExchangeFromUrlHandler(
};
}
logger.info("finished validating exchange /wire info");
logger.trace("finished validating exchange /wire info");
// We download the text/plain version here,
// because that one needs to exist, and we
@ -783,7 +783,7 @@ export async function updateExchangeFromUrlHandler(
});
}
logger.info("updating denominations in database");
logger.trace("updating denominations in database");
const currentDenomSet = new Set<string>(
keysInfo.currentDenominations.map((x) => x.denomPubHash),
);

View File

@ -1175,10 +1175,10 @@ export async function autoRefresh(
`created refresh group for auto-refresh (${res.refreshGroupId})`,
);
}
logger.info(
logger.trace(
`current wallet time: ${AbsoluteTime.toIsoString(AbsoluteTime.now())}`,
);
logger.info(
logger.trace(
`next refresh check at ${AbsoluteTime.toIsoString(minCheckThreshold)}`,
);
exchange.nextRefreshCheck =

View File

@ -1199,14 +1199,14 @@ async function queryReserve(
);
reserveUrl.searchParams.set("timeout_ms", "30000");
logger.info(`querying reserve status via ${reserveUrl.href}`);
logger.trace(`querying reserve status via ${reserveUrl.href}`);
const resp = await ws.http.fetch(reserveUrl.href, {
timeout: getReserveRequestTimeout(withdrawalGroup),
cancellationToken,
});
logger.info(`reserve status code: HTTP ${resp.status}`);
logger.trace(`reserve status code: HTTP ${resp.status}`);
const result = await readSuccessResponseJsonOrErrorCode(
resp,
@ -1214,7 +1214,7 @@ async function queryReserve(
);
if (result.isError) {
logger.info(
logger.trace(
`got reserve status error, EC=${result.talerErrorResponse.code}`,
);
if (