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

feat(forge): add expectEmit(...,address) for specifying emitting contract #1385

Merged
merged 5 commits into from
Apr 23, 2022

Conversation

lattejed
Copy link
Contributor

Motivation

#1264

A second form of expectEmit(...) that takes an address to check against the emitting contract in case nested contracts can emit the same event.

Solution

Add a second form of expectEmit(...) with an address parameter. Internally, the emitting contract's address is forwarded to the log handler and checked against the supplied address.

Also, update docs and tests.

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

smol request, otherwise looks good!!

testdata/cheats/ExpectEmit.t.sol Show resolved Hide resolved
@onbjerg onbjerg added the T-feature Type: feature label Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-feature Type: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vm.expectEmit -- add parameter specifying the contract that will emit the event
2 participants