Skip to content

Conversation

ChristopherDedominici
Copy link
Contributor

@ChristopherDedominici ChristopherDedominici commented Sep 5, 2025

PR on top of this one: #7354

Copy link

changeset-bot bot commented Sep 5, 2025

⚠️ No Changeset found

Latest commit: 9d4b894

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves error messages for viem assertions to make them more user-friendly and consistent. The changes focus on clarifying what was expected versus what actually happened during contract execution.

Key changes include:

  • Standardized error message format with clearer language
  • Added support for handling reverts without reasons
  • Improved messaging for custom error vs non-custom error scenarios

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
revert.ts Updated test expectations for improved error messages
revert-with.ts Added test for revert without reason scenario and updated error message expectations
revert-with-custom-error.ts Updated error message expectations and removed unused imports
revert-with-custom-error-with-args.ts Updated error message expectation for consistency
Revert.sol Added new test function for revert without reason scenario
revert-with.ts (src) Added handling for reverts without reasons and improved panic error messaging
handle-revert.ts Enhanced return type to handle reverts without reasons and improved error messages
handle-revert-with-custom-error.ts Restructured error handling logic and improved error messages
error-string.ts Refactored exports and added new utility function for panic error detection
Comments suppressed due to low confidence (1)

v-next/hardhat-viem-assertions/test/fixture-projects/hardhat-project/contracts/Revert.sol:1

  • There's a grammatical error in the test description. It should be 'reverts' instead of 'revert'.
// SPDX-License-Identifier: MIT

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

… github.com:NomicFoundation/hardhat into align-msgs-with-chai-matchers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changeset needed This PR doesn't require a changeset
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

2 participants