Closed onbjerg closed 6 years ago
Related to ethereumjs/testrpc#246
just do provider.send = provider.sendAsync
. web3 1.0 only implements async requests. It just replaced the send
with sendAsync
and removed sendAsync
. You can monkey patch the provider as a work around to get it to work with 1.0
Ah really? That's interesting information, thanks @perissology 😊 This should still be reflected in a new version (obviously breaking) of ganache-core
when they migrate to Web3 1.0.0.
Can be fixed with a monkey patch where you bind send
to sendAsync
since these are the same in Web3 1.0.0.
In relation to #11, one way I thought I could avoid using WebSockets would be to use the provider from
ganache-core
directly in my tests.This did not work, since Web3 1.0.0 heavily relies on synchronous calls for things that are not subscriptions, but
ganache-core
does not support synchronous calls.Expected Behavior
Current Behavior
Steps to Reproduce (for bugs)
ganache-core
(ganache.provider()
).web3.eth.getAccounts()
Context
I am trying to use ganache or testrpc for my integration tests, but ganache does not support WebSockets or IPC (which is required for subscriptions since Web3 1.0.0), and ganache does not work by using the provider directly either, since synchronous calls will not work this way.
This sort of traps me in two ways. Either I...
ganache.provider()
but cannot use any methods that do not result in a subscription