ethereum-optimism / optimism

Optimism is Ethereum, scaled.
https://optimism.io
MIT License
5.65k stars 3.29k forks source link

Smock hardhat plugin no longer works with hardhat@2.4.0 #1118

Closed JasoonS closed 3 years ago

JasoonS commented 3 years ago

Describe the bug Smock hardhat plugin no longer works with hardhat@2.4.0. It works correctly on 2.3.3 and other previous versions.

To Reproduce Steps to reproduce the behavior:

  1. Go to tests that use hardhat/waffle and smock.
  2. Upgrade to the latest version of hardhat (https://github.com/nomiclabs/hardhat/releases/tag/hardhat-core-v2.4.0)
  3. Run the tests

Expected behavior Tests should still run.

System Specs:

Additional context See error and stacktrace below:

An unexpected error occurred:

Error: Cannot find module 'hardhat/internal/hardhat-network/stack-traces/revert-reasons'
Require stack:
- /home/jasoons/Documents/code/monorepo/contracts/node_modules/@eth-optimism/smock/dist/src/smockit/binding.js
- /home/jasoons/Documents/code/monorepo/contracts/node_modules/@eth-optimism/smock/dist/src/smockit/smockit.js
- /home/jasoons/Documents/code/monorepo/contracts/node_modules/@eth-optimism/smock/dist/src/smockit/index.js
- /home/jasoons/Documents/code/monorepo/contracts/node_modules/@eth-optimism/smock/dist/src/index.js
- /home/jasoons/Documents/code/monorepo/contracts/test-waffle/library/smock/LongShortSmocked.js
- /home/jasoons/Documents/code/monorepo/contracts/node_modules/mocha/lib/mocha.js
- /home/jasoons/Documents/code/monorepo/contracts/node_modules/mocha/index.js
- /home/jasoons/Documents/code/monorepo/contracts/node_modules/hardhat/builtin-tasks/test.js
- /home/jasoons/Documents/code/monorepo/contracts/node_modules/hardhat/internal/core/tasks/builtin-tasks.js
- /home/jasoons/Documents/code/monorepo/contracts/node_modules/hardhat/internal/core/config/config-loading.js
- /home/jasoons/Documents/code/monorepo/contracts/node_modules/hardhat/internal/cli/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/jasoons/Documents/code/monorepo/contracts/node_modules/@eth-optimism/smock/src/smockit/binding.ts:3:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/jasoons/Documents/code/monorepo/contracts/node_modules/@eth-optimism/smock/dist/src/smockit/binding.js',
    '/home/jasoons/Documents/code/monorepo/contracts/node_modules/@eth-optimism/smock/dist/src/smockit/smockit.js',
    '/home/jasoons/Documents/code/monorepo/contracts/node_modules/@eth-optimism/smock/dist/src/smockit/index.js',
    '/home/jasoons/Documents/code/monorepo/contracts/node_modules/@eth-optimism/smock/dist/src/index.js',
    '/home/jasoons/Documents/code/monorepo/contracts/test-waffle/library/smock/LongShortSmocked.js',
    '/home/jasoons/Documents/code/monorepo/contracts/node_modules/mocha/lib/mocha.js',
    '/home/jasoons/Documents/code/monorepo/contracts/node_modules/mocha/index.js',
    '/home/jasoons/Documents/code/monorepo/contracts/node_modules/hardhat/builtin-tasks/test.js',
    '/home/jasoons/Documents/code/monorepo/contracts/node_modules/hardhat/internal/core/tasks/builtin-tasks.js',
    '/home/jasoons/Documents/code/monorepo/contracts/node_modules/hardhat/internal/core/config/config-loading.js',
    '/home/jasoons/Documents/code/monorepo/contracts/node_modules/hardhat/internal/cli/cli.js'
  ]
}
error Command failed with exit code 1.
JasoonS commented 3 years ago

Ok, I see this PR already: https://github.com/ethereum-optimism/optimism/pull/1112

Thanks for working so fast :)

smartcontracts commented 3 years ago

Will have a release out soon!