matter-labs / hardhat-zksync

Apache License 2.0
281 stars 227 forks source link

Solidity Coverage: #899

Open alaukiknpant opened 6 months ago

alaukiknpant commented 6 months ago

🌟 Feature Request for hardaht-zksync plugins

💥 Plugin name

Solidity Coverage

📝 Description

It would be helpful to have native support for solidity coverage.

🤔 Rationale

Coverage information would help developers build zksync contracts that are well tested.

📋 Additional Context

It seems the current version of zksync hardhat requires us to deploy the libraries that coverage plugin expects.

Compilation:
============

Compiling contracts for zkSync Era with zksolc v1.4.0 and solc v0.8.20
Compiling contracts for zkSync Era with zksolc v1.4.0 and solc v0.8.20
Compiling X Solidity files
Generating typings for: 37 artifacts in dir: typechain-types for target: ethers-v5
Successfully generated 96 typings!
zksolc compiler detected missing libraries! For more details, visit: https://era.zksync.io/docs/tools/hardhat/compiling-libraries.html.
To compile and deploy libraries, please run: `yarn hardhat deploy-zksync:libraries --private-key <PRIVATE_KEY>`
For more details on how to use deploy-zksync:libraries task from hardhat-zksync-deploy plugin, visit: https://era.zksync.io/docs/tools/hardhat/hardhat-zksync-deploy.html.

Network Info
============
> HardhatEVM: v2.19.5
> network:    hardhat

Compiling contracts for zkSync Era with zksolc v1.4.0 and solc v0.8.20
Compiling contracts for zkSync Era with zksolc v1.4.0 and solc v0.8.20
Compiling 48 Solidity files
zksolc compiler detected missing libraries! For more details, visit: https://era.zksync.io/docs/tools/hardhat/compiling-libraries.html.
To compile and deploy libraries, please run: `yarn hardhat deploy-zksync:libraries --private-key <PRIVATE_KEY>`
For more details on how to use deploy-zksync:libraries task from hardhat-zksync-deploy plugin, visit: https://era.zksync.io/docs/tools/hardhat/hardhat-zksync-deploy.html.

.
.
.

> Istanbul reports written to ./coverage/ and ./coverage.json
Error in plugin solidity-coverage: ❌ 6 test(s) failed under coverage.

For more info run Hardhat with --show-stack-traces
error Command failed with exit code 1.
nikola-bozin-txfusion commented 6 months ago

Hello @alaukiknpant! We are looking into it and hopefully it will be supported in the near future!