Skip to content

Commit

Permalink
build(fee): add code to l2 cost
Browse files Browse the repository at this point in the history
  • Loading branch information
nimrod-starkware committed Sep 4, 2024
1 parent 93b2535 commit 93ab828
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions crates/blockifier/src/transaction/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 93ab828

Please sign in to comment.