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

CU-86dtu92vq - Include how to test smart contract events using boa test constructor #1268

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

luc10921
Copy link
Contributor

No description provided.

@luc10921 luc10921 requested a review from meevee98 June 19, 2024 17:25
@luc10921 luc10921 self-assigned this Jun 19, 2024
@melanke
Copy link
Contributor

melanke commented Jun 19, 2024

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 91.201%. remained the same
when pulling 12e442e on CU-86dtu92vq
into 9c903f9 on development.

Comment on lines 144 to 147
example, we are testing the "Transfer" event, so we can use the `Nep17TransferEvent` class from `boaconstructor`. If you
plan to test other events, it's best you also create a class or method that will help you unwrap the stack results.
Check out [`Nep17TransferEvent`](https://github.com/CityOfZion/boa-test-constructor/blob/20a45755767b3d919bf7a594cfff6bff78cb72ac/boaconstructor/__init__.py#L302-L314)
implementation for reference.
Copy link
Contributor

Choose a reason for hiding this comment

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

Regarding creating new classes to handle other events, I think it's better to give an example in this file than to just link to the boaconstructor code.
Can you change it to create a class to handle the same Nep17 event? But include a validation for from or to being None (doesn't need to explain)

@luc10921 luc10921 requested a review from meevee98 June 20, 2024 12:55
@coveralls
Copy link
Collaborator

Coverage Status

coverage: 91.201%. remained the same
when pulling 7f2b332 on CU-86dtu92vq
into 9c903f9 on development.

@meevee98 meevee98 merged commit 7b9aa38 into development Jun 20, 2024
4 checks passed
@meevee98 meevee98 deleted the CU-86dtu92vq branch June 20, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants