npx hardhat coverage fails - stack too deep

Đang mở
#190 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, solidity
Lĩnh vực
testing-qa

Hướng nghiên cứu

Reproduce the failure with npm install followed by npx hardhat coverage --show-stack-traces, then inspect .solcover.js and the coverage configuration around the reported stack-too-deep error. Compare the existing viaIR, exclusion, and @skip-on-coverage attempts. Done means coverage completes successfully for the intended Solidity files.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

npx hardhat coverage --show-stack-traces

Version
=======
> solidity-coverage: v0.8.12

Instrumenting for coverage...
=============================

> APIConsumer.sol
> AutomationCounter.sol
> PriceConsumerV3.sol
> RandomNumberConsumerV2Plus.sol
> RandomNumberDirectFundingConsumerV2Plus.sol
> test/VRFCoordinatorV2_5Mock.sol
> VRFV2PlusWrapper.sol

Coverage skipped for:
=====================

> test/fuzzing/AutomationCounterEchidnaTest.sol
> test/MockLinkToken.sol
> test/MockOracle.sol
> test/MockV3Aggregator.sol

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

CompilerError: Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables. When compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack. Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables.

after checking out, npm install, npx hardhat compile, npx hardhat test, I am trying to get the code coverage.
It fails with stack too deep. In order to solve the above issue, I tinkered around with

  • enabling the via-ir flag
  • excluding more/all of the .sol files in .solcover.js
  • adding a @skip-on-coverage to the test definitions ( it("testname [ @skip-on-coverage ]", async () => {}))

but with none of those i was able to get code coverage running

Any hint is appreciated to help me understand how to get code coverage for the code to run.

Ngôn ngữ chính
JavaScript
Star
1.3k
Fork
510
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của smartcontractkit/hardhat-starter-kit

Tất cả issue của smartcontractkit/hardhat-starter-kit

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.