Skip to main content
added 59 characters in body
Source Link
goodvibration
  • 26.2k
  • 5
  • 49
  • 89

With getterFunctionsNameObject[key][j].input, you are passing a single array as input parameter.

Use ...getterFunctionsNameObject[key][j].input instead.

BTW, I believe that you can use this also for functions which take no input parameters.

In other words, the if (funcParmLength == 0) / else part is redundant.

Just do res = await myContractInstance.methods[myFunc](...getterFunctionsNameObject[key][j].input).call({from: account1, value: web3.utils.toWei('0', 'ether')}).

BTW2, you don't need to specify value when it's zero.

With getterFunctionsNameObject[key][j].input, you are passing a single array as input parameter.

Use ...getterFunctionsNameObject[key][j].input instead.

BTW, I believe that you can use this also for functions which take no input parameters.

In other words, the if (funcParmLength == 0) / else part is redundant.

Just do res = await myContractInstance.methods[myFunc](...getterFunctionsNameObject[key][j].input).call({from: account1, value: web3.utils.toWei('0', 'ether')}).

With getterFunctionsNameObject[key][j].input, you are passing a single array as input parameter.

Use ...getterFunctionsNameObject[key][j].input instead.

BTW, I believe that you can use this also for functions which take no input parameters.

In other words, the if (funcParmLength == 0) / else part is redundant.

Just do res = await myContractInstance.methods[myFunc](...getterFunctionsNameObject[key][j].input).call({from: account1, value: web3.utils.toWei('0', 'ether')}).

BTW2, you don't need to specify value when it's zero.

Source Link
goodvibration
  • 26.2k
  • 5
  • 49
  • 89

With getterFunctionsNameObject[key][j].input, you are passing a single array as input parameter.

Use ...getterFunctionsNameObject[key][j].input instead.

BTW, I believe that you can use this also for functions which take no input parameters.

In other words, the if (funcParmLength == 0) / else part is redundant.

Just do res = await myContractInstance.methods[myFunc](...getterFunctionsNameObject[key][j].input).call({from: account1, value: web3.utils.toWei('0', 'ether')}).