-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Gracelessly shove Hardhat support into truffle debug
#5410
Conversation
network_id: "*" | ||
}; | ||
|
||
require(`${config.working_directory}/node_modules/hardhat/register`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed if you import hardhat below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it without this and this line was necessary... I think I'm going to go with the approach of shelling out to node -r hardhat/register
instead of this.
artifacts | ||
} = require(`${config.working_directory}/node_modules/hardhat`); | ||
const buildInfoPaths = await artifacts.getBuildInfoPaths(); | ||
const buildInfos = await Promise.all( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will lead to an OOM. I'd read one build info at the time, as they can be huge. They have the entire solc output, so they can take 100mb+ in some large projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call!
const { _format } = buildInfo; | ||
|
||
if (!supportedFormats.has(_format)) { | ||
throw new Error(`Unsupported build info format: ${_format}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
It's great that you are validating this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course :D
I want this branch name back. |
wip... this is a hack and a half