Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(suite): migrate ripple txs by removing and re-fetching transfers
Browse files Browse the repository at this point in the history
izmy committed Jan 28, 2025
1 parent e1dcfbe commit c959e1a
Showing 2 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/suite/src/storage/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Storage changelog

## 52

- saved ripple network type txs are removed to be fetched again and obtain internal transfers and token transfer contract and standard

## 51

- Changed `metadata.key` on non-eth EVM networks accounts to be `descriptor-chainId`
23 changes: 23 additions & 0 deletions packages/suite/src/storage/migrations/index.ts
Original file line number Diff line number Diff line change
@@ -1176,4 +1176,27 @@ export const migrate: OnUpgradeFunc<SuiteDBSchema> = async (
return account;
});
}

if (oldVersion < 52) {
const accountsToUpdate = ['xrp', 'txrp'];

// remove ripple network transactions
await updateAll<'txs', DBWalletAccountTransactionCompatible>(transaction, 'txs', tx => {
if (accountsToUpdate.includes(tx.tx.symbol)) {
return null;
}
tx.tx.internalTransfers = [];

return tx;
});

// force to fetch ripple network transactions again
await updateAll(transaction, 'accounts', account => {
if (accountsToUpdate.includes(account.symbol)) {
account.history = { total: 0, unconfirmed: 0, tokens: 0 };

return account;
}
});
}
};

0 comments on commit c959e1a

Please sign in to comment.