wallet-core: work around missing timestamp in legacy transaction
This commit is contained in:
parent
b96464fe09
commit
b567ba4668
@ -162,6 +162,7 @@ advancedCli
|
||||
await runTestWithState(testState, runEnv1, "env1", true);
|
||||
});
|
||||
|
||||
|
||||
const sandcastleCli = testingCli.subcommand("sandcastleArgs", "sandcastle", {
|
||||
help: "Subcommands for handling GNU Taler sandcastle deployments.",
|
||||
});
|
||||
|
@ -38,6 +38,7 @@ import {
|
||||
setGlobalLogLevelFromString,
|
||||
summarizeTalerErrorDetail,
|
||||
TalerUriType,
|
||||
Transaction,
|
||||
WalletNotification,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { clk } from "@gnu-taler/taler-util/clk";
|
||||
@ -1128,6 +1129,16 @@ const advancedCli = walletCli.subcommand("advancedArgs", "advanced", {
|
||||
help: "Subcommands for advanced operations (only use if you know what you're doing!).",
|
||||
});
|
||||
|
||||
advancedCli
|
||||
.subcommand("sampleTransactions", "sample-transactions", {
|
||||
help: "Print sample wallet-core transactions",
|
||||
})
|
||||
.action(async (args) => {
|
||||
let transactions: Transaction[] = [
|
||||
|
||||
];
|
||||
});
|
||||
|
||||
advancedCli
|
||||
.subcommand("serve", "serve", {
|
||||
help: "Serve the wallet API via a unix domain socket.",
|
||||
|
@ -525,7 +525,8 @@ function buildTransactionForPeerPullCredit(
|
||||
? ExtendedStatus.Done
|
||||
: ExtendedStatus.Pending,
|
||||
pending: !wsr.timestampFinish,
|
||||
timestamp: pullCredit.mergeTimestamp,
|
||||
// Old transactions don't have it!
|
||||
timestamp: pullCredit.mergeTimestamp ?? TalerProtocolTimestamp.now(),
|
||||
info: {
|
||||
expiration: wsr.wgInfo.contractTerms.purse_expiration,
|
||||
summary: wsr.wgInfo.contractTerms.summary,
|
||||
@ -558,7 +559,8 @@ function buildTransactionForPeerPullCredit(
|
||||
exchangeBaseUrl: pullCredit.exchangeBaseUrl,
|
||||
extendedStatus: ExtendedStatus.Pending,
|
||||
pending: true,
|
||||
timestamp: pullCredit.mergeTimestamp,
|
||||
// Old transactions don't have it!
|
||||
timestamp: pullCredit.mergeTimestamp ?? TalerProtocolTimestamp.now(),
|
||||
info: {
|
||||
expiration: peerContractTerms.purse_expiration,
|
||||
summary: peerContractTerms.summary,
|
||||
@ -1387,6 +1389,9 @@ export async function getTransactions(
|
||||
if (!tx.amountRaw) {
|
||||
logger.warn(`missing amountRaw in ${j2s(tx)}`);
|
||||
}
|
||||
if (!tx.timestamp) {
|
||||
logger.warn(`missing timestamp in ${j2s(tx)}`);
|
||||
}
|
||||
}
|
||||
|
||||
const txPending = transactions.filter((x) => x.pending);
|
||||
|
Loading…
Reference in New Issue
Block a user