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): migrate remaining tests to all resource bounds (except execution flavors test) #1342

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/blockifier/src/concurrency/fee_utils_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ use crate::transaction::objects::FeeType;
use crate::transaction::test_utils::{
account_invoke_tx,
block_context,
default_l1_resource_bounds,
default_all_resource_bounds,
};

#[rstest]
pub fn test_fill_sequencer_balance_reads(
block_context: BlockContext,
default_l1_resource_bounds: ValidResourceBounds,
default_all_resource_bounds: ValidResourceBounds,
#[values(CairoVersion::Cairo0, CairoVersion::Cairo1)] erc20_version: CairoVersion,
) {
let account = FeatureContract::AccountWithoutValidations(CairoVersion::Cairo1);
let account_tx = account_invoke_tx(invoke_tx_args! {
sender_address: account.get_instance_address(0),
calldata: create_trivial_calldata(account.get_instance_address(0)),
resource_bounds: default_l1_resource_bounds,
resource_bounds: default_all_resource_bounds,
});
let chain_info = &block_context.chain_info;
let state = &mut test_state_inner(chain_info, BALANCE, &[(account, 1)], erc20_version);
Expand Down
26 changes: 13 additions & 13 deletions crates/blockifier/src/transaction/account_transactions_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ fn test_insufficient_max_fee_reverts(

#[rstest]
fn test_deploy_account_constructor_storage_write(
default_l1_resource_bounds: ValidResourceBounds,
default_all_resource_bounds: ValidResourceBounds,
block_context: BlockContext,
#[values(CairoVersion::Cairo0, CairoVersion::Cairo1)] cairo_version: CairoVersion,
) {
Expand All @@ -1275,7 +1275,7 @@ fn test_deploy_account_constructor_storage_write(
chain_info,
deploy_account_tx_args! {
class_hash,
resource_bounds: default_l1_resource_bounds,
resource_bounds: default_all_resource_bounds,
constructor_calldata: constructor_calldata.clone(),
},
);
Expand All @@ -1301,7 +1301,7 @@ fn test_deploy_account_constructor_storage_write(
fn test_count_actual_storage_changes(
max_fee: Fee,
block_context: BlockContext,
default_l1_resource_bounds: ValidResourceBounds,
default_all_resource_bounds: ValidResourceBounds,
#[case] version: TransactionVersion,
#[case] fee_type: FeeType,
#[values(CairoVersion::Cairo0, CairoVersion::Cairo1)] cairo_version: CairoVersion,
Expand Down Expand Up @@ -1344,7 +1344,7 @@ fn test_count_actual_storage_changes(
let mut state = TransactionalState::create_transactional(&mut state);
let invoke_args = invoke_tx_args! {
max_fee,
resource_bounds: default_l1_resource_bounds,
resource_bounds: default_all_resource_bounds,
version,
sender_address: account_address,
calldata: write_1_calldata,
Expand Down Expand Up @@ -1482,7 +1482,7 @@ fn test_count_actual_storage_changes(
#[case::tx_version_3(TransactionVersion::THREE)]
fn test_concurrency_execute_fee_transfer(
max_fee: Fee,
default_l1_resource_bounds: ValidResourceBounds,
default_all_resource_bounds: ValidResourceBounds,
#[case] version: TransactionVersion,
) {
// TODO(Meshi, 01/06/2024): make the test so it will include changes in
Expand All @@ -1501,7 +1501,7 @@ fn test_concurrency_execute_fee_transfer(
sender_address: account.get_instance_address(0),
max_fee,
calldata: create_trivial_calldata(test_contract.get_instance_address(0)),
resource_bounds: default_l1_resource_bounds,
resource_bounds: default_all_resource_bounds,
version
});
let fee_type = &account_tx.fee_type();
Expand Down Expand Up @@ -1548,7 +1548,7 @@ fn test_concurrency_execute_fee_transfer(
sender_address: account.get_instance_address(0),
calldata: transfer_calldata,
max_fee,
resource_bounds: default_l1_resource_bounds,
resource_bounds: default_all_resource_bounds,
});

let execution_result =
Expand Down Expand Up @@ -1582,7 +1582,7 @@ fn test_concurrency_execute_fee_transfer(
#[case::tx_version_3(TransactionVersion::THREE)]
fn test_concurrent_fee_transfer_when_sender_is_sequencer(
max_fee: Fee,
default_l1_resource_bounds: ValidResourceBounds,
default_all_resource_bounds: ValidResourceBounds,
#[case] version: TransactionVersion,
) {
let mut block_context = BlockContext::create_for_account_testing();
Expand All @@ -1599,7 +1599,7 @@ fn test_concurrent_fee_transfer_when_sender_is_sequencer(
max_fee,
sender_address: account_address,
calldata: create_trivial_calldata(test_contract.get_instance_address(0)),
resource_bounds: default_l1_resource_bounds,
resource_bounds: default_all_resource_bounds,
version
});
let fee_type = &account_tx.fee_type();
Expand Down Expand Up @@ -1717,7 +1717,7 @@ fn test_initial_gas(
#[rstest]
fn test_revert_in_execute(
block_context: BlockContext,
default_l1_resource_bounds: ValidResourceBounds,
default_all_resource_bounds: ValidResourceBounds,
) {
let account = FeatureContract::AccountWithoutValidations(CairoVersion::Cairo1);
let chain_info = &block_context.chain_info;
Expand All @@ -1735,7 +1735,7 @@ fn test_revert_in_execute(
// Skip validate phase, as we want to test the revert in the execute phase.
let validate = false;
let tx_execution_info = account_invoke_tx(invoke_tx_args! {
resource_bounds: default_l1_resource_bounds,
resource_bounds: default_all_resource_bounds,
..tx_args
})
.execute(state, &block_context, true, validate)
Expand All @@ -1748,7 +1748,7 @@ fn test_revert_in_execute(
#[rstest]
fn test_call_contract_that_panics(
mut block_context: BlockContext,
default_l1_resource_bounds: ValidResourceBounds,
default_all_resource_bounds: ValidResourceBounds,
#[values(true, false)] enable_reverts: bool,
#[values("test_revert_helper", "bad_selector")] inner_selector: &str,
) {
Expand Down Expand Up @@ -1785,7 +1785,7 @@ fn test_call_contract_that_panics(
state,
&block_context,
invoke_tx_args! {
resource_bounds: default_l1_resource_bounds,
resource_bounds: default_all_resource_bounds,
..tx_args
},
)
Expand Down
Loading