diff --git a/crates/blockifier/src/versioned_constants_test.rs b/crates/blockifier/src/versioned_constants_test.rs index 4f9b96c16f..d3c0898369 100644 --- a/crates/blockifier/src/versioned_constants_test.rs +++ b/crates/blockifier/src/versioned_constants_test.rs @@ -1,5 +1,8 @@ use glob::{glob, Paths}; use pretty_assertions::assert_eq; +use rstest::rstest; +use starknet_api::block::NonzeroGasPrice; +use starknet_api::test_utils::{DEFAULT_STRK_L1_GAS_PRICE, DEFAULT_STRK_L2_GAS_PRICE}; use super::*; @@ -193,3 +196,18 @@ fn test_syscall_gas_cost_calculation() { EXPECTED_SHA256PROCESSBLOCK_GAS_COST ); } + +#[rstest] +#[case::strk(DEFAULT_STRK_L1_GAS_PRICE, DEFAULT_STRK_L2_GAS_PRICE)] +fn test_convert_l1_to_l2_gas_price_round_up( + #[case] l1_gas_price: NonzeroGasPrice, + #[case] expected_l2_gas_price: NonzeroGasPrice, +) { + let result_l2_gas_price = NonzeroGasPrice::new( + VersionedConstants::latest_constants() + .convert_l1_to_l2_gas_price_round_up(l1_gas_price.into()), + ) + .unwrap(); + + assert_eq!(expected_l2_gas_price.get(), result_l2_gas_price.get()); +} diff --git a/crates/starknet_api/src/test_utils.rs b/crates/starknet_api/src/test_utils.rs index 2c27cd73db..bb77458046 100644 --- a/crates/starknet_api/src/test_utils.rs +++ b/crates/starknet_api/src/test_utils.rs @@ -133,7 +133,7 @@ pub const DEFAULT_ETH_L1_DATA_GAS_PRICE: NonzeroGasPrice = pub const DEFAULT_STRK_L1_DATA_GAS_PRICE: NonzeroGasPrice = NonzeroGasPrice::new_unchecked(GasPrice(u128::pow(10, 9))); // Given in units of STRK. pub const DEFAULT_STRK_L2_GAS_PRICE: NonzeroGasPrice = - NonzeroGasPrice::new_unchecked(GasPrice(u128::pow(10, 9))); + NonzeroGasPrice::new_unchecked(GasPrice(25 * u128::pow(10, 5))); // Deprecated transactions: pub const MAX_FEE: Fee = DEFAULT_L1_GAS_AMOUNT.nonzero_saturating_mul(DEFAULT_ETH_L1_GAS_PRICE); diff --git a/crates/starknet_integration_tests/tests/end_to_end_flow_test.rs b/crates/starknet_integration_tests/tests/end_to_end_flow_test.rs index e648c437ba..38ea6451c8 100644 --- a/crates/starknet_integration_tests/tests/end_to_end_flow_test.rs +++ b/crates/starknet_integration_tests/tests/end_to_end_flow_test.rs @@ -44,10 +44,10 @@ async fn end_to_end(mut tx_generator: MultiAccountTransactionGenerator) { let heights_to_build = next_height.iter_up_to(LAST_HEIGHT.unchecked_next()); let expected_content_ids = [ Felt::from_hex_unchecked( - "0x7d62e32fd8f1a12104a5d215af26ec0f362da81af3d14c24e08e46976cdfbf5", + "0x78cdcd66ef1a1a42a7371e6a404fdd7128e60b9112343d50fad31fbdbe62d9e", ), Felt::from_hex_unchecked( - "0x259aeaad847bffe6c342998c4510e5e474577219cfbb118f5cb2f2286260d52", + "0x7666c8a2ba55220e85f64e91897ab17d1a6e74b72cfbaa65e59d50af0a87cef", ), ];