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

fix: increase estimated gas by 20% #15

Merged
merged 3 commits into from
Apr 11, 2024
Merged

Conversation

Maikol
Copy link
Member

@Maikol Maikol commented Apr 11, 2024

No description provided.

@Maikol Maikol requested review from tmigone and pcarranzav April 11, 2024 14:34
Copy link
Member

@pcarranzav pcarranzav left a comment

Choose a reason for hiding this comment

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

One suggestion but LGTM

// Increase the estimated gas by 20%
let increased_estimate = estimated_gas * U256::from(120) / U256::from(100);

tx.gas(increased_estimate).send().await?.await?;
Copy link
Member

@pcarranzav pcarranzav Apr 11, 2024

Choose a reason for hiding this comment

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

I'd suggest handling errors from this more explicitly, unless it's done somewhere else?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's handled above when we do let estimated_gas_tx = tx.estimate_gas().await; since we're simulating the tx. If there's another error it will be propagated and handled in the main loop.

@Maikol Maikol merged commit 569a743 into main Apr 11, 2024
4 checks passed
@Maikol Maikol deleted the mde/increase-estimated-gas branch April 11, 2024 15:44
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.

2 participants