DimensionDev / DimensionDev/SmartContractProjectConfig

Get stuck while running test after import hardhat-gas-reporter

Open
#9 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue question
Dominant language
TypeScript
Stars
2
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Version Info:

  • hardhat: 2.8.3
  • hardhat-gas-reporter: 1.0.7
  • OS:macOS Big Sur 11.6

Problem:
I get stuck when I run test after hardhat-gas-reporter was imported in hardhat.config.ts. The log of npm run test is listed below:

npm verb cli[⠂⠂⠂⠂⠂⸩ ⠧ : timing npm:load Completed in 27ms
npm verb cli   './.nvm/versions/node/v16.10.0/bin/node',
    npm verb cli   './.nvm/versions/node/v16.10.0/lib/node_modules/npm/bin/npm-cli.js',
        npm verb cli   'exec',
            npm verb cli   '--',
                npm verb cli   'hardhat',
                    npm verb cli   'test'
npm verb cli ]
npm info using npm @7.24.0
npm info using node @v16.10.0
npm timing npm: load:whichnode Completed in 1ms
npm timing config: load:defaults Completed in 1ms
npm timing config: load: file: /.nvm / versions / node / v16.10.0 / lib / node_modules / npm / npmrc Completed in 0ms
npm timing config: load:builtin Completed in 0ms
npm timing config: load:cli Completed in 2ms
npm timing config: load:env Completed in 0ms
npm timing config: load: file: [ProjectDir]/.npmrc Completed in 0ms
npm timing config: load:project Completed in 1ms
npm timing config: load: file: /.npmrc Completed in 0ms
npm timing config: load:user Completed in 0ms
npm timing config: load: file: /.nvm / versions / node / v16.10.0 / etc / npmrc Completed in 0ms
npm timing config: load: global Completed in 0ms
npm timing config: load:validate Completed in 1ms
npm timing config: load:credentials Completed in 1ms
npm timing config: load:setEnvs Completed in 0ms
npm timing config:load Completed in 6ms
npm timing npm: load:configload Completed in 6ms
npm timing npm: load:setTitle Completed in 15ms
npm timing npm: load:setupLog Completed in 0ms
npm timing config: load:flatten Completed in 3ms
npm timing npm: load:cleanupLog Completed in 1ms
npm timing npm: load:configScope Completed in 0ms
npm timing npm: load:projectScope Completed in 1ms
npm timing npm:load Completed in 31ms
Warning: loading secrets from tempalte file, might be invalid
⸨⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⸩ ⠧ : timing npm:load Completed in 27ms

Solution:
Try to modify the config of hardhat-gas-reporter with the following configuration:

gasReporter = {
    currency: 'USD',
    gasPrice: 21,
    enabled: (process.env.REPORT_GAS) ? true : false
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in hardhat.config.ts and compare the hardhat-gas-reporter settings with the configuration shown in the issue. Run npm run test with the reporter imported, then verify that the command no longer gets stuck when REPORT_GAS is unset; the change is done when tests complete normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing-qa, tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.