Skip to content

Commit

Permalink
Polish refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tensojka committed Sep 23, 2024
1 parent d40b022 commit 2a46b2e
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions backend/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ export const getRawVestingEvents = async (contract: string, provider: RpcProvide
let cached = getCachedVestingEvents(contract, fromBlock);

const newlyFetched = await fetchVestingEvents(contract, provider, cached.lastBlock);
console.log("fetched ", newlyFetched.length, " events")
const events = [...cached.events, ...newlyFetched];
const cacheKey = { contract, fromBlock };
console.log('saving ', newlyFetched.length, ' newly fetched to cache');
cache.set(`${contract}-${fromBlock}`, { events, lastBlock: (await latestBlockPromise).block_number });
return events;
Expand Down Expand Up @@ -44,8 +42,6 @@ const fetchVestingEvents = async (contract: string, provider: RpcProvider, fromB
let res = events.events

if (events.continuation_token) { // means we can continue, more to fetch
console.debug('continuing', events.continuation_token);
console.debug(res.length)
const nextEvents = await fetchVestingEvents(contract, provider, fromBlock, events.continuation_token);
res = [...res, ...nextEvents];
}
Expand Down

0 comments on commit 2a46b2e

Please sign in to comment.