aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2020-12-07 23:32:20 +0100
committerFlorian Dold <florian@dold.me>2020-12-07 23:32:20 +0100
commit0e33e540f32aa90ef8bd6ee19c239ae7f5bd7db9 (patch)
tree1e9373c1026adc39e319d3766ddcdd7feb70be38
parent6f474a3b9dba2ccf869e28a528337cadc8b35650 (diff)
CRDT-style tombstones
-rw-r--r--packages/taler-wallet-core/src/types/backupTypes.ts39
1 files changed, 31 insertions, 8 deletions
diff --git a/packages/taler-wallet-core/src/types/backupTypes.ts b/packages/taler-wallet-core/src/types/backupTypes.ts
index 6bdf26992..d6062b92d 100644
--- a/packages/taler-wallet-core/src/types/backupTypes.ts
+++ b/packages/taler-wallet-core/src/types/backupTypes.ts
@@ -21,8 +21,7 @@
* as the backup schema must remain very stable and should be self-contained.
*
* Current limitations:
- * 1. Deletion tomb stones aren't supported yet
- * 2. Exchange/auditor trust isn't exported yet
+ * 1. Exchange/auditor trust isn't exported yet
* (see https://bugs.gnunet.org/view.php?id=6448)
*
* General considerations / decisions:
@@ -70,12 +69,6 @@ export interface WalletBackupContentV1 {
schema_version: 1;
/**
- * Monotonically increasing clock of the wallet,
- * used to determine causality when merging backups.
- */
- clock: number;
-
- /**
* Root public key of the wallet. This field is present as
* a sanity check if the backup content JSON is loaded from file.
*/
@@ -90,6 +83,16 @@ export interface WalletBackupContentV1 {
current_device_id: string;
/**
+ * Monotonically increasing clock of the wallet,
+ * used to determine causality when merging backups.
+ *
+ * Information about other clocks, used to delete
+ * tombstones in the hopefully rare case that multiple wallets
+ * are connected to the same sync server.
+ */
+ clocks: { [device_id: string]: number };
+
+ /**
* Per-exchange data sorted by exchange master public key.
*
* Sorted by the exchange public key.
@@ -137,6 +140,21 @@ export interface WalletBackupContentV1 {
* Recoup groups.
*/
recoup_groups: BackupRecoupGroup[];
+
+ /**
+ * Tombstones for deleting purchases.
+ */
+ purchase_tombstones: {
+ /**
+ * Clock when the purchase was deleted
+ */
+ clock_deleted: number;
+
+ /**
+ * Proposal ID identifying the purchase.
+ */
+ proposal_id: string;
+ }[];
}
/**
@@ -646,6 +664,11 @@ export interface BackupPurchase {
proposal_id: string;
/**
+ * Clock when this purchase was created.
+ */
+ clock_created: number;
+
+ /**
* Contract terms we got from the merchant.
*/
contract_terms_raw: string;