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

Modify functions that send transactions to accept an opts map with transaction sending parameters #81

Open
jpcenteno opened this issue Jun 7, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@jpcenteno
Copy link
Contributor

Problem:

I wanted to deploy a transaction using EthClient.deploy/2, but it got stuck in the mempool. After retrying it, I got the error:

** (MatchError) no match of right hand side value: {:error, %{"code" => -32000, "message" => "replacement transaction underpriced"}}
    (eth_client 0.1.0) lib/eth_client.ex:42: EthClient.deploy/1
    (eth_client 0.1.0) lib/eth_client.ex:61: EthClient.deploy/2

This can be manually fixed by incrementing the gas price, but EthClient.deploy does not offer this functionality.

Proposal:

Modify deploy and other functions alike to accept an opts dictionary:

def deploy(bin, abi, opts \\ []) do
  ...
end

So that we can set parameters like:

EthClient.deploy(bin, abi, gas_price: ...)
@jpcenteno jpcenteno added the enhancement New feature or request label Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant