-
Notifications
You must be signed in to change notification settings - Fork 25
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): test contract for validate and execute merging #2456
Conversation
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: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware)
a discussion (no related file):
There are too many tests for the same function. I suggest deleting test_state_cache_merge
and test_allocated_keys_two_transactions
. WDYT?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2456 +/- ##
===========================================
+ Coverage 40.10% 71.99% +31.88%
===========================================
Files 26 101 +75
Lines 1895 13518 +11623
Branches 1895 13518 +11623
===========================================
+ Hits 760 9732 +8972
- Misses 1100 3371 +2271
- Partials 35 415 +380 ☔ 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 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @yoavGrs)
a discussion (no related file):
Previously, yoavGrs wrote…
There are too many tests for the same function. I suggest deleting
test_state_cache_merge
andtest_allocated_keys_two_transactions
. WDYT?
as long as the union of scenarios and union of assertions exist - sgtm
crates/blockifier/src/state/cached_state_test.rs
line 490 at r1 (raw file):
#[case(true, felt!("0x7"), felt!("0x7"), true)] #[case(false, felt!("0x0"), felt!("0x8"), false)] #[case(true, felt!("0x7"), felt!("0x0"), false)]
give names to cases like this
Suggestion:
#[case::real_diff_nonzero_base(false, felt!("0x7"), felt!("0x8"), false)]
#[case::execute_allocation(true, felt!("0x0"), felt!("0x8"), true)]
#[case::validate_allocation(true, felt!("0x7"), felt!("0x7"), true)]
#[case::nonzero_to_zero_to_nonzero(false, felt!("0x0"), felt!("0x8"), false)]
#[case::zero_to_nonzero_to_zero(true, felt!("0x7"), felt!("0x0"), false)]
crates/blockifier/src/state/cached_state_test.rs
line 516 at r1 (raw file):
}); let tx_execution_info = invoke_tx.execute(&mut transactional_state, &block_context, false, true).unwrap();
you shouldn't need to create a transactional state
Suggestion:
let signature =
TransactionSignature(vec![Felt::from(STORAGE_WRITE), validate_value, execute_value]);
let invoke_tx = account_invoke_tx(invoke_tx_args! {
signature,
sender_address: contract_address,
calldata: create_calldata(contract_address, "foo", &[]),
});
let tx_execution_info =
invoke_tx.execute(&mut state, &block_context, false, true).unwrap();
crates/blockifier/src/state/cached_state_test.rs
line 516 at r1 (raw file):
}); let tx_execution_info = invoke_tx.execute(&mut transactional_state, &block_context, false, true).unwrap();
why did you set charge_fee to false here?
Code quote:
false
crates/blockifier/feature_contracts/cairo1/account_faulty.cairo
line 0 at r1 (raw file):
can you add the same functionality to the cairo0 contract?
that way we will be able to parametrize the test to both cairo versions
9a66da9
to
bd621f5
Compare
3ef88f8
to
4bec2fe
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 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @yoavGrs)
4bec2fe
to
42b1ca0
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 8 files reviewed, 5 unresolved discussions (waiting on @dorimedini-starkware)
a discussion (no related file):
Previously, dorimedini-starkware wrote…
as long as the union of scenarios and union of assertions exist - sgtm
So I'll delete only the second.
crates/blockifier/feature_contracts/cairo1/account_faulty.cairo
line at r1 (raw file):
Previously, dorimedini-starkware wrote…
can you add the same functionality to the cairo0 contract?
that way we will be able to parametrize the test to both cairo versions
Done.
crates/blockifier/src/state/cached_state_test.rs
line 490 at r1 (raw file):
Previously, dorimedini-starkware wrote…
give names to cases like this
Done.
crates/blockifier/src/state/cached_state_test.rs
line 516 at r1 (raw file):
Previously, dorimedini-starkware wrote…
why did you set charge_fee to false here?
Changed.
crates/blockifier/src/state/cached_state_test.rs
line 516 at r1 (raw file):
Previously, dorimedini-starkware wrote…
you shouldn't need to create a transactional state
Done.
42b1ca0
to
ce766a8
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 6 of 7 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @yoavGrs)
923bc81
to
c9454fc
Compare
ce766a8
to
24761cc
Compare
3a7681a
to
fb29524
Compare
24761cc
to
27c808f
Compare
fb29524
to
dc573fe
Compare
27c808f
to
fb3d179
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 1159 of 1159 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @yoavGrs)
a discussion (no related file):
remove the target_vscode from this PR...
where did it come from? did you set up your vscode in some non-standard way? or should this dir be added to everyone's gitignore?
dc573fe
to
5861d2a
Compare
fb3d179
to
7c7f02d
Compare
5861d2a
to
61340f7
Compare
7c7f02d
to
4fb6d8f
Compare
4fb6d8f
to
4312ac1
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 1 of 1 files at r6, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @yoavGrs)
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 @dorimedini-starkware)
a discussion (no related file):
Previously, dorimedini-starkware wrote…
remove the target_vscode from this PR...
where did it come from? did you set up your vscode in some non-standard way? or should this dir be added to everyone's gitignore?
Done.
Maybe it should be added to '.gitignore'. Let's talk offline.
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 @yoavGrs)
a discussion (no related file):
Previously, yoavGrs wrote…
Done.
Maybe it should be added to '.gitignore'. Let's talk offline.
I still see the files in this PR..
4312ac1
to
96db9a1
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 1158 of 1158 files at r7, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @yoavGrs)
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: complete! all files reviewed, all discussions resolved (waiting on @yoavGrs)
No description provided.