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
Improve TxPool tests and documentation #2327
Improve TxPool tests and documentation #2327
Changes from 14 commits
fde464e
1db4955
0012aa0
cadeeb5
b55e788
70770f0
7430558
99d99e8
3684929
87ef091
9fade92
2a48373
a73b038
f6c9b75
ab1de16
3988f69
c68b57a
46ef529
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.
does this need to be in the trait?
You are forcing all implementors of a
CollisionManager
to implement a test-only function to establish its integrity.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.
Pool is only defined with generics based on trait and so traits need to implements this for the pool to use it. Personally, I don't find this strange to have trait having test-only methods
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.
I prefer to keep traits only with business logic, if possible. In the case of tests, you always know the actual type. The
TxPool
can expose collision manager in the case of tests, in this case you can callassert_integrity
directly ontxpool.collision_manager.assert_integrity
.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.
Okey I personally find it cool to have test methods on trait also. But ok to change as you prefer.