Skip to content

Commit

Permalink
Merge pull request #2494 from eqlabs/vbar/convert-l1-data-gas
Browse files Browse the repository at this point in the history
fix: sending l1 data gas to gateway
  • Loading branch information
vbar authored Jan 17, 2025
2 parents 40af995 + 64daa18 commit 843cf4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions crates/gateway-types/src/reply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -856,8 +856,7 @@ pub mod transaction {
Self {
l1_gas: value.l1_gas.into(),
l2_gas: value.l2_gas.into(),
// TODO: add this when adding support for Starknet 0.13.4
l1_data_gas: None,
l1_data_gas: value.l1_data_gas.map(|g| g.into()),
}
}
}
Expand Down
13 changes: 6 additions & 7 deletions crates/rpc/src/method/trace_block_transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,10 @@ pub(crate) fn map_gateway_trace(
fn map_gateway_function_invocation(
invocation: starknet_gateway_types::trace::FunctionInvocation,
) -> anyhow::Result<pathfinder_executor::types::FunctionInvocation> {
let gas_consumed = invocation
.execution_resources
.total_gas_consumed
.unwrap_or_default();
Ok(pathfinder_executor::types::FunctionInvocation {
calldata: invocation.calldata,
contract_address: invocation.contract_address,
Expand Down Expand Up @@ -486,13 +490,8 @@ fn map_gateway_function_invocation(
result: invocation.result,
computation_resources: map_gateway_computation_resources(invocation.execution_resources),
execution_resources: InnerCallExecutionResources {
l1_gas: invocation
.execution_resources
.total_gas_consumed
.map(|gas| gas.l1_gas)
.unwrap_or_default(),
// TODO: Use proper l1_gas value for Starknet 0.13.3
l2_gas: 0,
l1_gas: gas_consumed.l1_gas,
l2_gas: gas_consumed.l2_gas.unwrap_or_default(),
},
})
}
Expand Down

0 comments on commit 843cf4a

Please sign in to comment.