-
-
Notifications
You must be signed in to change notification settings - Fork 268
chore(test): Refactor FakeBlockTracker provider injection #4345
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
chore(test): Refactor FakeBlockTracker provider injection #4345
Conversation
| constructor() { | ||
| constructor({provider}: {provider: SafeEventEmitterProvider}) { | ||
| super({ | ||
| provider: new SafeEventEmitterProvider({ engine: new JsonRpcEngine() }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the SafeEventEmitterProvider gets replaced and tests making use of the FakeBlockTracker now have to supply a provider explicitly.
41718b0 to
eeb3f4e
Compare
dbrans
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@legobeat Thank you, this is fantastic work.
Thanks! Just had to resolve a conflict in |
360299a to
0a8fbbf
Compare
Explanation
transaction-controllerconstructor takes aproviderand ablockTracker. In tests, there is mocking of these. ABlockTrackerhas its ownproviderand while in reality theblockTracker.provider == provider, it appears inconsistent in tests where a test may use both a mocked and a "real" provider instance at the same time.This aims at making this more transparent by making the
providerparameter ofFakeBlockTrackermandatory.References
Checklist