I am using web3.py and trying to get the return value of a smart contract method after calling it. Of course, I can do it like this:
value = smart_contract_instance.someFunction()
but this does not give me any information about how much gas was used. If I use the transact
method like this:
tx_hash = smart_contract_instance.transact({'to': w3.eth.accounts[0]}).someFunction()
I can access the receipt with w3.eth.getTransactionReceipt(tx_hash)
, but this does not give me the result. How can I access the result of the call without having to invoke the smart contract twice (as in using both code snippets from above)?