Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Stop serializing HH config data we don't need #5938

Merged
merged 1 commit into from
Feb 28, 2023

Conversation

gnidan
Copy link
Contributor

@gnidan gnidan commented Feb 28, 2023

PR description

As raised by @emilyJLin95, this PR fixes a problem where hre.config now contains non-serializable data. Since @truffle/from-hardhat needs only a small portion of the data in hre.config, this PR takes the approach to pre-process it, whittling it down to just what we need. This prevents serialization issues that may arise.

Testing instructions

In repo root:

git checkout fix/from-hardhat-bigints
yarn
cd packages/from-hardhat && yarn link && cd -

In a new directory for a fresh HH project:

npx hardhat # follow the wizard, the wonderful wizard
npx hardhat compile
yarn link @truffle/from-hardhat
node

In that node repl that just started:

const FromHardhat = require("@truffle/from-hardhat");
await FromHardhat.prepareConfig();

Observe that it does not break.

Oh, and you'll need the latest Node.js if you want that await to work.

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if documentation updates are required.

Breaking changes and new features

  • I have added any needed breaking-change and new-feature labels for the appropriate packages.

@gnidan
Copy link
Contributor Author

gnidan commented Feb 28, 2023

cc @alcuadrado in case it was an accident that hre.config is no longer serializable

Copy link
Member

@cds-amal cds-amal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

packages/from-hardhat/src/api.ts Show resolved Hide resolved
@gnidan gnidan merged commit 689d52d into develop Feb 28, 2023
@gnidan gnidan deleted the fix/from-hardhat-bigints branch February 28, 2023 22:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants