-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
replace web3-provider-engine #996
Conversation
2a223d9
to
9e31c95
Compare
9e31c95
to
9757469
Compare
setTimeout(() => { | ||
provider?.stop(); | ||
provider?.removeAllListeners(); |
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.
provider.stop doesn't exist anymore - open to suggestions over what we should do here.
@@ -226,6 +226,14 @@ export class TokenDetectionController extends BaseController< | |||
!isDetectionEnabledForNetwork || | |||
!isDetectionEnabledFromPreferences | |||
) { | |||
console.log('early returned'); |
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.
Are all these logs needed?
if (this.config.provider === undefined) { | ||
return undefined; | ||
} | ||
return new Web3Provider(this.config?.provider); |
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.
I know that it shouldn't be any other falsey value than undefined
here but can we still control for it, either by handling it as undefined
(this makes sense to me) or throw an error?
Also config
not being an object is handled below so should be here too - and better so since new Web3Provider
doesn't play with undefined provider anyway.
if (this.config.provider === undefined) { | |
return undefined; | |
} | |
return new Web3Provider(this.config?.provider); | |
if (!this.config?.provider) { | |
return undefined; | |
} | |
return new Web3Provider(this.config.provider); |
const networkMiddleware = mergeMiddleware([ | ||
...scaffolded, | ||
createBlockRefRewriteMiddleware({ | ||
blockTracker: blockTracker as any, |
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.
Why is as any
used here? Types look like they should line up after https://github.com/MetaMask/controllers/pull/996/files#r1047869969?
@BelfordZ We should chat tomorrow about this. I am worried that there are slight differences in EDIT: Even so, I will for sure do a proper review of this. |
6f2b27e
to
586247f
Compare
Can this be closed in favor of #1116, or what's the relation of this PR to that one? |
@BelfordZ See above comment ^ |
superceded by #1116 |
Replace web3-provider-engine
Use the network clients from extension.
Description
networkControllers.provider is now typed better than
any
BREAKING:
FIXED:
CHANGED:
REMOVED:
ADDED:
networkController.provider
is seteDEPRECATED:
SECURITY:
Checklist
Issue
Resolves #???