Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
Tomoaki Imai | d95b53862f | |
Tomoaki Imai | f6bfbf09be | |
poma | 17fc574af3 |
|
@ -121,7 +121,7 @@ contract TornadoTrees is Initializable {
|
|||
/// @dev Insert a full batch of queued deposits into a merkle tree
|
||||
/// @param _proof A snark proof that elements were inserted correctly
|
||||
/// @param _argsHash A hash of snark inputs
|
||||
/// @param _argsHash Current merkle tree root
|
||||
/// @param _currentRoot Current merkle tree root
|
||||
/// @param _newRoot Updated merkle tree root
|
||||
/// @param _pathIndices Merkle path to inserted batch
|
||||
/// @param _events A batch of inserted events (leaves)
|
||||
|
@ -173,7 +173,7 @@ contract TornadoTrees is Initializable {
|
|||
/// @dev Insert a full batch of queued withdrawals into a merkle tree
|
||||
/// @param _proof A snark proof that elements were inserted correctly
|
||||
/// @param _argsHash A hash of snark inputs
|
||||
/// @param _argsHash Current merkle tree root
|
||||
/// @param _currentRoot Current merkle tree root
|
||||
/// @param _newRoot Updated merkle tree root
|
||||
/// @param _pathIndices Merkle path to inserted batch
|
||||
/// @param _events A batch of inserted events (leaves)
|
||||
|
|
|
@ -64,6 +64,14 @@ function prove(input, keyBasePath) {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates inputs for a snark and tornado trees smart contract.
|
||||
* This function updates MerkleTree argument
|
||||
*
|
||||
* @param tree Merkle tree with current smart contract state. This object is mutated during function execution.
|
||||
* @param events New batch of events to insert.
|
||||
* @returns {{args: [string, string, string, string, *], input: {pathElements: *, instances: *, blocks: *, newRoot: *, hashes: *, oldRoot: *, pathIndices: string}}}
|
||||
*/
|
||||
function batchTreeUpdate(tree, events) {
|
||||
const batchHeight = Math.log2(events.length)
|
||||
if (!Number.isInteger(batchHeight)) {
|
||||
|
|
Loading…
Reference in New Issue