From 42b2318d2ad35a21e2744f2e21fa1b26ff41752b Mon Sep 17 00:00:00 2001 From: Alexey Date: Thu, 1 Apr 2021 21:13:12 +0300 Subject: [PATCH] tidy --- src/events.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/events.js b/src/events.js index 01ed984..5eeeb38 100644 --- a/src/events.js +++ b/src/events.js @@ -2,7 +2,7 @@ const { getTornadoTrees, getProvider } = require('./singletons') const { action } = require('./utils') const ethers = require('ethers') const abi = new ethers.utils.AbiCoder() -const fs = require('fs') +// const fs = require('fs') const { poseidonHash, toFixedHex } = require('./utils') async function getTornadoTreesEvents(type, fromBlock, toBlock) { @@ -63,16 +63,8 @@ async function getMigrationEvents(type) { ...e, poseidon: toFixedHex(poseidonHash([e.instance, e.hash, e.block])), })) - - console.log('allEvents.slice(-1)', allEvents.slice(-1)) - const trees = await getTornadoTrees() - const lastHash = allEvents.slice(-1)[0].hash - const eventType = type === action.DEPOSIT ? 'DepositData' : 'WithdrawalData' - const eventFilter = trees.filters[eventType](null, lastHash) - const event = await trees.queryFilter(eventFilter) - console.log('event', event[0].blockNumber) // it can be useful to get all necessary events for claiming AP - fs.writeFileSync(`./cache/${type}.json`, JSON.stringify(allEvents, null, 2)) + // fs.writeFileSync(`./cache/${type}.json`, JSON.stringify(allEvents, null, 2)) return { committedEvents: allEvents.slice(0, committedCount.toNumber()), pendingEvents: allEvents.slice(committedCount.toNumber()),