The web3.js documentation states that with a contract method, call vs. transaction is chosen automatically:
Contract Methods
// Automatically uses call or sendTransaction based on the method type myContractInstance.myMethod(param1 [, param2, ...] [, ...]);
*edited for brevity
I have tested two ways to call a function that does not mutate anything
1.testInstance.testfunc(param1, {from:eth.accounts[0]}) 2.testInstance.testfunc.call(param1)
Events are being issued with option 1 only, so I know that web3.js is choosing sendTransaction(). I expected it to automatically choose a call(), because the function doesn't change any state.
How does web3.js determine which to use?
constant. – eth Sep 02 '17 at 05:39