formatting

This commit is contained in:
poma 2021-03-16 19:06:47 +03:00
parent c7e9fc2bb2
commit 7f0895af92
No known key found for this signature in database
GPG Key ID: BA20CB01FE165657

View File

@ -16,7 +16,7 @@ async function updateTree(committedEvents, pendingEvents, type) {
const rootMethod = type === action.DEPOSIT ? 'depositRoot' : 'withdrawalRoot' const rootMethod = type === action.DEPOSIT ? 'depositRoot' : 'withdrawalRoot'
const root = toFixedHex(await getTornadoTrees()[rootMethod]()) const root = toFixedHex(await getTornadoTrees()[rootMethod]())
if (!BigNumber.from(root).eq(tree.root())) { if (!BigNumber.from(root).eq(tree.root())) {
throw new Error(`Invalid ${type} root! Contract: ${root}, local: ${tree.root()}`) throw new Error(`Invalid ${type} root! Contract: ${BigNumber.from(root).toHexString()}, local: ${tree.root().toHexString()}`)
} }
while (pendingEvents.length >= INSERT_BATCH_SIZE) { while (pendingEvents.length >= INSERT_BATCH_SIZE) {
const chunk = pendingEvents.splice(0, INSERT_BATCH_SIZE) const chunk = pendingEvents.splice(0, INSERT_BATCH_SIZE)