Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
26 use runtime managed erc20 tokens in tests #27
26 use runtime managed erc20 tokens in tests #27
Changes from 3 commits
27a8096
480962f
fe01d54
ec682a0
b1e2938
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to
burn
before wemint
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is related to
Maybe we should find a clearer way to do this? How about a teardown function, or we add cleanup-related code to the end of each test? Otherwise we should maybe at least add a comment that explains why we burn before we mint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed this is just to ensure that the balance of the tokens for the relevant accounts is 0 before the mint and at the end of this
setUp()
function we have only the expected minted amount.I will add some comments to clarify this, but I don't think we should add another function since we are already in the
setUp()
function and this is the cleanup for a test that came before (if any), let me know it makes sense @ebma.BTW, it is true that perhaps a teardown at the end also makes sense, but given that the tests stops if there is an error, as of now I don't think there is a way to actually make sure that the teardown actually runs. That's why I think for now cleaning just in case in the setUp makes more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I see your point. Although we don't support 'teardown' functions yet, we could just try to execute them (if any) in a new
finally {}
block at the end of the try-catch here. This way it will be executed in any case.I'm also fine with your existing implementation actually, the only thing that bothers me a bit is that the comment reasoning why we need to burn before minting is only included in one file. And I see why since copy-pasting it into any file is annoying. But with a teardown function for each test, it might be self-explanatory enough that we don't even need a comment in the first place. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I agree that would be the better approach. Could we perhaps open a separate issue and wait for this one? Since it would be touching a separate part of the code logic not just the tests but also how they run.
In the meantime if you are okay with it I can just copy the comment to all the setups so we don't forget what is going on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍 could you create that follow-up ticket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!