Commit 9a7dd608 authored by smartcontracts's avatar smartcontracts Committed by GitHub

fix[contracts]: Separately generate OVM typechain artifacts (#597)

* fix[contracts]: Generate typechain artifacts for ovm separately

* fix[contracts]: Add ovm typechain artifacts to package json

* chore[contracts]: Add changeset

* fix[contracts]: Revert change to package.json

* feat(hh-ovm): generate typechain bindings in specific directory
Co-authored-by: default avatarGeorgios Konstantopoulos <me@gakonst.com>
parent 9ec3ec01
---
"@eth-optimism/hardhat-ovm": minor
---
export ovm typechain bindings to types-ovm via hardhat-ovm
......@@ -5,6 +5,7 @@
"files": [
"dist/**/*.js",
"dist/types/*.ts",
"dist/types-ovm/*.ts",
"artifacts/**/*.json",
"artifacts-ovm/**/*.json",
"OVM",
......@@ -24,6 +25,7 @@
"build:contracts:ovm": "hardhat compile --network optimism",
"build:dump": "ts-node \"bin/take-dump.ts\"",
"build:typechain": "hardhat typechain",
"build:typechain:ovm": "hardhat --network optimism typechain",
"test": "yarn run test:contracts",
"test:contracts": "hardhat test --show-stack-traces",
"test:gas": "hardhat test \"test/contracts/OVM/execution/OVM_StateManager.gas-spec.ts\" --no-compile --show-stack-traces",
......
yarn run build:typescript & yarn run build:contracts
yarn run build:contracts:ovm
yarn run build:typescript:ovm & yarn run build:contracts:ovm
......@@ -192,5 +192,13 @@ extendEnvironment((hre) => {
hre.config.paths.artifacts = artifactsPath
hre.config.paths.cache = cachePath
;(hre as any).artifacts = new Artifacts(artifactsPath)
// if typechain is present, send the typed bindings to an ovm-specific
// directory
if ((hre.config as any).typechain) {
if (!(hre as any).config.typechain.outDir.endsWith('-ovm')) {
(hre as any).config.typechain.outDir += '-ovm'
}
}
}
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment