Skip to content

Commit

Permalink
fix: for decrementation
Browse files Browse the repository at this point in the history
  • Loading branch information
lydiagarms committed Jul 5, 2024
1 parent 32568d8 commit f393811
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ class BoilerplateGenerator {

statements({ name: x, subtrahend, newCommitmentValue, structProperties, memberName}): string[] {
if (structProperties) {
return [`${x}.${memberName} = ${x}.${memberName} - ${newCommitmentValue[memberName]}`]
return [`${x}.${memberName} = ${x}.${memberName} - ${newCommitmentValue}`]
}
return [`${x} = ${x} - (${newCommitmentValue})`];
// const y = codeGenerator(subtrahend);
Expand Down
3 changes: 0 additions & 3 deletions src/codeGenerators/circuit/zokrates/toCircuit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,6 @@ function codeGenerator(node: any) {
let newComValue = '';
if (node.bpType === 'incrementation') newComValue = codeGenerator(node.addend);
if (node.bpType === 'decrementation') newComValue = codeGenerator(node.subtrahend);
console.log(node.newCommitmentValue);
console.log(node.addend);
console.log(newComValue);
node.newCommitmentValue = newComValue;
return Circuitbp.generateBoilerplate(node);
}
Expand Down

0 comments on commit f393811

Please sign in to comment.