You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 3, 2022. It is now read-only.
eth_simulateTransaction should be introduced to replace eth_call and eth_estimateGas
eth_simulateTransaction can provide information including:
return value
gas consumption
if an error was thrown
This helps solve the problem of trying to differentiate between correct response and error response with eth_call and eth_estimateGas
spec
eth_simulateTransaction
Executes a new message call without creating a transaction on the block chain.
Parameters
Object - The transaction call object
from: DATA, 20 Bytes - (optional) The address the transaction is sent from.
to: DATA, 20 Bytes - The address the transaction is directed to.
gas: QUANTITY - (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.
gasPrice: QUANTITY - (optional) Integer of the gasPrice used for each paid gas
value: QUANTITY - (optional) Integer of the value send with this transaction
data: DATA - (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI
QUANTITY|TAG - integer block number, or the string "latest", "earliest" or "pending", see the default block parameter
Returns
Object - A transaction summary object
returnValue: DATA, 32 Bytes - hash of the transaction.
gasUsed : QUANTITY - The amount of gas used by this specific transaction alone.
contractAddress : DATA, 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null.
logs: Array - Array of log objects, which this transaction generated.
errorCode: null or string - (needs spec) Whether or not an error such as a top-level OOG, invalid jump, or other vm-halting error occurred. Code should indicate the status in this way:
(successful)
out of gas
stack overflow
stack underflow
invalid jump (no JUMPDEST present)
invalid instruction
possibly the INVALID instruction could have its own code
summary
eth_simulateTransactionshould be introduced to replaceeth_callandeth_estimateGaseth_simulateTransactioncan provide information including:This helps solve the problem of trying to differentiate between correct response and error response with
eth_callandeth_estimateGasspec
eth_simulateTransaction
Executes a new message call without creating a transaction on the block chain.
Parameters
Object- The transaction call objectfrom:DATA, 20 Bytes - (optional) The address the transaction is sent from.to:DATA, 20 Bytes - The address the transaction is directed to.gas:QUANTITY- (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.gasPrice:QUANTITY- (optional) Integer of the gasPrice used for each paid gasvalue:QUANTITY- (optional) Integer of the value send with this transactiondata:DATA- (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABIQUANTITY|TAG- integer block number, or the string"latest","earliest"or"pending", see the default block parameterReturns
Object- A transaction summary objectreturnValue:DATA, 32 Bytes - hash of the transaction.gasUsed:QUANTITY- The amount of gas used by this specific transaction alone.contractAddress:DATA, 20 Bytes - The contract address created, if the transaction was a contract creation, otherwisenull.logs:Array- Array of log objects, which this transaction generated.errorCode:nullorstring- (needs spec) Whether or not an error such as a top-level OOG, invalid jump, or other vm-halting error occurred. Code should indicate the status in this way:Example