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

fix: hardhat-chai-matchers error message when event is overloaded #5727

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

iosh
Copy link
Contributor

@iosh iosh commented Sep 7, 2024

  • Because this PR includes a bug fix, relevant tests have been included.
  • Because this PR includes a new feature, the change was previously discussed on an Issue or with someone from the team.
  • I didn't do anything of this.

Throw an error if the provided event name is ambiguous and request a clear event name from the user.

This will be resolve #5696

Copy link

changeset-bot bot commented Sep 7, 2024

🦋 Changeset detected

Latest commit: 225c1c2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@nomicfoundation/hardhat-chai-matchers Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Sep 7, 2024

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 Sep 10, 2024 5:07pm

@alcuadrado
Copy link
Member

Hey! This looks really good! Thanks a ton!

I'll let @schaable review it, as he's more familiar with this part of the codebase.

Maybe this issue will also be of your interest: #4725

Copy link
Member

@schaable schaable left a comment

Choose a reason for hiding this comment

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

Looks great! I’ve tested the following scenarios:

  1. A contract that inherits from another contract and adds an overloaded event to the one defined in the parent contract.
  2. A contract that defines multiple overloads of the same event.
  3. Calling emit with an unknown event.

Screenshots:
Before:
previous

  1. ambiguous event description is shown:
    after
  2. ambiguous event description is shown:
    multiple
  3. event doesn't exist is shown:
    event2

@schaable schaable merged commit 6ec0e83 into NomicFoundation:main Sep 10, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Support overloaded events in chai matchers
4 participants