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

Adding gas estimate function #24

Merged
merged 1 commit into from
Apr 10, 2020
Merged

Adding gas estimate function #24

merged 1 commit into from
Apr 10, 2020

Conversation

dimpar
Copy link
Contributor

@dimpar dimpar commented Apr 7, 2020

Refs keep-network/keep-core#1479

In this PR we add the gas estimation functionality. This will be used by Keep applications to retrieve the estimation for a specific transaction.

- Added *GasEstimate template.
- Added EstimateGas() in ethutil.go
Copy link
Contributor

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Any objections to merging as-is? Looks like keep-network/keep-core#1550 gave this a good exercising, so we should be good here.

msg := ethereum.CallMsg{
From: from,
To: &to,
Data: input,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not passing Value to CallMsg so the estimation may not be correct for payable functions. I think we need to generate a variation of estimate function just for payable functions.

It's not a top priority because the problem we are having in keep-network/keep-core#1479 is solved with the code here. I'll open a separate issue to address payable functions.

Copy link
Member

@pdyraga pdyraga Apr 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Captured this issue in #26

@pdyraga pdyraga merged commit 86a57ad into master Apr 10, 2020
@pdyraga pdyraga deleted the gas-estimate-function branch April 10, 2020 12:12
@pdyraga pdyraga added this to the v0.2.0 milestone Apr 13, 2020
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

Successfully merging this pull request may close these issues.

3 participants