@ercworldio/blockchain-shared 1.0.1-dev.8 → 1.0.1-dev.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -62,5 +62,5 @@ __decorate([
|
|
|
62
62
|
], DepositAddressArchive.prototype, "archived_reason", void 0);
|
|
63
63
|
exports.DepositAddressArchive = DepositAddressArchive = __decorate([
|
|
64
64
|
(0, typeorm_1.Entity)({ name: "deposit_addresses_archive", schema: "usersmanagement" }),
|
|
65
|
-
(0, typeorm_1.Unique)(['
|
|
65
|
+
(0, typeorm_1.Unique)(['blockchain', 'address'])
|
|
66
66
|
], DepositAddressArchive);
|
|
@@ -227,7 +227,7 @@ class BalanceService extends errors_1.default {
|
|
|
227
227
|
(original_id, user_id, blockchain, parent_index, child_index, address, transaction_count, expires_at, archived_at, archived_reason)
|
|
228
228
|
SELECT id, user_id, blockchain, parent_index, child_index, address, transaction_count, expires_at, now(), 'renewed'
|
|
229
229
|
FROM old_address
|
|
230
|
-
ON CONFLICT (
|
|
230
|
+
ON CONFLICT (blockchain,address) DO NOTHING
|
|
231
231
|
),
|
|
232
232
|
updated_address AS (
|
|
233
233
|
UPDATE usersmanagement.deposit_addresses
|
|
@@ -55,7 +55,7 @@ class DepositAddressArchiveService {
|
|
|
55
55
|
INSERT INTO usersmanagement.deposit_addresses_archive
|
|
56
56
|
(original_id, user_id, blockchain, parent_index, child_index, address, transaction_count, expires_at, archived_at, archived_reason)
|
|
57
57
|
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, now(), $9)
|
|
58
|
-
ON CONFLICT (
|
|
58
|
+
ON CONFLICT (blockchain, address) DO NOTHING
|
|
59
59
|
RETURNING *
|
|
60
60
|
`, [
|
|
61
61
|
address.id,
|
|
@@ -70,7 +70,7 @@ class DepositAddressArchiveService {
|
|
|
70
70
|
]);
|
|
71
71
|
// If conflict (already archived), return the existing record
|
|
72
72
|
if (rows.length === 0) {
|
|
73
|
-
return repo.findOneOrFail({ where: {
|
|
73
|
+
return repo.findOneOrFail({ where: { blockchain: address.blockchain, address: address.address } });
|
|
74
74
|
}
|
|
75
75
|
return rows[0];
|
|
76
76
|
});
|