summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2020-12-10 17:50:17 +0100
committerFlorian Dold <florian@dold.me>2020-12-10 17:50:17 +0100
commit80a0fab1261fc06f79db4c32fd7a1a6d0cb0db0f (patch)
tree87ed5e6f69414d5bdb9639fd529096988bf867e7 /packages/taler-wallet-core/src/operations
parentc27a7abfba9223d93d4603dc2284e26908b1bf38 (diff)
downloadwallet-core-80a0fab1261fc06f79db4c32fd7a1a6d0cb0db0f.tar.gz
wallet-core-80a0fab1261fc06f79db4c32fd7a1a6d0cb0db0f.tar.bz2
wallet-core-80a0fab1261fc06f79db4c32fd7a1a6d0cb0db0f.zip
backup schema
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r--packages/taler-wallet-core/src/operations/backup.ts21
1 files changed, 20 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/backup.ts b/packages/taler-wallet-core/src/operations/backup.ts
index cf73de62d..6c497b305 100644
--- a/packages/taler-wallet-core/src/operations/backup.ts
+++ b/packages/taler-wallet-core/src/operations/backup.ts
@@ -54,7 +54,7 @@ import {
stringToBytes,
} from "../crypto/talerCrypto";
import { canonicalizeBaseUrl, canonicalJson, j2s } from "../util/helpers";
-import { Timestamp } from "../util/time";
+import { getTimestampNow, Timestamp } from "../util/time";
import { URL } from "../util/url";
import { AmountString } from "../types/talerTypes";
import {
@@ -77,6 +77,16 @@ interface WalletBackupConfState {
walletRootPriv: string;
clocks: { [device_id: string]: number };
lastBackupHash?: string;
+
+ /**
+ * Timestamp stored in the last backup.
+ */
+ lastBackupTimestamp?: Timestamp;
+
+ /**
+ * Last time we tried to do a backup.
+ */
+ lastBackupCheckTimestamp?: Timestamp;
lastBackupNonce?: string;
}
@@ -237,6 +247,7 @@ export async function exportBackup(
base_url: ex.baseUrl,
accounts: ex.wireInfo.accounts.map((x) => ({
payto_uri: x.payto_uri,
+ master_sig: x.master_sig,
})),
auditors: ex.details.auditors.map((x) => ({
auditor_pub: x.auditor_pub,
@@ -261,6 +272,10 @@ export async function exportBackup(
});
});
+ if (!bs.lastBackupTimestamp) {
+ bs.lastBackupTimestamp = getTimestampNow();
+ }
+
const backupBlob: WalletBackupContentV1 = {
schema_id: "gnu-taler-wallet-backup-content",
schema_version: 1,
@@ -275,6 +290,10 @@ export async function exportBackup(
recoup_groups: [],
refresh_groups: [],
tips: [],
+ timestamp: bs.lastBackupTimestamp,
+ trusted_auditors: {},
+ trusted_exchanges: {},
+ intern_table: {},
};
// If the backup changed, we increment our clock.