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

Pass details on GasTooHigh #5489

Merged
merged 3 commits into from
Aug 1, 2023
Merged

Conversation

aathan
Copy link
Contributor

@aathan aathan commented Jul 27, 2023

Motivation

GasTooHigh errors were too opaque and I could not tell what was generating the GasTooHigh error.

Solution

Made the GasTooHigh variant a struct with a string that could carry details.

@Evalir Evalir self-requested a review July 27, 2023 23:26
Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

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

looks good bar some nits. wdyt @mattsse ?

#[error("intrinsic gas too high")]
GasTooHigh,
#[error("intrinsic gas too high -- {}",.0.detail)]
GasTooHigh(ErrDetail),
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, i think we could have just a String here—if we wanna name it a bit more fancily we can just make a type like type GasErrorDetail = String;.

@mattsse mattsse merged commit 8d342d3 into foundry-rs:master Aug 1, 2023
aathan added a commit to aathan/foundry that referenced this pull request Aug 2, 2023
* Pass details on GasTooHigh

* Update anvil/src/eth/backend/mem/mod.rs

* chore: fmt/clippy

---------

Co-authored-by: AA <aa@aa>
Co-authored-by: evalir <hi@enriqueortiz.dev>
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