-
Notifications
You must be signed in to change notification settings - Fork 8
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
refactor: tests #405
refactor: tests #405
Conversation
pallets/nfts/src/tests.rs
Outdated
assert_ok!(approve_collection_transfer( | ||
origin.clone(), | ||
maybe_item_owner.clone(), | ||
for deadline in [None, None, Some(deadline), Some(deadline * 2), Some(deadline), None] { |
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.
Sorry but I don't understand what this means.
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.
see latest commit
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.
This is sadly still not easy to understand. Can we use System::set_block_number(0)
to reset the time and update the list of deadlines to fit with that?
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.
See latest commit
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.
Only the deadline for loop is still confusing to me even with a description. Maybe it could be better to explain each case, I guess.
pallets/nfts/src/tests.rs
Outdated
assert_ok!(approve_collection_transfer( | ||
origin.clone(), | ||
maybe_item_owner.clone(), | ||
for deadline in [None, None, Some(deadline), Some(deadline * 2), Some(deadline), None] { |
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.
This is sadly still not easy to understand. Can we use System::set_block_number(0)
to reset the time and update the list of deadlines to fit with that?
Codecov ReportAll modified and coverable lines are covered by tests ✅
@@ Coverage Diff @@
## chungquantin/feat-nfts #405 +/- ##
==========================================================
- Coverage 70.44% 70.35% -0.09%
==========================================================
Files 70 70
Lines 13109 13073 -36
Branches 13109 13073 -36
==========================================================
- Hits 9234 9197 -37
Misses 3603 3603
- Partials 272 273 +1
|
No description provided.