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

test(blockifier): execute_directly with v3 invoke instead of deprecated #1770

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

TzahiTaub
Copy link
Contributor

No description provided.

@TzahiTaub TzahiTaub self-assigned this Nov 3, 2024
@reviewable-StarkWare
Copy link

This change is Reviewable

@TzahiTaub TzahiTaub force-pushed the tzahi/blockifier/test_util_defaults_to_v3_invoke branch from 8f28207 to 59b4d31 Compare November 3, 2024 15:49
Copy link

github-actions bot commented Nov 3, 2024

Artifacts upload triggered. View details here

Copy link

github-actions bot commented Nov 3, 2024

Artifacts upload triggered. View details here

@TzahiTaub TzahiTaub changed the base branch from main to tzahi/starknet_api/tests_default_resource_bounds_to_all November 3, 2024 15:55
Copy link

github-actions bot commented Nov 3, 2024

Artifacts upload triggered. View details here

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @TzahiTaub)


crates/blockifier/src/test_utils/struct_impls.rs line 58 at r1 (raw file):

        let default_invoke_tx = account_invoke_tx(InvokeTxArgs::default());
        let tx_info = default_invoke_tx.create_tx_info();
        assert!(matches!(tx_info, TransactionInfo::Current(_)));

this is an awkward way to get the desired default tx context...
maybe add a &TransactionInfo input to this method? is it possible?

Code quote:

        let limit_steps_by_resources = false;
        let default_invoke_tx = account_invoke_tx(InvokeTxArgs::default());
        let tx_info = default_invoke_tx.create_tx_info();
        assert!(matches!(tx_info, TransactionInfo::Current(_)));

Copy link
Contributor Author

@TzahiTaub TzahiTaub 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: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware)


crates/blockifier/src/test_utils/struct_impls.rs line 58 at r1 (raw file):

Previously, dorimedini-starkware wrote…

this is an awkward way to get the desired default tx context...
maybe add a &TransactionInfo input to this method? is it possible?

But I want to save the callers this boilerplate code

@TzahiTaub TzahiTaub changed the title Tzahi/blockifier/test util defaults to v3 invoke test(blockifier): execute_directly with v3 invoke instead of deprecated Nov 4, 2024
Copy link

github-actions bot commented Nov 4, 2024

Artifacts upload triggered. View details here

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.54%. Comparing base (e3165c4) to head (a20c055).
Report is 213 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1770       +/-   ##
===========================================
+ Coverage   40.10%   68.54%   +28.43%     
===========================================
  Files          26      102       +76     
  Lines        1895    13625    +11730     
  Branches     1895    13625    +11730     
===========================================
+ Hits          760     9339     +8579     
- Misses       1100     3885     +2785     
- Partials       35      401      +366     

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

Copy link
Collaborator

@dorimedini-starkware dorimedini-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: all files reviewed, 1 unresolved discussion (waiting on @TzahiTaub)


crates/blockifier/src/test_utils/struct_impls.rs line 58 at r1 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

But I want to save the callers this boilerplate code

add CurrentTransactionInfo::default_for_testing

@TzahiTaub TzahiTaub force-pushed the tzahi/blockifier/test_util_defaults_to_v3_invoke branch from 59b4d31 to b1cd0aa Compare November 4, 2024 12:58
Copy link
Contributor Author

@TzahiTaub TzahiTaub 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 2 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware and @TzahiTaub)


crates/blockifier/src/test_utils/struct_impls.rs line 58 at r1 (raw file):

Previously, dorimedini-starkware wrote…

add CurrentTransactionInfo::default_for_testing

Done.

Copy link

github-actions bot commented Nov 4, 2024

Artifacts upload triggered. View details here

Copy link
Collaborator

@dorimedini-starkware dorimedini-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:

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @TzahiTaub)


crates/blockifier/src/transaction/objects.rs line 126 at r2 (raw file):

        Self {
            common_fields: CommonAccountFields::default(),
            resource_bounds: ValidResourceBounds::create_for_testing(),

this gives AllResources that are nonzero, right?

Code quote:

ValidResourceBounds::create_for_testing()

Copy link
Contributor Author

@TzahiTaub TzahiTaub 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: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware)


crates/blockifier/src/transaction/objects.rs line 126 at r2 (raw file):

Previously, dorimedini-starkware wrote…

this gives AllResources that are nonzero, right?

GasAmount for L2 is high, price is 0, and for the other two, amount is 1 and price is 0. This is to keep enforce_fee==False.

@TzahiTaub TzahiTaub force-pushed the tzahi/starknet_api/tests_default_resource_bounds_to_all branch from 99ab043 to f25405d Compare November 5, 2024 08:51
Copy link
Collaborator

@dorimedini-starkware dorimedini-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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @TzahiTaub)

@TzahiTaub TzahiTaub changed the base branch from tzahi/starknet_api/tests_default_resource_bounds_to_all to main November 5, 2024 21:35
Copy link

github-actions bot commented Nov 5, 2024

Artifacts upload triggered. View details here

@TzahiTaub TzahiTaub force-pushed the tzahi/blockifier/test_util_defaults_to_v3_invoke branch from b1cd0aa to 44c0f5a Compare November 5, 2024 21:39
Copy link

github-actions bot commented Nov 5, 2024

Artifacts upload triggered. View details here

@TzahiTaub TzahiTaub force-pushed the tzahi/blockifier/test_util_defaults_to_v3_invoke branch from 44c0f5a to a20c055 Compare November 5, 2024 21:47
Copy link

github-actions bot commented Nov 5, 2024

Artifacts upload triggered. View details here

Copy link
Contributor Author

@TzahiTaub TzahiTaub left a comment

Choose a reason for hiding this comment

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

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

@TzahiTaub TzahiTaub merged commit a9f3df7 into main Nov 6, 2024
12 checks passed
@TzahiTaub TzahiTaub deleted the tzahi/blockifier/test_util_defaults_to_v3_invoke branch November 6, 2024 06:25
@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants