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: refactor to BaseProvider #144

Merged
merged 5 commits into from
Apr 28, 2021
Merged

fix: refactor to BaseProvider #144

merged 5 commits into from
Apr 28, 2021

Conversation

shanejonas
Copy link
Contributor

No description provided.

@shanejonas shanejonas requested a review from a team as a code owner April 22, 2021 17:57
@rekmarks rekmarks self-assigned this Apr 22, 2021
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

Great addition with the tests!

I haven't reviewed them yet, because there's a fair amount in BaseProvider that should be moved to MetaMaskInpageProvider. BaseProvider should only include the non-deprecated events, properties, and methods defined in EIP-1193.

src/BaseProvider.ts Outdated Show resolved Hide resolved
src/BaseProvider.ts Outdated Show resolved Hide resolved
src/BaseProvider.ts Outdated Show resolved Hide resolved
src/BaseProvider.ts Outdated Show resolved Hide resolved
src/BaseProvider.ts Show resolved Hide resolved
src/BaseProvider.ts Outdated Show resolved Hide resolved
src/BaseProvider.ts Outdated Show resolved Hide resolved
src/BaseProvider.ts Outdated Show resolved Hide resolved
src/initializeProvider.ts Outdated Show resolved Hide resolved
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

Looking good! Just a few more things to iron out.

src/BaseProvider.ts Show resolved Hide resolved
src/BaseProvider.ts Outdated Show resolved Hide resolved
src/BaseProvider.ts Outdated Show resolved Hide resolved
src/MetaMaskInpageProvider.ts Outdated Show resolved Hide resolved
src/MetaMaskInpageProvider.ts Outdated Show resolved Hide resolved
src/MetaMaskInpageProvider.ts Outdated Show resolved Hide resolved
src/MetaMaskInpageProvider.ts Outdated Show resolved Hide resolved
@@ -0,0 +1,307 @@
const { BaseProvider } = require('../dist');
Copy link
Member

@rekmarks rekmarks Apr 28, 2021

Choose a reason for hiding this comment

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

For posterity, the reason these tests worked with the BaseProvider streams set up incorrectly (see comment and changes here) is because these tests mock JsonRpcEngine.handle, and so we're not testing the stream piping underlying that method at all.

Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

LGTM!

@shanejonas shanejonas merged commit 79fd094 into main Apr 28, 2021
@shanejonas shanejonas deleted the fix/refactor-base-provider branch April 28, 2021 20:51
@rekmarks rekmarks mentioned this pull request May 5, 2021
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