Skip to content

Commit

Permalink
chore: custom Inputs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
SwatiEY committed Jun 5, 2024
1 parent 16ff0cd commit a955c61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,7 @@ export const OrchestrationCodeBoilerPlate: any = (node: any) => {
}

params[0] = sendTransactionBoilerplate(node);
if(!node.returnInputs[0] && !params[0][4][0]) returnInputs.push(`1`); // If there are no return, circuit's default return is true
// params[0] = arr of nullifier root(s)
// params[1] = arr of commitment root(s)
// params[2] = arr of nullifiers
Expand All @@ -846,8 +847,8 @@ export const OrchestrationCodeBoilerPlate: any = (node: any) => {
(params[0][3][0]) ? params[0][3] = `[${params[0][3]}],` : params[0][3] = ` [], `; // commitments - array
(params[0][4][0]) ? params[0][4] = `[${params[0][4]}],` : params[0][4] = ` [], `; // cipherText - array of arrays
(params[0][5][0]) ? params[0][5] = `[${params[0][5]}],`: params[0][5] = ` [], `;// cipherText - array of arrays
if(!node.returnInputs[0] && !params[0][4]) returnInputs.push(`1`) // If there are no return, circuit's default return is true



if (node.functionName === 'cnstrctr') return {
statements: [
Expand Down
11 changes: 2 additions & 9 deletions src/transformers/visitors/toContractVisitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -896,15 +896,8 @@ DoWhileStatement: {
state.fnParameters.push(args[index]);

});
const params = [...(internalfnDefIndicators.nullifiersRequired? [`nullifierRoot`] : []),
...(internalfnDefIndicators.nullifiersRequired? [`latestNullifierRoot`] : []),
...(internalfnDefIndicators.nullifiersRequired? [`newNullifiers`] : []),
...(internalfnDefIndicators.oldCommitmentAccessRequired ? [`commitmentRoot`] : []),
...(internalfnDefIndicators.newCommitmentsRequired ? [`newCommitments`] : []),
...(internalfnDefIndicators.containsAccessedOnlyState ? [`checkNullifiers`] : []),
...(internalfnDefIndicators.encryptionRequired ? [`cipherText`] : []),
...(internalfnDefIndicators.encryptionRequired ? [`ephPubKeys`] : []),
`proof`,
const params = [
`inputs, proof`,
]

state.fnParameters = state.fnParameters.concat(params);
Expand Down

0 comments on commit a955c61

Please sign in to comment.