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

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

@ -153,14 +153,6 @@ class EventService {
return undefined 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 { return {
events: savedEvents, events: savedEvents,
lastBlock: savedEvents[savedEvents.length - 1].blockNumber lastBlock: savedEvents[savedEvents.length - 1].blockNumber