From ab12d0eccf21a7c901889f4ff32e24294ecd6792 Mon Sep 17 00:00:00 2001 From: Nimrod Weiss Date: Wed, 14 Aug 2024 15:00:33 +0300 Subject: [PATCH] build(fee): add code to l2 cost --- crates/blockifier/src/transaction/objects.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/crates/blockifier/src/transaction/objects.rs b/crates/blockifier/src/transaction/objects.rs index e7c2b45ce6..65e448f46f 100644 --- a/crates/blockifier/src/transaction/objects.rs +++ b/crates/blockifier/src/transaction/objects.rs @@ -416,15 +416,11 @@ impl StarknetResources { versioned_constants: &VersionedConstants, include_l2_gas: bool, ) -> GasVector { - if include_l2_gas { - todo!() - } else { - GasVector::from_l1_gas( - (versioned_constants.l2_resource_gas_costs.gas_per_code_byte - * u128_from_usize(self.code_size)) - .to_integer(), - ) - } + let gas = (versioned_constants.l2_resource_gas_costs.gas_per_code_byte + * u128_from_usize(self.code_size)) + .to_integer(); + // Does that make sense? + if include_l2_gas { GasVector::from_l2_gas(gas) } else { GasVector::from_l1_gas(gas) } } /// Returns the gas cost of the transaction's state changes.