Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return obj
}
/**
* Given a sequence of index1, elements1, ..., indexN elementN this function returns
* the corresponding MerkleTree of height 7.
*/
const _generateMerkleTree = function(...args) {
const txs = Array(2 ** 7).fill(sha256(0x0))
for (let i = 0; i < args.length; i += 2) {
txs[args[i]] = args[i + 1]
}
return new MerkleTree(txs, sha256)
}
const generateMerkleTree = memoize(_generateMerkleTree, {
strategy: memoize.strategies.variadic,
})
const sendTxAndGetReturnValue = async function(method, ...args) {
const result = await method.call(...args)
await method(...args)
return result
}
/**
* Partitions array into chunks of size spacing
* @param input: Array
* @param spacing: int
* @returns {Array}
*/
function partitionArray(input, spacing) {
const output = []