-
-
Notifications
You must be signed in to change notification settings - Fork 26
Dynamic provider private props #75
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
Dynamic provider private props #75
Conversation
bc4ecce to
3de3044
Compare
If anyone would ever update the provider, they must also update the blockTracker
3de3044 to
734129a
Compare
Mrtenz
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.
This is technically a breaking change, right? Looks good to me though.
| * @param opts.provider - An ethereum provider | ||
| * @param opts.blockTracker - An instance of @metamask/eth-block-tracker | ||
| */ | ||
| setProvider({ |
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 am very easily convinced to remove the setProvider function alltogether, if there is no current use for it. Put it in to make sure there are no compatibility concerns by default.
|
@Mrtenz Indeed, and intended to be released as such. |
| const blockNumber = await this.blockTracker.getLatestBlock(); | ||
| const baseCount: number = await this.web3.getTransactionCount( | ||
| address, | ||
| blockNumber, | ||
| ); | ||
| const blockNumber = await this.#blockTracker.getLatestBlock(); | ||
| const baseCount: number = await new Web3Provider( | ||
| this.#provider, | ||
| ).getTransactionCount(address, blockNumber); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
web3propertyreadonlysetProviderfunction which allows atomically setting the provider and block tracker on an existing instance.Should remove the need for this patch in MM extension.
Blocking