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

Extract/fix FakeProvider for use among packages #2039

Merged
merged 3 commits into from
Nov 15, 2023
Merged

Conversation

mcmire
Copy link
Contributor

@mcmire mcmire commented Nov 15, 2023

Explanation

The FakeProvider class is useful in tests because it allows you to pass a provider that doesn't make HTTP requests to a library such as eth-query.

Previously, this class was only available in NetworkController tests. We want to now start using it in other tests, specifically along with eth-query. However, one problem I noticed is that it doesn't conform to SafeEventEmitterProvider completely. So this commit not only moves it to a more global location but also corrects its API so that it can be passed to eth-query.

References

See discussion here: #2037 (comment)

Changelog

(No consumer-facing changes.)

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

The FakeProvider class is useful in tests because it allows you to pass
a provider that doesn't make HTTP requests to a library such as
`eth-query`.

Previously, this class was only available in NetworkController tests.
With this commit, you can use it anywhere.
@mcmire mcmire requested a review from a team as a code owner November 15, 2023 00:21
MajorLift
MajorLift previously approved these changes Nov 15, 2023
Copy link
Contributor

@MajorLift MajorLift left a comment

Choose a reason for hiding this comment

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

LGTM!

@mcmire mcmire changed the title Extract FakeProvider for global use among packages Extract/fix FakeProvider for use among packages Nov 15, 2023
@mcmire mcmire merged commit 07224cf into main Nov 15, 2023
128 checks passed
@mcmire mcmire deleted the extract-fake-provider branch November 15, 2023 16:14
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