Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default block parameter for eth_estimate_gas (and some others) #54

Closed
kminevskiy opened this issue Dec 18, 2018 · 2 comments
Closed

Default block parameter for eth_estimate_gas (and some others) #54

kminevskiy opened this issue Dec 18, 2018 · 2 comments

Comments

@kminevskiy
Copy link
Contributor

Hi,

I was trying to use the eth_estimate_gas function, but it looks like it has not been tested and all calls to it were failing.

Here's the error:

{:error, %{"code" => -32602, "message" => "too many arguments, want at most 1"}}

So after looking at the Ethereum JSON RPC specs, I figured that default block parameters can be specified only for certain calls. However, when scrolling through the actual examples, some of them still specify the quantity/tag param.

But back to the issue at hand.

I removed the default block parameter from the spec, from the function signature and body params and it works as expected. Am I doing something wrong (with your initial implementation) or is it an actual bug and I should submit a PR?

Thanks!

@hswick
Copy link
Collaborator

hswick commented Dec 21, 2018

It looks like in the link you posted (https://github.com/mana-ethereum/ethereumex/blob/master/lib/ethereumex/client/base_client.ex#L168) the typespec is incorrect. Please submit a PR.

You can get around this by using the generic request function:

Ethereumex.HttpClient.request("eth_estimateGas", params, opts)

@ayrat555
Copy link
Member

#55 merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants