npx hardhat coverage fails - stack too deep

Aperta
#190 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript, solidity
Ambito
testing-qa

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
JavaScript
Stelle
1.3k
Fork
510
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di smartcontractkit/hardhat-starter-kit

Tutte le issue di smartcontractkit/hardhat-starter-kit

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.