Skip to content

Pass details on GasTooHigh#5489

Merged
mattsse merged 3 commits intofoundry-rs:masterfrom
aathan:gas_too_high_err_detail
Aug 1, 2023
Merged

Pass details on GasTooHigh#5489
mattsse merged 3 commits intofoundry-rs:masterfrom
aathan:gas_too_high_err_detail

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