wallet-core: use/allow txids as tombstone
This commit is contained in:
parent
7eef3f57d2
commit
126e9e7457
@ -465,7 +465,7 @@ export type ParsedTombstone =
|
|||||||
tag: TombstoneTag.DeleteWithdrawalGroup;
|
tag: TombstoneTag.DeleteWithdrawalGroup;
|
||||||
withdrawalGroupId: string;
|
withdrawalGroupId: string;
|
||||||
}
|
}
|
||||||
| { tag: TombstoneTag.DeleteRefund; refundGroupId: string };
|
| { tag: TombstoneTag.DeleteRefund; refundGroupId: string }
|
||||||
|
|
||||||
export function constructTombstone(p: ParsedTombstone): TombstoneIdStr {
|
export function constructTombstone(p: ParsedTombstone): TombstoneIdStr {
|
||||||
switch (p.tag) {
|
switch (p.tag) {
|
||||||
|
@ -24,7 +24,6 @@ import {
|
|||||||
Logger,
|
Logger,
|
||||||
NotificationType,
|
NotificationType,
|
||||||
OrderShortInfo,
|
OrderShortInfo,
|
||||||
PaymentStatus,
|
|
||||||
PeerContractTerms,
|
PeerContractTerms,
|
||||||
RefundInfoShort,
|
RefundInfoShort,
|
||||||
RefundPaymentInfo,
|
RefundPaymentInfo,
|
||||||
@ -54,7 +53,6 @@ import {
|
|||||||
WithdrawalGroupRecord,
|
WithdrawalGroupRecord,
|
||||||
WithdrawalRecordType,
|
WithdrawalRecordType,
|
||||||
WalletContractData,
|
WalletContractData,
|
||||||
PeerPushPaymentInitiationStatus,
|
|
||||||
PeerPullPaymentIncomingStatus,
|
PeerPullPaymentIncomingStatus,
|
||||||
DepositElementStatus,
|
DepositElementStatus,
|
||||||
WithdrawalGroupStatus,
|
WithdrawalGroupStatus,
|
||||||
@ -71,8 +69,6 @@ import { assertUnreachable } from "../util/assertUnreachable.js";
|
|||||||
import { checkDbInvariant, checkLogicInvariant } from "../util/invariants.js";
|
import { checkDbInvariant, checkLogicInvariant } from "../util/invariants.js";
|
||||||
import { constructTaskIdentifier, TaskIdentifiers } from "../util/retries.js";
|
import { constructTaskIdentifier, TaskIdentifiers } from "../util/retries.js";
|
||||||
import {
|
import {
|
||||||
constructTombstone,
|
|
||||||
makeTombstoneId,
|
|
||||||
resetOperationTimeout,
|
resetOperationTimeout,
|
||||||
runOperationWithErrorReporting,
|
runOperationWithErrorReporting,
|
||||||
TombstoneTag,
|
TombstoneTag,
|
||||||
@ -1625,12 +1621,7 @@ export async function deleteTransaction(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await tx.refundGroups.delete(refundGroupId);
|
await tx.refundGroups.delete(refundGroupId);
|
||||||
await tx.tombstones.put({
|
await tx.tombstones.put({ id: transactionId });
|
||||||
id: constructTombstone({
|
|
||||||
tag: TombstoneTag.DeleteRefund,
|
|
||||||
refundGroupId,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1645,12 +1636,7 @@ export async function deleteTransaction(
|
|||||||
);
|
);
|
||||||
if (debit) {
|
if (debit) {
|
||||||
await tx.peerPullPaymentIncoming.delete(peerPullPaymentIncomingId);
|
await tx.peerPullPaymentIncoming.delete(peerPullPaymentIncomingId);
|
||||||
await tx.tombstones.put({
|
await tx.tombstones.put({ id: transactionId });
|
||||||
id: makeTombstoneId(
|
|
||||||
TombstoneTag.DeletePeerPullDebit,
|
|
||||||
peerPullPaymentIncomingId,
|
|
||||||
),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1665,9 +1651,7 @@ export async function deleteTransaction(
|
|||||||
const debit = await tx.peerPushPaymentInitiations.get(pursePub);
|
const debit = await tx.peerPushPaymentInitiations.get(pursePub);
|
||||||
if (debit) {
|
if (debit) {
|
||||||
await tx.peerPushPaymentInitiations.delete(pursePub);
|
await tx.peerPushPaymentInitiations.delete(pursePub);
|
||||||
await tx.tombstones.put({
|
await tx.tombstones.put({ id: transactionId });
|
||||||
id: makeTombstoneId(TombstoneTag.DeletePeerPushDebit, pursePub),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user