Skip to content

Commit c959e1a

Browse files
committed
chore(suite): migrate ripple txs by removing and re-fetching transfers
1 parent e1dcfbe commit c959e1a

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

packages/suite/src/storage/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Storage changelog
22

3+
## 52
4+
5+
- saved ripple network type txs are removed to be fetched again and obtain internal transfers and token transfer contract and standard
6+
37
## 51
48

59
- Changed `metadata.key` on non-eth EVM networks accounts to be `descriptor-chainId`

packages/suite/src/storage/migrations/index.ts

+23
Original file line numberDiff line numberDiff line change
@@ -1176,4 +1176,27 @@ export const migrate: OnUpgradeFunc<SuiteDBSchema> = async (
11761176
return account;
11771177
});
11781178
}
1179+
1180+
if (oldVersion < 52) {
1181+
const accountsToUpdate = ['xrp', 'txrp'];
1182+
1183+
// remove ripple network transactions
1184+
await updateAll<'txs', DBWalletAccountTransactionCompatible>(transaction, 'txs', tx => {
1185+
if (accountsToUpdate.includes(tx.tx.symbol)) {
1186+
return null;
1187+
}
1188+
tx.tx.internalTransfers = [];
1189+
1190+
return tx;
1191+
});
1192+
1193+
// force to fetch ripple network transactions again
1194+
await updateAll(transaction, 'accounts', account => {
1195+
if (accountsToUpdate.includes(account.symbol)) {
1196+
account.history = { total: 0, unconfirmed: 0, tokens: 0 };
1197+
1198+
return account;
1199+
}
1200+
});
1201+
}
11791202
};

0 commit comments

Comments
 (0)