This commit is contained in:
Alexey 2019-07-15 14:57:14 +03:00
parent 35fdb50e3a
commit 234fb8940e

4
cli.js
View File

@ -41,8 +41,8 @@ async function withdraw(note, receiver) {
const validRoot = await mixer.methods.isKnownRoot(await tree.root()).call(); const validRoot = await mixer.methods.isKnownRoot(await tree.root()).call();
assert(validRoot === true); assert(validRoot === true);
const leafIndex = leaves.indexOf(deposit.commitment.toString()); const leafIndex = leaves.map(el => el.toString()).indexOf(deposit.commitment.toString());
assert(leafIndex > 0); assert(leafIndex >= 0);
const {root, path_elements, path_index} = await tree.path(leafIndex); const {root, path_elements, path_index} = await tree.path(leafIndex);
// Circuit input // Circuit input
const input = { const input = {