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 has been archived by the owner on Feb 26, 2024. It is now read-only.
When an eth_call is made, and the call fails, a valid JSON response should be received, with the default ('empty') values for the return types in the result field. with a result field of 0x.
Current Behavior
Currently, the JSON response is of the form:
{"id":284,"jsonrpc":"2.0"}
This is missing the result field, as defined in the spec, and so web3 rejects it with Error: Invalid JSON RPC response.
Possible Solution
I think this is because result is undefined when the response is serialized, and gets removed entirely. I don't think returning undefined would be appropriate either though.
Steps to Reproduce (for bugs)
Deploy a contract with the below function, and run eth_call against it:
function someFunction() public view returns (bool){
require(false);
return true;
}
Your Environment
EthereumJS TestRPC v6.0.3 (ganache-core: 2.0.2) on OSX 10.13.2, Node v8.4.0
The text was updated successfully, but these errors were encountered:
area
changed the title
Incorrect response when eth_call fails
Incorrect RPC response when eth_call fails
Jan 25, 2018
area
changed the title
Incorrect RPC response when eth_call fails
Incorrect RPC response when eth_call fails
Jan 25, 2018
Expected Behavior
When an
eth_call
is made, and the call fails, a valid JSON response should be received,with the default ('empty') values for the return types in thewith aresult
field.result
field of0x
.Current Behavior
Currently, the JSON response is of the form:
{"id":284,"jsonrpc":"2.0"}
This is missing the
result
field, as defined in the spec, and soweb3
rejects it withError: Invalid JSON RPC response
.Possible Solution
I think this is because
result
isundefined
when the response is serialized, and gets removed entirely. I don't think returningundefined
would be appropriate either though.Steps to Reproduce (for bugs)
Deploy a contract with the below function, and run
eth_call
against it:Your Environment
EthereumJS TestRPC v6.0.3 (ganache-core: 2.0.2)
on OSX 10.13.2, Node v8.4.0The text was updated successfully, but these errors were encountered: