Enable clone()
- Dominant language
- TypeScript
- Stars
- 268
- Forks
- 130
- PR merge metrics
- No merged PRs in 30d
Description
As identified in [Web3 Issue 3573](https://github.com/ethereum/web3.js/issues/3573), when using both TruffleContract and web3 functions it is important that they have separate Provider objects.
In the browser, the injected `web3` has a `web3.currentProvider` which is a MetamaskInpageProvider, but passing this same object to a TruffleContract's `setProvider` function seems likely to produce issues like that one identified in web3.
To address this, the MetamaskInpageProvider might benefit from a clone() function producing another copy of the object, so that there can be independent queues serving overlapping sequences of requests from calls to the web3 object directly + calls to TruffleContract objects.
Contributor guide
No contributing guide indexed for this repository
Research direction
Read Web3 Issue 3573 and inspect the MetamaskInpageProvider implementation and its request-queue behavior. Define clone() so it produces an independent provider with separate request queues, then verify that direct web3 calls and TruffleContract calls can overlap without sharing provider state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100