Open rekmarks opened 4 years ago
We will have to use ethers.providers.JsonRpcBatchProvider
It is not well documented, but as far as I can tell from the discussion here https://github.com/ethers-io/ethers.js/issues/62#issuecomment-872900726, the provider can be instantiated the way the ethers provider is within the current test dapp code.
Then you can create multiple transactions as is done in the example here: https://ethereum.stackexchange.com/a/77169
But instead of awaiting each of them, create them all and then await a Promise.all
@danjm During the refinement we made a conclusion that the best approach to achieve this is to create a new button on the test-dapp which will call wrapped function that will perform few transactions in a batch which will target our deployed smart contract.
AC:
Couple of arguments for the proposal is:
This proposal sounds good to me. Are there any other blockers to this?
Blocked by PR: https://github.com/MetaMask/test-dapp/issues/137
Because of limitation of ethers library we've decided to integrate web3 library into the test-dapp. Web3 library with its functionality will make batch transactions possible. This can be continued when https://github.com/MetaMask/test-dapp/pull/146 gets merged.
We should add batch transaction functionality to the test dapp, for testing.
We should follow this: https://codesandbox.io/s/metamask-batchrequest-bug-demo-emnph
Zipped: metamask-batchrequest-bug-demo.zip
Contract on Rinkeby: https://rinkeby.etherscan.io/address/0xfac5d594548b1ab5fb724d8011187ec51919b92e#code
Context: https://github.com/MetaMask/metamask-extension/issues/5852#issuecomment-546554364