summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-04-13 15:58:38 +0200
committerFlorian Dold <florian@dold.me>2023-04-13 15:58:38 +0200
commitb567ba4668a5ac034e7227f53b5290195303980c (patch)
treed98ea3061895ba222add5f0060a6781c1ea308d9 /packages/taler-wallet-core/src/operations
parentb96464fe09605e829dcd5715c69668e64c5454b3 (diff)
downloadwallet-core-b567ba4668a5ac034e7227f53b5290195303980c.tar.gz
wallet-core-b567ba4668a5ac034e7227f53b5290195303980c.tar.bz2
wallet-core-b567ba4668a5ac034e7227f53b5290195303980c.zip
wallet-core: work around missing timestamp in legacy transaction
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r--packages/taler-wallet-core/src/operations/transactions.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts
index 02c726449..3ace5bf71 100644
--- a/packages/taler-wallet-core/src/operations/transactions.ts
+++ b/packages/taler-wallet-core/src/operations/transactions.ts
@@ -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);