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

Test cleanup #422

Merged
merged 4 commits into from
Aug 16, 2023
Merged

Test cleanup #422

merged 4 commits into from
Aug 16, 2023

Conversation

Autoparallel
Copy link
Collaborator

Overview of tasks

  • Added more test coverage focused on bindings.
  • Fixed a bug that arose in propagating RevmMiddlewareError.
  • Edited the Revert and Halt error variants.

Copy link
Collaborator

@0xJepsen 0xJepsen 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 to me!

@@ -129,7 +129,7 @@ pub struct Environment {

/// The [`EVM`] that is used as an execution environment and database for
/// calls and transactions.
pub(crate) evm: EVM<CacheDB<EmptyDB>>,
evm: EVM<CacheDB<EmptyDB>>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remind me why we are doing this again.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because we don't actually reference the evm field of Environment anywhere else in the crate, so we are safe to keep its visibility to private. I feel it's usually good to minimize visibility to the lowest point.

@@ -167,7 +173,7 @@ impl MiddlewareError for RevmMiddlewareError {
}

fn as_inner(&self) -> Option<&Self::Inner> {
Some(self)
None
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you explain this to me? The middleware onion has been a little black boxed for to only handle it on one layer at a time.

@@ -308,7 +313,13 @@ impl Middleware for RevmMiddleware {
_gas_refunded: _,
logs,
output,
} = unpack_execution_result(revm_result.result)?;
} = match unpack_execution_result(revm_result.result) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice i was wondering about this when i was debugging my issue

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh shit. I don't actually want to do it this way. Doing it with ? is better.

@0xJepsen 0xJepsen merged commit 1416670 into feat/middleware Aug 16, 2023
2 of 4 checks passed
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