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

refactor(gateway): use mock to test skip_validate #524

Closed

Conversation

yair-starkware
Copy link
Contributor

@yair-starkware yair-starkware commented Jul 23, 2024

This change is Reviewable

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.01%. Comparing base (088ce7f) to head (69a8034).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #524      +/-   ##
==========================================
- Coverage   82.61%   82.01%   -0.61%     
==========================================
  Files          39       43       +4     
  Lines        1789     1890     +101     
  Branches     1789     1890     +101     
==========================================
+ Hits         1478     1550      +72     
- Misses        237      255      +18     
- Partials       74       85      +11     

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

Copy link
Contributor

@Yael-Starkware Yael-Starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @dafnamatsry and @yair-starkware)


crates/gateway/src/stateful_transaction_validator_test.rs line 146 at r1 (raw file):

#[case::should_not_skip_validation_account_nonce_1(
    external_invoke_tx(invoke_tx_args!{sender_address: ContractAddress::from(TEST_SENDER_ADDRESS), nonce: Nonce(Felt::ONE)}),
    ContractAddress::from(TEST_SENDER_ADDRESS),

Suggestion:

    ContractAddress::from(TEST_SENDER_ADDRESS),
    external_invoke_tx(invoke_tx_args!{sender_address, nonce: Nonce(Felt::ONE)}),

crates/gateway/src/stateful_transaction_validator_test.rs line 152 at r1 (raw file):

fn test_skip_stateful_validation(
    #[case] external_tx: RPCTransaction,
    #[case] sender_address: ContractAddress,

Suggestion:

     #[case] sender_address: ContractAddress,
     #[case] external_tx: RPCTransaction,
    

crates/gateway/src/stateful_transaction_validator_test.rs line 160 at r1 (raw file):

    mock_validator
        .expect_get_nonce()
        // TODO(yair): get the sender addres from the external_tx.

this would eventually become InternalTransaction and should have a method for getting the sender_address

Suggestion:

// TODO(yair): get the sender address from the external_tx.

@yair-starkware
Copy link
Contributor Author

Opened the PR in the mono-repo: starkware-libs/sequencer#131

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.

3 participants