This commit is contained in:
poma 2021-03-04 12:17:32 +03:00
parent f8678ab44e
commit f28c4850b3
No known key found for this signature in database
GPG Key ID: BA20CB01FE165657
2 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ async function getTornadoTreesEvents(type, fromBlock, toBlock) {
hash,
block: block.toNumber(),
index: index.toNumber(),
sha3: ethers.utils.keccak256(encodedData)
sha3: ethers.utils.keccak256(encodedData),
}
})
.sort((a, b) => a.index - b.index)

View File

@ -5,8 +5,8 @@ const { poseidon } = require('circomlib')
const toFixedHex = (number, length = 32) =>
'0x' +
(number instanceof Buffer
? number.toString('hex')
: BigNumber.from(number).toHexString().slice(2)
? number.toString('hex')
: BigNumber.from(number).toHexString().slice(2)
).padStart(length * 2, '0')
const poseidonHash = (items) => BigNumber.from(poseidon(items))