From 17fc574af3431e536e9701a4c302df9eaca7062e Mon Sep 17 00:00:00 2001 From: poma Date: Thu, 25 Mar 2021 17:44:52 +0300 Subject: [PATCH] docs --- src/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/index.js b/src/index.js index 77e8f1f..aac6421 100644 --- a/src/index.js +++ b/src/index.js @@ -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)) {