store ToS acceptance timestamp, remove unused backup attributes
This commit is contained in:
parent
6e11b69cf5
commit
cc795f350a
@ -806,12 +806,6 @@ export interface BackupPurchase {
|
||||
*/
|
||||
refunds: BackupRefundItem[];
|
||||
|
||||
/**
|
||||
* Is the purchase considered defunct (either during payment
|
||||
* or during abort if abort_status is set).
|
||||
*/
|
||||
defunct?: boolean;
|
||||
|
||||
/**
|
||||
* Abort status of the payment.
|
||||
*/
|
||||
@ -1006,8 +1000,6 @@ export interface BackupReserve {
|
||||
* Groups of withdrawal operations for this reserve. Typically just one.
|
||||
*/
|
||||
withdrawal_groups: BackupWithdrawalGroup[];
|
||||
|
||||
defective?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1179,12 +1171,12 @@ export interface BackupExchangeDetails {
|
||||
/**
|
||||
* ETag for last terms of service download.
|
||||
*/
|
||||
tos_etag_last: string | undefined;
|
||||
tos_accepted_etag: string | undefined;
|
||||
|
||||
/**
|
||||
* ETag for last terms of service download.
|
||||
* Timestamp when the ToS has been accepted.
|
||||
*/
|
||||
tos_etag_accepted: string | undefined;
|
||||
tos_accepted_timestamp: Timestamp | undefined;
|
||||
}
|
||||
|
||||
export enum BackupProposalStatus {
|
||||
|
@ -570,10 +570,17 @@ export interface ExchangeDetailsRecord {
|
||||
termsOfServiceLastEtag: string | undefined;
|
||||
|
||||
/**
|
||||
* ETag for last terms of service download.
|
||||
* ETag for last terms of service accepted.
|
||||
*/
|
||||
termsOfServiceAcceptedEtag: string | undefined;
|
||||
|
||||
/**
|
||||
* Timestamp when the ToS was accepted.
|
||||
*
|
||||
* Used during backup merging.
|
||||
*/
|
||||
termsOfServiceAcceptedTimestamp: Timestamp | undefined;
|
||||
|
||||
wireInfo: WireInfo;
|
||||
}
|
||||
|
||||
|
@ -311,8 +311,8 @@ export async function exportBackup(
|
||||
stamp_expire: x.stamp_expire,
|
||||
stamp_start: x.stamp_start,
|
||||
})),
|
||||
tos_etag_accepted: ex.termsOfServiceAcceptedEtag,
|
||||
tos_etag_last: ex.termsOfServiceLastEtag,
|
||||
tos_accepted_etag: ex.termsOfServiceAcceptedEtag,
|
||||
tos_accepted_timestamp: ex.termsOfServiceAcceptedTimestamp,
|
||||
denominations:
|
||||
backupDenominationsByExchange[ex.exchangeBaseUrl] ?? [],
|
||||
reserves: backupReservesByExchange[ex.exchangeBaseUrl] ?? [],
|
||||
|
@ -297,9 +297,11 @@ export async function importBackup(
|
||||
}
|
||||
await tx.exchangeDetails.put({
|
||||
exchangeBaseUrl: backupExchangeDetails.base_url,
|
||||
termsOfServiceAcceptedEtag: backupExchangeDetails.tos_etag_accepted,
|
||||
termsOfServiceAcceptedEtag: backupExchangeDetails.tos_accepted_etag,
|
||||
termsOfServiceText: undefined,
|
||||
termsOfServiceLastEtag: backupExchangeDetails.tos_etag_last,
|
||||
termsOfServiceLastEtag: undefined,
|
||||
termsOfServiceAcceptedTimestamp:
|
||||
backupExchangeDetails.tos_accepted_timestamp,
|
||||
wireInfo,
|
||||
currency: backupExchangeDetails.currency,
|
||||
auditors: backupExchangeDetails.auditors.map((x) => ({
|
||||
|
@ -496,6 +496,7 @@ async function updateExchangeFromUrlImpl(
|
||||
termsOfServiceText: tosDownload.tosText,
|
||||
termsOfServiceAcceptedEtag: undefined,
|
||||
termsOfServiceLastEtag: tosDownload.tosEtag,
|
||||
termsOfServiceAcceptedTimestamp: getTimestampNow(),
|
||||
};
|
||||
// FIXME: only update if pointer got updated
|
||||
r.lastError = undefined;
|
||||
|
Loading…
Reference in New Issue
Block a user