better idb assortment

This commit is contained in:
gozzy 2022-10-30 23:58:12 +00:00
parent ef04356f84
commit 5da31361c6
2 changed files with 1 additions and 9 deletions

View File

@ -277,7 +277,7 @@ export default async (ctx, inject) => {
},
{
name: `withdrawals_${token}_${amount}`,
keyPath: 'transactionHash',
keyPath: 'blockNumber',
indexes: WITHDRAWAL_INDEXES
},
{

View File

@ -153,14 +153,6 @@ class EventService {
return undefined
}
// IndexedDB scrambles assortment
savedEvents.sort((a, b) => {
if (a.leafIndex && b.leafIndex) {
return a.leafIndex - b.leafIndex
}
return a.blockNumber - b.blockNumber
})
return {
events: savedEvents,
lastBlock: savedEvents[savedEvents.length - 1].blockNumber