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

feat: added gas estimation for EVM transactions #71

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frolvanya
Copy link
Contributor

No description provided.

@frolvanya frolvanya requested review from karim-en and kiseln January 14, 2025 18:40
client
.estimate_gas(&call.tx, None)
.await
.map_err(|err| BridgeSdkError::EvmGasEstimateError(err.to_string()))?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this be EthRpcError?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to be able to differentiate in the future between rpc error (e.g rever or network issue) and gas estimation

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't gas estimation also a network call?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@frolvanya How do you differ between network error and estimated gas error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good question. Probably I could look inside ProviderError and if it's HTTPError(_) I can return BridgeSdkError::NetworkError
image

On the second thought. Do we really care if it's gas estimation or network issue? I mean both of these errors could indicate that we need to retry

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