-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Remove transaction-pool test-helpers
feature
#10571
Remove transaction-pool test-helpers
feature
#10571
Conversation
`test-helpers` feature is a bad idea in general, because once the feature is enabled somewhere in the workspace, it is enabled anywhere. While removing the feature, the tests were also rewritten to get rid off other "only test" related code. Contributes towards: #9727
pub fn new_test( | ||
pool_api: Arc<PoolApi>, | ||
) -> (Self, Pin<Box<dyn Future<Output = ()> + Send>>, intervalier::BackSignalControl) { | ||
pub fn new_test(pool_api: Arc<PoolApi>) -> (Self, Pin<Box<dyn Future<Output = ()> + Send>>) { |
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.
Is this used outside this create? Can't we gate it on cfg(test)
?
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 it is used outside. The naming is also obvious enough that you don't call this in production code, imo.
|
||
// This will prune `xt1`. | ||
block_on(pool.maintain(block_event(header))); | ||
|
||
assert_eq!(pool.status().ready, 0); | ||
} | ||
|
||
#[test] |
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 was this one removed?
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.
Because the test is useless, it doesn't test anything.
maintain
is only called for best blocks nowadays (wasn't back in the old days)
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
bot merge |
Waiting for commit status. |
Merge cancelled due to error. Error: Checks failed for 01c35c0 |
bot merge |
Bot will approve on the behalf of @bkchr, since they are a team lead, in an attempt to reach the minimum approval count |
* Remove transaction-pool `test-helpers` feature `test-helpers` feature is a bad idea in general, because once the feature is enabled somewhere in the workspace, it is enabled anywhere. While removing the feature, the tests were also rewritten to get rid off other "only test" related code. Contributes towards: paritytech#9727 * Apply suggestions from code review Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> * Fix benches Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Remove transaction-pool `test-helpers` feature `test-helpers` feature is a bad idea in general, because once the feature is enabled somewhere in the workspace, it is enabled anywhere. While removing the feature, the tests were also rewritten to get rid off other "only test" related code. Contributes towards: paritytech#9727 * Apply suggestions from code review Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> * Fix benches Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
test-helpers
feature is a bad idea in general, because once the feature is enabled somewhere inthe workspace, it is enabled anywhere. While removing the feature, the tests were also rewritten to
get rid off other "only test" related code.
Contributes towards: #9727