Skip to content

Commit e884c86

Browse files
committed
fix(orchestration): error where we ensure there are new leaves even for functions where there are no new commitments
1 parent 6a0d64e commit e884c86

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/boilerplate/orchestration/javascript/raw/toOrchestration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ export const OrchestrationCodeBoilerPlate: any = (node: any) => {
10521052
\n if (!tx) {
10531053
throw new Error( 'Tx failed - the commitment was not accepted on-chain, or the contract is not deployed.');
10541054
} \n`;
1055-
if (!node.newCommitmentsRequired){
1055+
if (!node.newCommitmentsRequired) {
10561056
checkLeaves = '';
10571057
}
10581058
return {

src/traverse/Indicator.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,11 @@ export class FunctionDefinitionIndicator extends ContractDefinitionIndicator {
142142
let burnedOnly = true;
143143
for (const [, stateVarIndicator] of Object.entries(this)) {
144144
if (!(stateVarIndicator instanceof StateVariableIndicator)) continue; // eslint-disable-line no-continue, no-use-before-define
145-
// if we have a indicator which is NOT burned, then we do need new commitments
145+
// if we have a indicator which is NOT burned and requires new commitments, then we do need new commitments
146146
if (
147147
stateVarIndicator.isSecret &&
148-
(!stateVarIndicator.isBurned || stateVarIndicator.newCommitmentsRequired)
148+
!stateVarIndicator.isBurned &&
149+
stateVarIndicator.newCommitmentsRequired
149150
) {
150151
burnedOnly = false;
151152
break;

0 commit comments

Comments
 (0)