Simulated transaction to determine gas cost and any refunded ether? (POC 7)

Anyone know if it's possible (or will be possible) to use the new web3.eth.call() method documented in POC 7 to find out how much gas a transaction requires and whether or not the contract called will send back enough ether to cover the gas? Haven't had much luck getting call() to do anything yet (on the development branch).
I also had some trouble getting call() to work on POC 6 but figured my client version (commit e03a663d) was not up to speed with the documentation

Comments

  • JasperJasper Eindhoven, the NetherlandsMember Posts: 514 ✭✭✭
    In principle another transaction could come before yours affecting the computation, possibly increasing gas use. You'd end up with the transaction not doing anything. Even if the simulated call is correct, if the contract does something weird using too much gas, using a simulated call will just give it that gas, instead of warning you. I think it is better to have a separate guess.

    If a separate guess is provided, in transact, in principle the the client itself could simulate, and in-principle provide such warning.(or possibly just prevent the transaction from creation) This would avoid lots of developers making their own warning system.
Sign In or Register to comment.