Skip to content
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

feat(mempool): add from_iter func to TransactionQueue #413

Merged

Conversation

ayeletstarkware
Copy link
Contributor

@ayeletstarkware ayeletstarkware commented Jul 9, 2024

This change is Reviewable

@codecov-commenter
Copy link

codecov-commenter commented Jul 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.69%. Comparing base (c025838) to head (282dcf3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #413   +/-   ##
=======================================
  Coverage   83.69%   83.69%           
=======================================
  Files          37       37           
  Lines        1717     1717           
  Branches     1717     1717           
=======================================
  Hits         1437     1437           
  Misses        203      203           
  Partials       77       77           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ayeletstarkware ayeletstarkware force-pushed the ayelet/mempool/transaction-queue/from-iter-func branch from dbecd1e to 068f596 Compare July 9, 2024 14:25
@ayeletstarkware ayeletstarkware changed the base branch from main to ayelet/mempool/transaction-pool/from-iter-func July 9, 2024 14:25
@ayeletstarkware ayeletstarkware requested a review from elintul July 9, 2024 14:29
Copy link
Contributor

@MohammadNassar1 MohammadNassar1 left a 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 r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ayeletstarkware and @elintul)


crates/mempool/src/mempool_test.rs line 33 at r2 (raw file):

        for tx in txs {
            queue.insert(TransactionReference::new(&tx));
        }

Suggestion:

        txs.iter().for_each(|tx| queue.insert(TransactionReference::new(tx)));

Copy link
Collaborator

@elintul elintul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ayeletstarkware)


crates/mempool/src/mempool_test.rs line 30 at r2 (raw file):

impl FromIterator<ThinTransaction> for TransactionQueue {
    fn from_iter<T: IntoIterator<Item = ThinTransaction>>(txs: T) -> TransactionQueue {
        let mut queue = TransactionQueue::default();

Suggestion:

Self

@ayeletstarkware ayeletstarkware force-pushed the ayelet/mempool/transaction-pool/from-iter-func branch from 255c53e to 90acb6e Compare July 10, 2024 08:22
Copy link
Collaborator

@elintul elintul left a 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 r2.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ayeletstarkware)


crates/mempool/src/mempool_test.rs line 28 at r2 (raw file):

// TODO(Ayelet): Consider using an iterator of references to ThinTransaction to avoid cloning.
impl FromIterator<ThinTransaction> for TransactionQueue {

Suggestion:

TransactionReference

@ayeletstarkware ayeletstarkware force-pushed the ayelet/mempool/transaction-queue/from-iter-func branch from 068f596 to 282dcf3 Compare July 10, 2024 10:29
@ayeletstarkware ayeletstarkware changed the base branch from ayelet/mempool/transaction-pool/from-iter-func to main July 10, 2024 10:29
Copy link
Collaborator

@elintul elintul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ayeletstarkware)

@ayeletstarkware ayeletstarkware merged commit 4fa757d into main Jul 10, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants