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

[Investigation]: do we need a function that returns all events emitted by all contracts? #56

Open
1 task done
0xNeshi opened this issue Feb 25, 2025 · 0 comments
Open
1 task done
Labels
enhancement New feature or request question Further information is requested uphill Some research/design is needed before this can be implemented.

Comments

@0xNeshi
Copy link
Collaborator

0xNeshi commented Feb 25, 2025

What is the feature you would like to see?

From #34 (comment):

Wdyt should we create a function that returns a list of all events emitted by all contracts during a test run?

This seems like a useful feature to me, though I can't think of a use case that couldn't be tested without this 🤔

Maybe one use case would be a factory contract that creates many other contracts, that in turn emit some events?
The dev could write a test case that asserts something like "invoke factory::create(1000) (creates 1000 other contracts that each emit an event), then get a list of all emitted events and assert there are exactly 1000 of them and each is of type Event". The assertion could be made differently - get list of addresses of 1000 created contracts -> assert each contract emitted Event.

Either way, having the function shouldn't hurt motsu, we could treat it is a shorthand utility in case devs need it.

Interested in your thoughts.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines
@0xNeshi 0xNeshi added enhancement New feature or request question Further information is requested uphill Some research/design is needed before this can be implemented. labels Feb 25, 2025
@0xNeshi 0xNeshi mentioned this issue Feb 25, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested uphill Some research/design is needed before this can be implemented.
Projects
None yet
Development

No branches or pull requests

1 participant