remove obsolete circuit inputs

This commit is contained in:
poma 2021-10-17 13:55:54 +03:00
parent d4b381a0a2
commit 0ea12fc209
No known key found for this signature in database
GPG Key ID: BA20CB01FE165657
2 changed files with 0 additions and 7 deletions

View File

@ -36,8 +36,6 @@ template Transaction(levels, nIns, nOuts, zeroLeaf) {
signal private input outAmount[nOuts]; signal private input outAmount[nOuts];
signal private input outBlinding[nOuts]; signal private input outBlinding[nOuts];
signal private input outPubkey[nOuts]; signal private input outPubkey[nOuts];
signal private input outPathIndices;
signal private input outPathElements[levels - 1];
component inKeypair[nIns]; component inKeypair[nIns];
component inUtxoHasher[nIns]; component inUtxoHasher[nIns];

View File

@ -42,9 +42,6 @@ async function getProof({ inputs, outputs, tree, extAmount, fee, recipient, rela
output.index = tree.elements().length output.index = tree.elements().length
tree.insert(output.getCommitment()) tree.insert(output.getCommitment())
} }
const outputIndex = tree.elements().length - 1
const outputPath = tree.path(outputIndex).pathElements
const outputBatchBits = Math.log2(outputs.length)
const extData = { const extData = {
recipient: toFixedHex(recipient, 20), recipient: toFixedHex(recipient, 20),
@ -75,8 +72,6 @@ async function getProof({ inputs, outputs, tree, extAmount, fee, recipient, rela
outAmount: outputs.map((x) => x.amount), outAmount: outputs.map((x) => x.amount),
outBlinding: outputs.map((x) => x.blinding), outBlinding: outputs.map((x) => x.blinding),
outPubkey: outputs.map((x) => x.keypair.pubkey), outPubkey: outputs.map((x) => x.keypair.pubkey),
outPathIndices: outputIndex >> outputBatchBits,
outPathElements: outputPath.slice(outputBatchBits),
} }
const proof = await prove(input, `./artifacts/circuits/transaction${inputs.length}`) const proof = await prove(input, `./artifacts/circuits/transaction${inputs.length}`)