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

build(fee): add code to l2 cost #461

Closed
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
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
Loading