Skip to content

Conversation

@ArniStarkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

Copy link
Collaborator

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

@Itay-Tsabary-Starkware made 2 comments.
Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @ArniStarkware).


crates/apollo_integration_tests/tests/common/mod.rs line 253 at r1 (raw file):

    );
    tx_hashes.to_vec()
}

I'm confused regarding this fn:

AFAIU the callers to this fn have a Vec<TransactionHash> element, which they pass as a slice to the fn, only for the fn to convert it back to a vector.

This seems inefficient.

Also - why does a validate fn have a return value? I'd expect it to either assert if the validation fails, or do nothing instead.

Code quote:

pub fn validate_tx_count(
    tx_hashes: &[TransactionHash],
    expected_count: usize,
) -> Vec<TransactionHash> {
    let tx_hashes_len = tx_hashes.len();
    assert_eq!(
        tx_hashes_len, expected_count,
        "Expected {expected_count} txs, but found {tx_hashes_len} txs.",
    );
    tx_hashes.to_vec()
}

crates/apollo_integration_tests/tests/test_many.rs line 27 at r1 (raw file):

}

const N_TXS: usize = 15;

Please place at the top of the module (after the use statements)

Code quote:

const N_TXS: usize = 15;

@ArniStarkware ArniStarkware force-pushed the arni/integration_tests/unify_use_of_validate_tx_count branch from c493f3d to cbfd963 Compare January 8, 2026 08:35
@ArniStarkware ArniStarkware force-pushed the arni/integration_tests/clean_old_todos branch from ee26577 to d69d8d3 Compare January 8, 2026 08:36
Copy link
Contributor Author

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

@ArniStarkware made 2 comments.
Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @Itay-Tsabary-Starkware).


crates/apollo_integration_tests/tests/test_many.rs line 27 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Please place at the top of the module (after the use statements)

Done.


crates/apollo_integration_tests/tests/common/mod.rs line 253 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

I'm confused regarding this fn:

AFAIU the callers to this fn have a Vec<TransactionHash> element, which they pass as a slice to the fn, only for the fn to convert it back to a vector.

This seems inefficient.

Also - why does a validate fn have a return value? I'd expect it to either assert if the validation fails, or do nothing instead.

Added a todo to simplify this inefficient "validation" (which, as you said, does more than validate.)

This is the parameter for TestScenario:

pub test_tx_hashes_fn: TestTxHashesFn,

The only non-trivial usage of this parameter is:

fn test_multiple_account_txs(tx_hashes: &[TransactionHash]) -> Vec<TransactionHash> {
// Return the transaction hashes in the order they should be given by the mempool:
// Transactions from the same account are ordered by nonce; otherwise, higher tips are given
// priority.
assert!(
tx_hashes.len() == 3,
"Unexpected number of transactions sent in the test scenario. Found {} transactions",
tx_hashes.len()
);
vec![tx_hashes[2], tx_hashes[0], tx_hashes[1]]
}

Copy link
Collaborator

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

@Itay-Tsabary-Starkware reviewed 3 files and all commit messages, made 1 comment, and resolved 2 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArniStarkware).

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