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 unit tests #137

Merged
merged 5 commits into from
Feb 9, 2024
Merged

Fix unit tests #137

merged 5 commits into from
Feb 9, 2024

Conversation

DanielSchiavini
Copy link
Collaborator

What I did

Fixed the tests. Removed error swallowing.

How I did it

By restoring the AccountDB class when resetting the env.

How to verify it

Unit tests should be green.

Description for the changelog

n/a

Cute Animal Picture

image

@@ -474,6 +473,9 @@ def fork_rpc(self, rpc=None, reset_traces=True, block_identifier="safe", **kwarg
def _fork_mode(self):
return self.vm.__class__._state_class.account_db_class == AccountDBFork

def _set_account_db_class(self, account_db_class: type):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

just moved it close to _fork_mode

self.vm.patch = VMPatcher(self.vm)

# revert any previous AccountDBFork patching
self._set_account_db_class(AccountDB)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this change got lost and broke anvil, so the error did not need to be swallowed

@DanielSchiavini DanielSchiavini merged commit d96566b into master Feb 9, 2024
9 of 10 checks passed
DanielSchiavini added a commit that referenced this pull request Feb 9, 2024
@DanielSchiavini DanielSchiavini deleted the prefetch branch February 9, 2024 11:01
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