Support testing with an in-process ethereum provider
See original GitHub issueš§ Motivation
solidity-coverage is being rewritten so that it has fewer quirks and problems. One element of the new design is that it listens to the ethereumjs-vm opcode step emitter of an in-process ganache instance. In Truffle terms, it runs on a network which looks like:
const ganache = require("ganache-cli")
modules.exports = {
networks: {
ganache: {
provider: ganache.provider(options),
network_id: "*"
}
}
}
Have been testing it on Zeppelin and the only issue is that some GSN tests rely on an oz-gsn utility run in test.sh which connects to ganache-cli as a stand-alone server.
Iām wondering if anyone has any views are about moving away from test.sh
towards an in-process provider approach.
I think the main changes this would involve are:
- Putting the accounts keys and balances into their own file so they can be JS required.
- Writing an oz-gsn deploy relay hub test helper that uses an in-process provider
- Launching the tests with ganache.provider by default.
Pros
- Less shell script
- There are interesting tools written to consume the client this way
- NomicLabs is actively working on someā¦
- 0xProject tooling
Cons/Caveats
- It runs a little more slowly. (ganache-core 481 requests info about this)
- Maintaining compatibility with a solution for #355?
Happy to help with PRs etc if this is something youāre interested in.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Hardhat: networks and providers - HackMD
Using a testnet for local development is slow, and you need to get test ether from a faucet. An easier and faster alternative...
Read more >Alternatives for Truffle for running and writing tests
Below is my original Truffle + TypeScript test translated to OpenZeppelin + Jest + ... Hardhat supports localhost and in-process blockchain.
Read more >Hardhat Network | Ethereum development environment for ...
When Hardhat executes your tests, scripts or tasks, an in-process Hardhat Network node is started automatically, and all of Hardhat'sĀ ...
Read more >Top 4 Ethereum testnets for testing smart contracts
Let's compare four of the top Ethereum testnets ā Rinkeby, Kovan, Ropsten, and Goerli ā and review the key features of each testnet....
Read more >Truffle vs. Hardhat - Breaking down the difference between ...
Truffle, on the other hand, also supports writing tests in TypeScript. ... you can test, debug, and deploy your contracts directly to the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok well youāve persuaded me this is likely necessary anyway. If youād like to collaborate in some way Iād be very happy to.
It seems to me though that it should be possible to have a sort of ācoverage-nodeā, a stand-alone process that wraps ganache and exposes the
instrument
andreport
functions to the network. I imagine all the truffle plugin does is hook those functions to mochaāsbefore
andafter
blocks, which could be replicated this way.