From 5da31361c631ae29c8de75569d5513ef17891490 Mon Sep 17 00:00:00 2001 From: gozzy Date: Sun, 30 Oct 2022 23:58:12 +0000 Subject: [PATCH] better idb assortment --- plugins/idb.js | 2 +- services/events.js | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/plugins/idb.js b/plugins/idb.js index 15a857f..38e6292 100644 --- a/plugins/idb.js +++ b/plugins/idb.js @@ -277,7 +277,7 @@ export default async (ctx, inject) => { }, { name: `withdrawals_${token}_${amount}`, - keyPath: 'transactionHash', + keyPath: 'blockNumber', indexes: WITHDRAWAL_INDEXES }, { diff --git a/services/events.js b/services/events.js index 70f302e..7ee6133 100644 --- a/services/events.js +++ b/services/events.js @@ -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