Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding a function and editing the error message for the issue #4151 #4208

Conversation

Saty248
Copy link
Contributor

@Saty248 Saty248 commented Jul 28, 2023

  • [x ] Because this PR includes a bug fix, relevant tests have been included.

i have changed the error message for the issue #4151 and i've also added a function deleteOnReset() which resets the snapshots array.

let me know what other changes I need to make on this issue.

@changeset-bot
Copy link

changeset-bot bot commented Jul 28, 2023

⚠️ No Changeset found

Latest commit: e27a7d9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jul 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 17, 2024 7:54pm
hardhat-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 17, 2024 7:54pm

@fvictorio
Copy link
Member

Hey @Saty248, thanks for this. This is a really interesting idea. It won't work for raw hardhat_reset calls, so we should still detect those kind of problems, but that could be a separate efforts.

This needs tests though, and I dont' think the code is formatted correctly.

@@ -68,3 +68,8 @@ export async function loadFixture<T>(fixture: Fixture<T>): Promise<T> {
return data;
}
}

// function to clear the snapshots array when hardhat_reset is called..
export async function deleteOnReset(){
Copy link
Member

Choose a reason for hiding this comment

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

This function name is overspecified. I think clearSnapshots would be better.

@Saty248
Copy link
Contributor Author

Saty248 commented Aug 5, 2023

hey @fvictorio,
i've changed the function name from deleteOnRequest to clearSnapshots and formated the code using lint.Also I've added a test case for the clearsnapshot on reset.ts under test. Do I need to added additional test cases for hardhat reset with a url and block number?

@alcuadrado alcuadrado merged commit 6213c9e into NomicFoundation:main May 17, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants