From f69343d83735c44275099d7e1c3c193b1126568c Mon Sep 17 00:00:00 2001 From: Dori Medini Date: Thu, 10 Oct 2024 12:42:07 +0300 Subject: [PATCH] test(blockifier): add all resource bounds to stateful validator test --- .../src/blockifier/stateful_validator_test.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/crates/blockifier/src/blockifier/stateful_validator_test.rs b/crates/blockifier/src/blockifier/stateful_validator_test.rs index 1a30749fd5..42b2b57b04 100644 --- a/crates/blockifier/src/blockifier/stateful_validator_test.rs +++ b/crates/blockifier/src/blockifier/stateful_validator_test.rs @@ -11,6 +11,7 @@ use crate::transaction::account_transaction::AccountTransaction; use crate::transaction::test_utils::{ block_context, create_account_tx_for_validate_test_nonce_0, + default_all_resource_bounds, default_l1_resource_bounds, FaultyAccountTxCreatorArgs, INVALID, @@ -33,7 +34,8 @@ fn test_tx_validator( #[case] validate_constructor: bool, #[case] tx_version: TransactionVersion, block_context: BlockContext, - default_l1_resource_bounds: ValidResourceBounds, + #[values(default_l1_resource_bounds(), default_all_resource_bounds())] + resource_bounds: ValidResourceBounds, #[values(CairoVersion::Cairo0, CairoVersion::Cairo1)] cairo_version: CairoVersion, ) { let chain_info = &block_context.chain_info; @@ -54,7 +56,7 @@ fn test_tx_validator( validate_constructor, // TODO(Arni, 1/5/2024): Add test for insufficient maximal resources. max_fee: BALANCE, - resource_bounds: default_l1_resource_bounds, + resource_bounds, ..Default::default() }; @@ -75,7 +77,10 @@ fn test_tx_validator( } #[rstest] -fn test_tx_validator_skip_validate(default_l1_resource_bounds: ValidResourceBounds) { +fn test_tx_validator_skip_validate( + #[values(default_l1_resource_bounds(), default_all_resource_bounds())] + resource_bounds: ValidResourceBounds, +) { let block_context = BlockContext::create_for_testing(); let faulty_account = FeatureContract::FaultyAccount(CairoVersion::Cairo1); let state = test_state(&block_context.chain_info, BALANCE, &[(faulty_account, 1)]); @@ -87,7 +92,7 @@ fn test_tx_validator_skip_validate(default_l1_resource_bounds: ValidResourceBoun tx_version: TransactionVersion::THREE, sender_address: faulty_account.get_instance_address(0), class_hash: faulty_account.get_class_hash(), - resource_bounds: default_l1_resource_bounds, + resource_bounds, ..Default::default() });