-
Notifications
You must be signed in to change notification settings - Fork 11
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
test(mempool): add function to assert equality and implement Eq,Parti… #431
test(mempool): add function to assert equality and implement Eq,Parti… #431
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #431 +/- ##
=======================================
Coverage ? 83.40%
=======================================
Files ? 37
Lines ? 1723
Branches ? 1723
=======================================
Hits ? 1437
Misses ? 209
Partials ? 77 ☔ View full report in Codecov by Sentry. |
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.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @elintul and @MohammadNassar1)
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.
Reviewed 1 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ayeletstarkware and @MohammadNassar1)
crates/mempool/src/mempool_test.rs
line 144 at r1 (raw file):
let txs = mempool.get_txs(requested_txs).unwrap(); // This ensures we do not exceed the number of transactions available in the mempool.
Suggestion:
// Ensure
crates/mempool/src/mempool_test.rs
line 147 at r1 (raw file):
let max_requested_txs = requested_txs.min(n_txs); // checks that the returned transactions are the ones with the highest priority.
x2
Suggestion:
// Check
crates/mempool/src/mempool_test.rs
line 152 at r1 (raw file):
// checks that the transactions that were not returned are still in the mempool. MempoolState::new(remaining_txs.to_vec(), remaining_txs.to_vec()).verify_equality(&mempool);
Define a mempool_state
variable, so this line is easier to read.
Code quote:
MempoolState::new(remaining_txs.to_vec(), remaining_txs.to_vec())
c8548e1
to
371fdd0
Compare
371fdd0
to
1a21314
Compare
04edec5
to
ba6056d
Compare
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.
Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @MohammadNassar1)
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.
Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ayeletstarkware and @MohammadNassar1)
crates/mempool/src/mempool_test.rs
line 169 at r2 (raw file):
// Check that the transactions that were not returned are still in the mempool. let remaining_ref_txs = remaining_txs.iter().map(TransactionReference::new);
Suggestion:
remaining_tx_references
crates/mempool/src/transaction_queue.rs
line 10 at r2 (raw file):
// Note: PartialEq and Eq for TransactionQueue are derived, ensuring that // equality checks take into account the sorted nature of the BTreeSet.
Suggesting a behavioral description, with lower chances of getting old.
Suggestion:
// Note: the derived comparison functionality considers the order guaranteed by the data structures used.
1a21314
to
6b7b20a
Compare
…alEq for related structs
ba6056d
to
7479fd6
Compare
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.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on @elintul, @giladchase, and @MohammadNassar1)
crates/mempool/src/mempool_test.rs
line 148 at r3 (raw file):
#[case::test_get_less_than_all_eligible_txs(2)] fn test_get_txs(#[case] requested_txs: usize) { let tx1 = add_tx_input!(tip: 50, tx_hash: 1).tx;
renaming here #463
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.
Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @elintul and @giladchase)
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @elintul and @giladchase)
…alEq for related structs
This change is