-
Notifications
You must be signed in to change notification settings - Fork 26
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): parametrize test_max_fee_exceeds_balance by resource bounds types #1322
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1322 +/- ##
===========================================
+ Coverage 40.10% 77.35% +37.24%
===========================================
Files 26 100 +74
Lines 1895 13457 +11562
Branches 1895 13457 +11562
===========================================
+ Hits 760 10409 +9649
- Misses 1100 2591 +1491
- Partials 35 457 +422 ☔ View full report in Codecov by Sentry. |
ae7be2c
to
42d8ada
Compare
f989b8b
to
518d113
Compare
42d8ada
to
04ce114
Compare
518d113
to
b3d32a5
Compare
04ce114
to
8c269eb
Compare
b3d32a5
to
8b2feeb
Compare
8c269eb
to
db2167f
Compare
8b2feeb
to
30334dd
Compare
db2167f
to
cc00710
Compare
30334dd
to
c6b5046
Compare
cc00710
to
f5d813d
Compare
c6b5046
to
c38639f
Compare
f5d813d
to
d936ad2
Compare
c38639f
to
ae6c0f6
Compare
0ba46bf
to
c6d2344
Compare
Artifacts upload triggered. View details here |
3042759
to
8a0aea2
Compare
c6d2344
to
89d3c64
Compare
Artifacts upload triggered. View details here |
0fbf558
to
69f90e5
Compare
89d3c64
to
b789d5c
Compare
Artifacts upload triggered. View details here |
Artifacts upload triggered. View details here |
b789d5c
to
19c997d
Compare
Artifacts upload triggered. View details here |
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 1 files reviewed, 6 unresolved discussions (waiting on @dorimedini-starkware)
crates/blockifier/src/transaction/transactions_test.rs
line 841 at r2 (raw file):
} fn assert_failure_if_resource_bounds_exceed_balance(
No if
Suggestion:
assert_resource_bounds_exceed_balance_failure
crates/blockifier/src/transaction/transactions_test.rs
line 881 at r2 (raw file):
TransactionExecutionError::TransactionPreValidationError( TransactionPreValidationError::TransactionFeeError( TransactionFeeError::ResourcesBoundsExceedBalance {
It is better if this error object contains an AllResourceBounds
object.
Non blocking.
Code quote:
ResourcesBoundsExceedBalance
crates/blockifier/src/transaction/transactions_test.rs
line 955 at r2 (raw file):
&[(account_contract, 1), (test_contract, 1)], ); let account_contract_address = account_contract.get_instance_address(0);
Suggestion.
Suggestion:
sender_address
crates/blockifier/src/transaction/transactions_test.rs
line 956 at r2 (raw file):
); let account_contract_address = account_contract.get_instance_address(0); let default_args = invoke_tx_args! {
Suggestion:
default_invoke_args
crates/blockifier/src/transaction/transactions_test.rs
line 960 at r2 (raw file):
calldata: create_trivial_calldata(test_contract.get_instance_address(0) )}; let invalid_max_fee = Fee(BALANCE.0 + 1);
Move under V1 Invoke.
Code quote:
let invalid_max_fee = Fee(BALANCE.0 + 1);
crates/blockifier/src/transaction/transactions_test.rs
line 1047 at r2 (raw file):
base_resource_bounds )); base_resource_bounds.l1_gas.max_amount.0 -= 10;
Code duplication.
Move te logic into a macro
Suggestion:
macro_rules! resource_overdraft {
($max_amount:expr) => {
$max_amount.0 += 10;
v3_txs_invalid_bounds_invoke_case!(ValidResourceBounds::AllResources(
base_resource_bounds
));
v3_txs_invalid_bounds_declare_case!(ValidResourceBounds::AllResources(
base_resource_bounds
));
$max_amount.0 -= 10;
};
}
resource_overdraft!(base_resource_bounds.l1_gas.max_amount);
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 1 files reviewed, 4 unresolved discussions (waiting on @yoavGrs)
crates/blockifier/src/transaction/transactions_test.rs
line 841 at r2 (raw file):
Previously, yoavGrs wrote…
No
if
Done.
crates/blockifier/src/transaction/transactions_test.rs
line 956 at r2 (raw file):
); let account_contract_address = account_contract.get_instance_address(0); let default_args = invoke_tx_args! {
Done.
crates/blockifier/src/transaction/transactions_test.rs
line 960 at r2 (raw file):
Previously, yoavGrs wrote…
Move under V1 Invoke.
Done.
crates/blockifier/src/transaction/transactions_test.rs
line 1047 at r2 (raw file):
Previously, yoavGrs wrote…
Code duplication.
Move te logic into a macro
Done.
19c997d
to
b444899
Compare
Artifacts upload triggered. View details here |
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, 5 unresolved discussions (waiting on @yoavGrs)
a discussion (no related file):
py side pr (change in error formatting, need to check nothing breaks)
b444899
to
e3543e2
Compare
Artifacts upload triggered. View details here |
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 2 of 4 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware)
crates/blockifier/src/transaction/transactions_test.rs
line 904 at r5 (raw file):
&& l1_data_max_amount == l1_data_gas && l1_data_max_price == l1_data_gas_price );
Compare AllResourceBounds
objects
Suggestion:
ValidResourceBounds::AllResources(resources) => {
assert_matches!(
tx_error,
TransactionExecutionError::TransactionPreValidationError(
TransactionPreValidationError::TransactionFeeError(
TransactionFeeError::ResourcesBoundsExceedBalance {
bounds: resource_bounds,
..
}
)
)
if resources == resource_bounds
);
e3543e2
to
21653a6
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: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @yoavGrs)
crates/blockifier/src/transaction/transactions_test.rs
line 904 at r5 (raw file):
Previously, yoavGrs wrote…
Compare
AllResourceBounds
objects
yes!! much better
Artifacts upload triggered. View details here |
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: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @yoavGrs)
a discussion (no related file):
Previously, dorimedini-starkware wrote…
py side pr (change in error formatting, need to check nothing breaks)
passes
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: complete! all files reviewed, all discussions resolved (waiting on @dorimedini-starkware)
This change is