From ad53bd51cae2941c9d522f200c3abf61f73e5cb3 Mon Sep 17 00:00:00 2001 From: Swati Rawal Date: Thu, 29 Aug 2024 10:43:47 +0100 Subject: [PATCH] chore: removed console logs --- .../contract/solidity/toContract.ts | 1 - .../orchestrationInternalFunctionCallVisitor.ts | 16 ++++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/codeGenerators/contract/solidity/toContract.ts b/src/codeGenerators/contract/solidity/toContract.ts index 42cce866..472ddb08 100644 --- a/src/codeGenerators/contract/solidity/toContract.ts +++ b/src/codeGenerators/contract/solidity/toContract.ts @@ -140,7 +140,6 @@ function codeGenerator(node: any) { } case 'VariableDeclarationStatement': { - console.log(node); const declarations: string = node.declarations.map(codeGenerator).join(', '); if (declarations === '') return declarations; // when all are secret, we ignore them let initialValue; diff --git a/src/transformers/visitors/orchestrationInternalFunctionCallVisitor.ts b/src/transformers/visitors/orchestrationInternalFunctionCallVisitor.ts index c7cf9288..2b2a6118 100644 --- a/src/transformers/visitors/orchestrationInternalFunctionCallVisitor.ts +++ b/src/transformers/visitors/orchestrationInternalFunctionCallVisitor.ts @@ -432,7 +432,8 @@ const internalCallVisitor = { }); }); node.privateStates = Object.assign(node.privateStates,generateProofNode.privateStates); - node.parameters = [...new Set([...node.parameters ,...generateProofNode.parameters, ...state.returnPara])]; + node.parameters = [...new Set([...node.parameters ,...generateProofNode.parameters])]; + state.returnPara ? node.parameters = [...new Set([...node.parameters, ...state.returnPara])]: node.parameters; break; } case 'SendTransaction': { @@ -532,17 +533,8 @@ FunctionCall: { name: returnPara, internalFunctionInteractsWithSecret: internalFunctionInteractsWithSecret, }); - console.log(parent) - parent.interactsWithSecret ? state.returnPara = returnPara : ' '; - - const functionParams = callingfnDefPath.node._newASTPointer.body.preStatements; - // console.log(functionParams); - // console.log(functionReferncedNode.node.returnParameters.parameters[0]._newASTPointer); - // if(!functionParams.includes(returnPara)){ - // callingfnDefPath.node._newASTPointer.parameters.parameters.push(functionReferncedNode.node.returnParameters.parameters[0]._newASTPointer); - // callingfnDefPath.node._newASTPointer.parameters.parameters[functionParams.length].declarationType = 'parameter'; - // callingfnDefPath.node._newASTPointer.parameters.parameters[functionParams.length].interactsWithSecret = true; - // } + + parent._newASTPointer.interactsWithSecret ? state.returnPara = returnPara : ' '; } else { newNode = buildNode('InternalFunctionCall', { name: node.expression.name,