You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
* fix: sending tx with injected provider (#5651)
Co-authored-by: Marin Petrunic <[email protected]>
* adding a test for using `ganache` provider
* enable the jsonrpc `id` to optionally be incremented starting from a number
(Inspired by: #5373 (comment) and needed as a work around for blockchainsllc/in3#46)
* test with `in3` as a provider & skip `in3` test if it takes too long
* increase integration test timeout at web3 package
* add a test for using `hardhat` provider
* improve how legacy providers, such as hardhat, is used
* implement `isPromise` that works in the browsers
* refactor external providers tests
* update CHANGELOG.md
// a callback that is expected to be called after getting the response:
228
+
(err,response)=>{
229
+
if(err){
230
+
returnrejectWithError(err);
231
+
}
232
+
233
+
returnresolveWithResponse(response);
234
+
},
235
+
);
236
+
// Some providers, that follow a previous drafted version of EIP1193, has a `request` function
237
+
// that is not defined as `async`, but it returns a promise.
238
+
// Such providers would not be picked with if(isEIP1193Provider(provider)) above
239
+
// because the `request` function was not defined with `async` and so the function definition is not `AsyncFunction`.
240
+
// Like this provider: https://github.dev/NomicFoundation/hardhat/blob/62bea2600785595ba36f2105564076cf5cdf0fd8/packages/hardhat-core/src/internal/core/providers/backwards-compatibility.ts#L19
241
+
// So check if the returned result is a Promise, and resolve with it accordingly.
242
+
// Note: in this case we expect the callback provided above to never be called.
// TODO: once https://github.com/web3/web3.js/issues/5521 is implemented, remove checking for `enableExperimentalFeatures.useSubscriptionWhenCheckingBlockTimeout`
0 commit comments